Compare commits

...

1896 Commits

Author SHA1 Message Date
Jim Meyering
7d72c942bb . 1996-12-12 01:34:44 +00:00
Jim Meyering
f17cc2e29c . 1996-12-12 01:34:08 +00:00
Jim Meyering
4f4111709c . 1996-12-12 01:33:13 +00:00
Jim Meyering
beed39a03c . 1996-12-11 06:08:42 +00:00
Jim Meyering
d5f09a0fd1 . 1996-12-11 05:38:45 +00:00
Jim Meyering
3692f57123 . 1996-12-11 04:49:30 +00:00
Jim Meyering
d3d5565035 [_POSIX_VERSION]: Don't declare wait. That declaration
conflicted with the one on i386-pc-isc3.0, now that I've removed the
AC_ISC_POSIX macro and _POSIX_VERSION is no longer defined.
1996-12-11 04:48:51 +00:00
Jim Meyering
3e39947b49 . 1996-12-11 04:38:33 +00:00
Jim Meyering
c8a3fc9bed . 1996-12-11 04:37:22 +00:00
Jim Meyering
d43b4dcaf8 (EXTRA_DIST): Add strftime.c to appease automake.
Although it's not used yet, it'll be used by ls's (to-be-done)
--format=FORMAT option.
1996-12-11 04:34:37 +00:00
Jim Meyering
54f9b87874 . 1996-12-10 22:40:16 +00:00
Jim Meyering
1c28626053 . 1996-12-10 21:37:09 +00:00
Jim Meyering
6c674869b3 . 1996-12-10 21:32:54 +00:00
Jim Meyering
888a5250a5 . 1996-12-10 21:20:41 +00:00
Jim Meyering
d468c227b0 renamed from build-script.pl 1996-12-10 21:16:48 +00:00
Jim Meyering
52314f2cd8 . 1996-12-10 21:16:47 +00:00
Jim Meyering
8d2b4f9786 . 1996-12-10 21:16:08 +00:00
Jim Meyering
b44299cfd7 mk-script.pl: Rename from build-script.pl. 1996-12-10 21:11:55 +00:00
Jim Meyering
5ea5ea9d2c . 1996-12-10 20:59:35 +00:00
Jim Meyering
7d21f2f4d0 . 1996-12-10 20:59:15 +00:00
Jim Meyering
73db5c12b9 . 1996-12-10 20:49:27 +00:00
Jim Meyering
53ac4c028b (EXTRA_DIST): Add mktime.c.
Reported by Thomas Bushnell.
1996-12-10 20:48:12 +00:00
Jim Meyering
916a46a980 . 1996-12-10 13:04:48 +00:00
Jim Meyering
8b59538e69 . 1996-12-10 13:02:55 +00:00
Jim Meyering
eb34cbfc13 . 1996-12-10 13:01:32 +00:00
Jim Meyering
4360d0f52d . 1996-12-10 06:14:52 +00:00
Jim Meyering
e74a22ebb7 . 1996-12-10 06:12:41 +00:00
Jim Meyering
fcc65666b5 . 1996-12-10 06:11:50 +00:00
Jim Meyering
a16b0a142f Include config.h.
[!HAVE_BCOPY && HAVE_MEMCPY && !defined (bcopy)]: Define bcopy
in terms of memcpy.  Reported by Marcus Daniels.
1996-12-10 05:22:12 +00:00
Jim Meyering
5c39a3b65b . 1996-12-10 05:10:56 +00:00
Jim Meyering
4885753994 . 1996-12-10 04:54:02 +00:00
Jim Meyering
156de2ae7a . 1996-12-10 04:46:16 +00:00
Jim Meyering
40f8a7ad2b . 1996-12-10 04:43:44 +00:00
Jim Meyering
8f477a9072 (Convert): Don't reject all dates in 2038.
Some fit in 31 bits.
1996-12-10 04:34:18 +00:00
Jim Meyering
d5ce3b1c3c . 1996-12-10 04:27:12 +00:00
Jim Meyering
54d0c0bb5a . 1996-12-10 04:26:40 +00:00
Jim Meyering
09c73133aa . 1996-12-10 03:17:10 +00:00
Jim Meyering
17fe725ebb add a space 1996-12-10 03:17:01 +00:00
Jim Meyering
c02f8ed500 revert last change. 1996-12-10 03:16:36 +00:00
Jim Meyering
90b901cd1c . 1996-12-10 03:01:43 +00:00
Jim Meyering
73c7efa3ee . 1996-12-10 02:58:00 +00:00
Jim Meyering
e155f4bf01 [HAVE_TZNAME || defined __LIBC]: Declare tzname. 1996-12-10 02:46:42 +00:00
Jim Meyering
1d3c57118b (find_mount_point): Convert from K&R style header to ANSI.
Patch from Kaveh Ghazi.
1996-12-10 00:28:02 +00:00
Jim Meyering
195b5ebbe7 . 1996-12-10 00:25:00 +00:00
Jim Meyering
ba788477a8 Include config.h before testing for TERMIOS_NEEDS_XOPEN_SOURCE.
Patch from Karl Heuer.
1996-12-10 00:20:17 +00:00
Jim Meyering
6846ffa9d9 . 1996-12-09 23:54:45 +00:00
Jim Meyering
4fb3a6f765 [HAVE_TZNAME]: Declare tzname.
Patch from Karl Heuer.
1996-12-09 13:02:21 +00:00
Jim Meyering
5460d4a9c8 . 1996-12-09 04:45:08 +00:00
Jim Meyering
7f5d303c61 . 1996-12-09 03:13:15 +00:00
Jim Meyering
a65bae921e . 1996-12-09 03:12:38 +00:00
Jim Meyering
89cf1fc2cf . 1996-12-08 13:31:12 +00:00
Jim Meyering
a13947a7a3 . 1996-12-08 13:30:49 +00:00
Jim Meyering
ddc2531899 . 1996-12-08 13:29:07 +00:00
Jim Meyering
80729c5841 (noinst_LIBRARIES): Rename to lib?u.a as per
new automake requirement.
Rename ?u_* variables to lib?u_a_*.
1996-12-08 13:28:43 +00:00
Jim Meyering
83ada8596c . 1996-12-08 06:09:29 +00:00
Jim Meyering
2a1d6f9b5f (get_win_size): Rename formal parameter from fileno to FD. 1996-12-08 06:09:21 +00:00
Jim Meyering
f2ac53d4ea . 1996-12-08 05:56:37 +00:00
Jim Meyering
f31b9b9fee . 1996-12-08 05:35:20 +00:00
Jim Meyering
acc8601b65 (main): Call setlocale, bindtextdomain, and textdomain.
From Michel Robitaille.
1996-12-08 04:24:35 +00:00
Jim Meyering
8dd5415e02 . 1996-12-08 04:24:26 +00:00
Jim Meyering
8a4da0e3ff . 1996-12-07 19:54:02 +00:00
Jim Meyering
95f9b268e9 . 1996-12-07 19:45:44 +00:00
Jim Meyering
d2ad9d8cf4 . 1996-12-07 19:25:40 +00:00
Jim Meyering
0ccd71dd94 (init_header): Fix typo: cons tchar' -> const char'. From Roland. 1996-12-07 19:12:44 +00:00
Jim Meyering
1c7be9d1bb . 1996-12-07 19:03:23 +00:00
Jim Meyering
c9893d18e3 [__SVR4]: Define SVR4.
Remove duplicate `|| defined(SVR4)' disjunct guarding the
#define KERNEL_FILE "/unix" definiton.
1996-12-07 19:03:13 +00:00
Jim Meyering
fb1f09c76e . 1996-12-07 18:57:11 +00:00
Jim Meyering
b1cc662215 (strftime): Remove " %Z" part of format for %c. Suggestion from Paul Eggert. 1996-12-07 18:52:54 +00:00
Jim Meyering
f86a3c16d3 patch from Roland Huebner 1996-12-07 05:47:28 +00:00
Jim Meyering
6d244887aa . 1996-12-06 12:39:39 +00:00
Jim Meyering
f86df3250c (init_store_cols): Put parens around ... ? ... : ... expr. 1996-12-05 05:01:30 +00:00
Jim Meyering
65a915647c Use NULL instead of e.g., `(char *) 0'. 1996-12-05 04:59:26 +00:00
Jim Meyering
2882d4477d (init_header): Move dcl of FMT into block where it's used. 1996-12-05 04:55:51 +00:00
Jim Meyering
2793223907 Reindent with -TCOLUMN.
(main): Add two sets of curly braces for readability.
1996-12-05 04:49:12 +00:00
Jim Meyering
a5937bbc71 (usage): Add \n\ at end of first line. 1996-12-05 04:43:19 +00:00
Jim Meyering
d0cac59c72 (separator_string): dcl parameter const.
Add __P in fwd dcl.
1996-12-05 04:35:39 +00:00
Jim Meyering
ed0923a11c Apply big patch (patch-20) from Roland Huebner. 1996-12-05 04:33:33 +00:00
Jim Meyering
42096600e3 . 1996-12-05 03:18:34 +00:00
Jim Meyering
523fb680f6 . 1996-12-05 03:16:24 +00:00
Jim Meyering
3f36b30756 . 1996-12-05 03:13:39 +00:00
Jim Meyering
4a1512e4b2 (main) [!POSIXLY_CORRECT]: Allow the identity mappings:
[:upper:] to [:upper:] and [:lower:] to [:lower:].
(main) [POSIXLY_CORRECT]: Give a more specific diagnostic for the
identity mappings [:upper:] to [:upper:] and [:lower:] to [:lower:].
(class_ok): Update table to reflect that tr now allows these
identity mappings.
1996-12-05 03:13:33 +00:00
Jim Meyering
ad44ac84c8 (print_color_indicator): Initialize EXT to NULL. 1996-12-04 01:21:28 +00:00
Jim Meyering
c7975ba578 . 1996-12-03 03:02:45 +00:00
Jim Meyering
62a92dec57 . 1996-12-03 02:58:59 +00:00
Jim Meyering
a37e7e6b78 . 1996-12-03 02:57:47 +00:00
Jim Meyering
d5718682cc . 1996-12-03 02:46:09 +00:00
Jim Meyering
81e3dc9283 . 1996-12-03 02:45:07 +00:00
Jim Meyering
daa3f22091 . 1996-12-03 02:35:01 +00:00
Jim Meyering
b87899c834 (print_color_indicator): Check the file's suffix only
if it's a regular file.
(print_type_indicator): Use S_IXUGO instead of writing out
(S_IEXEC | S_IXGRP | S_IXOTH).
(length_of_file_name_and_frills): Likewise.
1996-12-03 02:33:09 +00:00
Jim Meyering
4accfeb4e0 [!S_IXUGO] (S_IXUGO): Define it. 1996-12-03 02:32:44 +00:00
Jim Meyering
377b0c7942 . 1996-12-01 19:21:49 +00:00
Jim Meyering
4331f5f978 . 1996-12-01 19:18:08 +00:00
Jim Meyering
fb19eec511 . 1996-12-01 19:17:36 +00:00
Jim Meyering
b712dcba25 . 1996-12-01 19:17:07 +00:00
Jim Meyering
caad57f5d0 . 1996-12-01 19:15:10 +00:00
Jim Meyering
807b8b05c2 (date): Interpret the date, L/M/N, as YYYY/MM/DD
if L >= 1000, otherwise as MM/DD/YY.  With this change,
date --date=DATE accepts dates like those in an RCS log listing.
1996-12-01 19:15:03 +00:00
Jim Meyering
5f3fa7a284 . 1996-12-01 19:14:43 +00:00
Jim Meyering
c1032f08e5 . 1996-12-01 04:12:08 +00:00
Jim Meyering
0aa0b007b0 Update from GNU libc. 1996-12-01 04:08:17 +00:00
Jim Meyering
c6973beeec Change `:' in text of menu to <colon> to avoid problems
with M-x info follow-node.
1996-11-30 14:21:01 +00:00
Jim Meyering
d99d106c55 . 1996-11-30 05:37:43 +00:00
Jim Meyering
61f8fa059c . 1996-11-30 04:34:58 +00:00
Jim Meyering
9279ffdf29 . 1996-11-30 04:33:36 +00:00
Jim Meyering
0682a5efe9 (copy_file): Allow installation from non-directory (rather than only regular)
files.  Suggestion from Charles Karney.
1996-11-30 04:33:30 +00:00
Jim Meyering
dc68073b21 . 1996-11-30 04:20:37 +00:00
Jim Meyering
78c6df8fb8 (uname): Document --processor (-p). 1996-11-30 04:20:01 +00:00
Jim Meyering
f03282e857 (main) [HAVE_SYSINFO && SI_ARCHITECTURE]: Support -p (print processor type).
(usage): Document it.
1996-11-30 04:18:19 +00:00
Jim Meyering
7e9e29f392 (main): Accept -F as a synonym for -t for compatibility
with Solaris.  From Peter Eriksson.
1996-11-30 04:08:02 +00:00
Jim Meyering
28f8f53bb6 . 1996-11-30 04:07:32 +00:00
Jim Meyering
ab8182fa71 . 1996-11-30 03:21:11 +00:00
Jim Meyering
d740a98d4a (main): Close stdout and check result, in case any deferred writes fail.
Use EXIT_SUCCESS and EXIT_FAILURE in exit and usage calls.
1996-11-30 03:20:48 +00:00
Jim Meyering
40e0727bed . 1996-11-30 03:08:46 +00:00
Jim Meyering
a387531246 . 1996-11-28 23:50:17 +00:00
Jim Meyering
be44044a29 (find_mount_point): Use strip_trailing_slashes and dirname
instead of open-coding them.  When given FILE containing no slashes,
chdir to the directory containing it (the current directory) rather
than to `..'.
1996-11-28 23:50:13 +00:00
Jim Meyering
ae9d905134 . 1996-11-28 23:18:45 +00:00
Jim Meyering
bcb8610977 (get_fs_usage): If DISK is 0 and we needed to use
it, return -1 with 0 in ERRNO.

From Miles.
1996-11-28 19:37:01 +00:00
Jim Meyering
ac66871c65 (find_mount_point): Use save_cwd/restore_cwd.
"save-cwd.h": New include.

(show_dev): Deal with null values for DISK and FSTYPE,
including interpreting special 0 errno return from get_fs_usage.
(show_point): Don't fail if we can't find a mount entry for POINT,
just call show_dev with 0 values and let it fail if necessary.
(main): Require a non-zero MOUNT_LIST only if showing all filesystems.
(find_mount_point): New function.
(xgetcwd): New declaration.

All from Miles.
1996-11-28 19:35:33 +00:00
Jim Meyering
3fa102417e . 1996-11-28 06:32:39 +00:00
Jim Meyering
59b58a58f6 . 1996-11-28 06:30:36 +00:00
Jim Meyering
f46bcc918b . 1996-11-27 05:24:41 +00:00
Jim Meyering
784928401d merge with 0.10.25 1996-11-27 05:13:21 +00:00
Jim Meyering
1a62ae1a5c . 1996-11-27 05:06:09 +00:00
Jim Meyering
952a4436eb (fraccompare): Add explicit int' in register' dcl, to
avoid new warning from gcc.
1996-11-27 05:05:52 +00:00
Jim Meyering
a098f5b9b6 . 1996-11-27 05:04:48 +00:00
Jim Meyering
5d691b7b74 . 1996-11-27 05:00:15 +00:00
Jim Meyering
84ee79c745 Fix Franc,ois' name. From Karl B. 1996-11-25 14:36:18 +00:00
Jim Meyering
4b091b8a14 Fix Franc,ois' name. From Karl B. 1996-11-25 14:35:45 +00:00
Jim Meyering
c51d0a5a9b . 1996-11-25 04:45:59 +00:00
Jim Meyering
29ea1d5db9 . 1996-11-25 04:42:37 +00:00
Jim Meyering
b910477e63 . 1996-11-25 04:42:15 +00:00
Jim Meyering
2f74178b8b . 1996-11-25 03:15:46 +00:00
Jim Meyering
fe171f7d8f . 1996-11-25 03:12:57 +00:00
Jim Meyering
b0244698f9 . 1996-11-25 03:10:03 +00:00
Jim Meyering
7c0ec3e569 . 1996-11-25 03:09:33 +00:00
Jim Meyering
4677a7e42f (t): Add names of those 5 tests. 1996-11-25 03:09:22 +00:00
Jim Meyering
520f4efee9 Add 5 tests to exercize just-fixed code. 1996-11-25 03:08:52 +00:00
Jim Meyering
0d43bad18e (set_ordering): Revert 1994-05-04 change to this function
so that blanks are not unconditionally ignored when computing start
and end positions for numeric keys.  Reported by Markus Demleitner.
1996-11-25 03:07:52 +00:00
Jim Meyering
0dd914edd1 . 1996-11-24 18:11:22 +00:00
Jim Meyering
161db26bd1 (get_win_size): Take a FILENO parameter rather than
trying to get a size from both stdin and stdout.
Update callers.
Use STDIN_FILENO and STDOUT_FILENO instead of literal 0, 1.
1996-11-24 18:06:35 +00:00
Jim Meyering
a992c841ae Big patch from Karl Heuer. FIXME: fill in details 1996-11-24 17:03:24 +00:00
Jim Meyering
9299cf1e78 (EXTRA_DIST): Add getline.c now that getline
isn't mentioned in AC_REPLACE_FUNCS.
1996-11-24 05:38:29 +00:00
Jim Meyering
970083559f . 1996-11-24 05:27:21 +00:00
Jim Meyering
459453639e . 1996-11-24 05:21:39 +00:00
Jim Meyering
0e0ae2b348 remove trailing blanks 1996-11-24 03:05:11 +00:00
Jim Meyering
cb7fcc32ff remove trailing blanks 1996-11-24 03:04:12 +00:00
Jim Meyering
d7e8ccb6f3 (usage): Remove trailing pair of blanks. 1996-11-24 03:00:37 +00:00
Jim Meyering
a811674834 . 1996-11-23 22:16:31 +00:00
Jim Meyering
fa9f16326a (usage): Alphabetize option descriptions the way sort -f would. 1996-11-23 22:16:19 +00:00
Jim Meyering
c13ff9b8bc . 1996-11-23 22:13:55 +00:00
Jim Meyering
bded355394 (usage): Alphabetize option descriptions the way sort -f would. 1996-11-23 22:13:00 +00:00
Jim Meyering
f43bd3fafc . 1996-11-23 22:10:08 +00:00
Jim Meyering
e298f1f300 (usage): Alphabetize options like sort -f would. 1996-11-23 22:06:55 +00:00
Jim Meyering
8102404465 . 1996-11-23 05:04:56 +00:00
Jim Meyering
bef51e36a4 . 1996-11-23 04:22:46 +00:00
Jim Meyering
5425625fb3 . 1996-11-23 04:16:43 +00:00
Jim Meyering
94d1ea4fa9 (copy): With -i and not -f, prompt for any type of
(non-directory) source file before overwriting an existing target.
Reported by Mark A. Thomas.
1996-11-23 04:15:35 +00:00
Jim Meyering
9645d076db . 1996-11-23 02:36:54 +00:00
Jim Meyering
b683d9194f . 1996-11-23 02:36:09 +00:00
Jim Meyering
38da840313 (main): Warn if excess arguments are ignored.
E.g., printf foo bar now ignores the single non-format argument, bar.
1996-11-23 02:34:31 +00:00
Jim Meyering
b36e061e8a . 1996-11-23 02:32:19 +00:00
Jim Meyering
0d3f6a6665 (process_regexp): Update CURRENT_LINE only if
the new value would be larger.  This avoids the infinite loop
otherwise provoked by situations like this:
printf "\na\n" | csplit - '/a/-1' '{*}'
From Jens Schmidt.
1996-11-23 02:32:10 +00:00
Jim Meyering
aa00ea2e88 remove my @comco address 1996-11-21 02:42:52 +00:00
Jim Meyering
aad274a82b . 1996-11-21 02:39:37 +00:00
Jim Meyering
fc949b713e (xgethostname): Work around bug in SunOS5.5's gethostname. 1996-11-21 02:38:40 +00:00
Jim Meyering
fbc246ca8f . 1996-11-20 06:36:09 +00:00
Jim Meyering
789a8aa03a . 1996-11-20 06:34:41 +00:00
Jim Meyering
179a2c3034 . 1996-11-20 05:18:13 +00:00
Jim Meyering
a27d168615 . 1996-11-20 05:17:50 +00:00
Jim Meyering
29fa517ae4 . 1996-11-20 05:13:57 +00:00
Jim Meyering
4b7c7e9d33 Remove unused declaration of mktime. From Tony Leneis. 1996-11-18 02:54:14 +00:00
Jim Meyering
daf9bddd16 . 1996-11-18 02:51:09 +00:00
Jim Meyering
9b3733bd9a . 1996-11-18 02:50:30 +00:00
Jim Meyering
a4f0dde547 (main): Ignore -a, for compatibility with SVR4. 1996-11-18 02:50:21 +00:00
Jim Meyering
e604ed756f . 1996-11-05 05:24:53 +00:00
Jim Meyering
1cf3018183 . 1996-11-05 05:20:03 +00:00
Jim Meyering
138d155fb8 . 1996-11-05 04:47:40 +00:00
Jim Meyering
4d091498a4 Thu Oct 31 19:32:32 1996 Miles Bader <miles@gnu.ai.mit.edu>
[ENAMETOOLONG] (xgethostname): If gethostname
returns an error other than buffer overflow, exit with an error
message instead of allocating infinite amounts of space.
[!EXIT_FAILURE] (EXIT_FAILURE): New macro.
<errno.h>: New include.
[!errno] (errno): New declaration.
1996-11-05 04:38:41 +00:00
Jim Meyering
1e3de0b6d9 . 1996-11-05 04:26:34 +00:00
Jim Meyering
25a9b70b2e Fix copyright. 1996-11-05 04:23:22 +00:00
Jim Meyering
45bf8ec9d0 Fix copyright. 1996-11-05 04:22:40 +00:00
Jim Meyering
4a253e5be0 . 1996-11-05 04:11:31 +00:00
Jim Meyering
71a04268b5 libitize 1996-11-05 03:38:23 +00:00
Jim Meyering
6c6ea1a14d . 1996-11-05 02:31:02 +00:00
Jim Meyering
9691c2050b from franc,ois 1996-11-04 18:15:56 +00:00
Jim Meyering
2876587b55 libitize 1996-11-04 18:11:58 +00:00
Jim Meyering
1eb3a8c9ba libitize 1996-11-04 18:07:38 +00:00
Jim Meyering
39fd156a8e New version from Franois Pinard. 1996-11-04 18:05:10 +00:00
Jim Meyering
f137758903 libitize 1996-11-04 18:01:20 +00:00
Jim Meyering
895c2213db libitize 1996-11-04 17:59:28 +00:00
Jim Meyering
50720fb367 libitize 1996-11-04 17:58:21 +00:00
Jim Meyering
f6516b6dd3 libitize 1996-11-04 17:57:34 +00:00
Jim Meyering
564001a9e7 . 1996-11-04 17:56:16 +00:00
Jim Meyering
25abc2a9b4 (recover_mode): Fail also if there are too many fields. From Karl Heuer. 1996-11-04 00:22:26 +00:00
Jim Meyering
70196747af cpp-indent + change some #ifdef to #if 1996-11-03 23:53:51 +00:00
Jim Meyering
04e102f64f . 1996-11-03 23:44:15 +00:00
Jim Meyering
432ebf7912 . 1996-11-03 23:43:36 +00:00
Jim Meyering
84b3a78396 Include sys/types.h for the definitions
(otherwise missing on some systems) of caddr_t (used by
sys/socket.h) and ushort (used by netinet/in.h).  From Karl Heuer.
1996-11-03 20:59:43 +00:00
Jim Meyering
9eb9f31c3a . 1996-11-03 14:44:30 +00:00
Jim Meyering
7f82c56f15 . 1996-11-03 14:42:03 +00:00
Jim Meyering
5582e6dad3 change bug-reporting address 1996-11-03 03:16:27 +00:00
Jim Meyering
2e55854100 change bug-reporting address 1996-11-03 03:16:23 +00:00
Jim Meyering
8114f3fcdb change bug-reporting address 1996-11-02 23:40:19 +00:00
Jim Meyering
45c541daa1 . 1996-11-02 20:51:40 +00:00
Jim Meyering
17c0c658f1 change bug-reporting address 1996-11-02 20:44:52 +00:00
Jim Meyering
b8e689dc67 change bug-reporting address 1996-11-02 20:44:15 +00:00
Jim Meyering
87b19e8a11 . 1996-11-02 19:24:35 +00:00
Jim Meyering
a1c6ed64c0 . 1996-11-02 16:05:47 +00:00
Jim Meyering
f2c14100c3 . 1996-11-02 15:28:22 +00:00
Jim Meyering
1a58046071 (gobble_file): Set linkok for non-orphaned symlinks.
From Bauke Jan Douma.
(gobble_file): Initialize linkok.
With these two changes, ls --color should display orphaned symlinks
as blinking text on terminals that support it.
1996-11-02 15:28:08 +00:00
Jim Meyering
b3b3cf98c6 . 1996-11-02 15:06:36 +00:00
Jim Meyering
30bf49ce02 . 1996-11-02 15:05:57 +00:00
Jim Meyering
a5ecd84c1f . 1996-11-02 15:02:25 +00:00
Jim Meyering
9b29731f08 . 1996-11-02 14:53:43 +00:00
Jim Meyering
a140942848 . 1996-11-02 14:50:31 +00:00
Jim Meyering
1291b1652a (MAKEINFO): Set to makeinfo --no-split.
Otherwise, the generated info files have 15-byte names and that
loses on systems with 14-byte max.
1996-11-02 14:47:46 +00:00
Jim Meyering
1b5b75d13e . 1996-11-02 06:16:56 +00:00
Jim Meyering
f1af346ad5 (main): Give better diagnostic.
Suggestion from Karl Berry.
1996-11-02 06:16:44 +00:00
Jim Meyering
431bbb9c57 update copyright 1996-11-02 06:00:18 +00:00
Jim Meyering
7d62b5ce1c update copyright 1996-11-02 05:59:20 +00:00
Jim Meyering
a345a56001 . 1996-11-02 05:53:00 +00:00
Jim Meyering
b5f8cdecfb Update from GNU libc. 1996-11-02 05:51:53 +00:00
Jim Meyering
fa53b43c97 . 1996-11-02 05:28:36 +00:00
Jim Meyering
23bce5b115 . 1996-11-02 05:28:21 +00:00
Jim Meyering
da952f6227 . 1996-11-02 05:24:50 +00:00
Jim Meyering
31926f3a37 . 1996-11-02 05:24:25 +00:00
Jim Meyering
a71e22991b Add a test to exercize this fix. 1996-11-02 05:19:40 +00:00
Jim Meyering
d74d789bea Add test 17. 1996-11-02 05:19:02 +00:00
Jim Meyering
950325ee23 . 1996-11-02 05:14:21 +00:00
Jim Meyering
c941e1742d . 1996-11-02 05:09:54 +00:00
Jim Meyering
0bd1289ad1 . 1996-11-02 03:51:47 +00:00
Jim Meyering
febf70b73f [!ENABLE_ASSERTIONS]: Guard NDEBUG definition.
(checkfp): Fix off-by-one error that resulted in writing one byte
beyond the end of a malloc'd buffer.  It caused `sort -c' to segfault
on Linux systems having a relatively recent libc.  Before, running
the command, perl -e "print 'x' x 30, \"\n\";"|sort -c
would provoke the memory overrun (though not necessarily the failure).
Add an assertion.
1996-11-02 03:47:04 +00:00
Jim Meyering
b5a71af82a Remap yacc globals to have gd_ prefix.
Suggestion to do as in gdb/c-exp.y from Tom Tromey.
1996-11-01 00:32:12 +00:00
Jim Meyering
876c63c92f Remap yacc globals to have pt_ prefix.
Suggestion to do as in gdb/c-exp.y from Tom Tromey.
1996-11-01 00:31:57 +00:00
Jim Meyering
b3ca6696cd . 1996-11-01 00:09:34 +00:00
Jim Meyering
24e88142ba (key_init): New function.
(main): Use key_init in the two places where it was open-coded.
1996-11-01 00:08:58 +00:00
Jim Meyering
f9cd2cf6e2 (decode_field_spec): Always give FIELD_INDEX a value.
This avoids spurious UMR from purify.
(prjoin): Add an assertion.
(add_field): Update assertion.
1996-10-31 23:55:04 +00:00
Jim Meyering
0a1ac00ad6 (es_free): New function.
(parse_str): Use it to plug small memory leak.
1996-10-31 23:49:42 +00:00
Jim Meyering
e5947e883e . 1996-10-31 02:10:18 +00:00
Jim Meyering
679918ec84 . 1996-10-29 18:06:05 +00:00
Jim Meyering
a9b6fe5c83 . 1996-10-29 18:05:50 +00:00
Jim Meyering
8619a0d598 . 1996-10-29 17:56:06 +00:00
Jim Meyering
d34e6897d8 . 1996-10-29 17:55:38 +00:00
Jim Meyering
55681891e5 . 1996-10-29 17:47:50 +00:00
Jim Meyering
3772a9e885 . 1996-10-29 17:44:03 +00:00
Jim Meyering
1220685f78 libitize 1996-10-29 14:45:55 +00:00
Jim Meyering
f3129d9b19 . 1996-10-29 14:25:25 +00:00
Jim Meyering
b0fd7c9185 . 1996-10-29 14:25:15 +00:00
Jim Meyering
7d70c26629 . 1996-10-29 14:24:52 +00:00
Jim Meyering
ac96de6db4 . 1996-10-29 14:21:15 +00:00
Jim Meyering
1f49981a1f cpp-indent 1996-10-29 14:17:29 +00:00
Jim Meyering
d09ffcb711 libitize 1996-10-29 14:14:08 +00:00
Jim Meyering
33b2a8a1ae . 1996-10-29 13:57:43 +00:00
Jim Meyering
32969f8571 . 1996-10-29 13:56:39 +00:00
Jim Meyering
4abe75d3b1 . 1996-10-29 13:50:37 +00:00
Jim Meyering
e623bf9a03 . 1996-10-29 13:47:56 +00:00
Jim Meyering
0815914f28 . 1996-10-29 13:42:56 +00:00
Jim Meyering
70cf07775b . 1996-10-29 13:41:43 +00:00
Jim Meyering
06382a007d . 1996-10-29 13:40:56 +00:00
Jim Meyering
d7749da3e9 (decode_switches): Make -A set really_all_files to zero
as well as setting all_files to 1.  With this change, ls -f -A prints
everything but . and .., unsorted.  Before, the -A was effectively
ignored.  From Karl Berry.
1996-10-29 12:51:37 +00:00
Jim Meyering
84b8cf9fcf (main): Ignore SIGPIPE. 1996-10-29 04:16:59 +00:00
Jim Meyering
c673119b0b . 1996-10-28 23:52:51 +00:00
Jim Meyering
45d223328e . 1996-10-28 23:49:53 +00:00
Jim Meyering
b8ad9be908 Guard inclusion of stdarg.h and definition of VA_START
with #if PROTOTYPES rather than with #ifdef __STDC__.  The latter
loses with Dynix/PTX.
(wrapf) [PROTOTYPES]: Similarly, guard ANSI-style ... definition.
Suggestion from Marcus Daniels.
1996-10-24 04:46:33 +00:00
Jim Meyering
2be918d5cd . 1996-10-24 03:03:08 +00:00
Jim Meyering
db69dbe9ab Update from GNU libc. 1996-10-24 03:02:57 +00:00
Jim Meyering
4215f6b53a . 1996-10-23 01:39:16 +00:00
Jim Meyering
e1298617bf . 1996-10-23 01:24:26 +00:00
Jim Meyering
720341312b . 1996-10-23 01:24:03 +00:00
Jim Meyering
ed44302c4a . 1996-10-22 23:02:22 +00:00
Jim Meyering
c3b3d48cd4 . 1996-10-22 22:51:22 +00:00
Jim Meyering
a73047bde4 . 1996-10-22 05:07:12 +00:00
Jim Meyering
20862d675d . 1996-10-22 05:05:36 +00:00
Jim Meyering
17e8314c79 . 1996-10-22 05:01:37 +00:00
Jim Meyering
ee791d8ca1 [__linux__]: Don't bother with a.out/nlist/kernel
defines or includes -- Linux systems simply read /proc/loadavg.
1996-10-22 05:01:13 +00:00
Jim Meyering
0c410767ab . 1996-10-22 04:56:22 +00:00
Jim Meyering
3896da90cc (EXTRA_DIST): Remove group-member.c.
Add (temporary hack to work around bug in automake-1.1f) mvdir.c and rmdir.c.
1996-10-22 04:51:44 +00:00
Jim Meyering
0ed25421c6 . 1996-10-22 04:07:14 +00:00
Jim Meyering
194f3d7f5a . 1996-10-22 03:28:44 +00:00
Jim Meyering
e028e025df . 1996-10-22 03:19:35 +00:00
Jim Meyering
8978c64869 . 1996-10-22 03:15:22 +00:00
Jim Meyering
0fd3107ec7 . 1996-10-22 03:09:55 +00:00
Jim Meyering
0416bd8ed0 . 1996-10-21 22:27:48 +00:00
Jim Meyering
d63a1efe26 . 1996-10-21 22:05:28 +00:00
Jim Meyering
43294523f4 . 1996-10-21 21:58:44 +00:00
Jim Meyering
625354dd9e . 1996-10-21 21:54:03 +00:00
Jim Meyering
dc14f81457 Comment out DOS-style suffixes. 1996-10-21 21:52:53 +00:00
Jim Meyering
32f42e0a34 . 1996-10-21 21:50:51 +00:00
Jim Meyering
263773a385 (validate): Remove TAB from diagnostic, for consistency. 1996-10-21 21:50:32 +00:00
Jim Meyering
6afff604a4 . 1996-10-21 21:49:54 +00:00
Jim Meyering
7b4f54f83f (main): Remove TAB from diagnostic, for consistency. 1996-10-21 21:49:41 +00:00
Jim Meyering
24b532175e . 1996-10-21 15:42:14 +00:00
Jim Meyering
543f479cc8 . 1996-10-21 13:46:50 +00:00
Jim Meyering
4b1e41570b . 1996-10-21 03:33:37 +00:00
Jim Meyering
d0fa9d9689 (INCLUDES): Add -I../intl. Reported by Eric Backus. 1996-10-21 03:33:19 +00:00
Jim Meyering
4516e9ec55 . 1996-10-21 00:38:50 +00:00
Jim Meyering
d15f56325a . 1996-10-20 19:16:49 +00:00
Jim Meyering
1dde8333c1 . 1996-10-20 19:14:50 +00:00
Jim Meyering
ac22b4589d (print_entry): Don't take address of UT_TIME_MEMBER directly.
From Ulrich Drepper.
1996-10-20 19:14:37 +00:00
Jim Meyering
2f03e544e1 . 1996-10-20 18:50:41 +00:00
Jim Meyering
412cc2f3fc (md5_process_bytes): Cast void* pointer to char* before
doing arithmetic with it.
1996-10-20 18:44:39 +00:00
Jim Meyering
3cbc95de84 . 1996-10-20 18:43:54 +00:00
Jim Meyering
b3d2d7745e . 1996-10-20 18:06:50 +00:00
Jim Meyering
66d52e0b28 . 1996-10-20 14:07:17 +00:00
Jim Meyering
5ba02801bd Update from GNU libc. 1996-10-20 04:14:25 +00:00
Jim Meyering
03c0cd6569 . 1996-10-19 02:33:20 +00:00
Jim Meyering
c12be5c1d8 . 1996-10-18 05:10:42 +00:00
Jim Meyering
d565995d9b . 1996-10-18 05:09:27 +00:00
Jim Meyering
9fd1b85231 . 1996-10-18 05:09:03 +00:00
Jim Meyering
350690112e . 1996-10-18 05:08:13 +00:00
Jim Meyering
d0acd7bfa5 . 1996-10-18 05:00:15 +00:00
Jim Meyering
4ba06c4102 . 1996-10-18 04:59:01 +00:00
Jim Meyering
cb84de4217 . 1996-10-18 04:56:53 +00:00
Jim Meyering
7111d93669 . 1996-10-18 04:56:19 +00:00
Jim Meyering
97f0f916a2 . 1996-10-18 04:55:16 +00:00
Jim Meyering
42e52b5017 . 1996-10-18 03:05:32 +00:00
Jim Meyering
8ce9769e2f . 1996-10-18 03:02:52 +00:00
Jim Meyering
7d969dab50 libitize 1996-10-17 03:05:09 +00:00
Jim Meyering
d7074bc0e4 . 1996-10-17 03:01:19 +00:00
Jim Meyering
e24c0713be Define and use macro, PARAMS, not __P. 1996-10-17 02:59:09 +00:00
Jim Meyering
9b3498acb2 . 1996-10-17 02:46:33 +00:00
Jim Meyering
ffc5c802c4 libitize 1996-10-17 02:45:32 +00:00
Jim Meyering
12b4578595 libitize 1996-10-17 01:58:19 +00:00
Jim Meyering
e98991ee51 libitize 1996-10-17 01:49:07 +00:00
Jim Meyering
10076ae36a . 1996-10-17 01:44:24 +00:00
Jim Meyering
c96ca77338 . 1996-10-16 04:31:32 +00:00
Jim Meyering
e82e83086c . 1996-10-16 04:29:10 +00:00
Jim Meyering
70ef71caf5 (get_next): Rewrite to treat lower/upper mapping as a special case.
(main): Write separate loops to initialize mapping for lower->upper
and upper->lower conversion.
1996-10-16 04:29:02 +00:00
Jim Meyering
56d2307664 . 1996-10-16 04:25:18 +00:00
Jim Meyering
e98dee7cdd . 1996-10-15 23:22:41 +00:00
Jim Meyering
f3701815f7 . 1996-10-14 20:47:42 +00:00
Jim Meyering
cf3c9c6a11 . 1996-10-13 19:08:39 +00:00
Jim Meyering
beb67dc954 (print_long_format): Use strftime of localtime
(not ctime) to produce the date/time in long listings.
From Rafal Maszkowski.
1996-10-13 19:04:51 +00:00
Jim Meyering
242f2fa2e1 . 1996-10-13 18:27:17 +00:00
Jim Meyering
3d91b69385 . 1996-10-13 17:58:55 +00:00
Jim Meyering
41dfaf296a (__xstrtol): Return an error for invalid suffix.
Before, e.g., `split -b 1M' would be silently accepted and treated
like `split -b 1'.  Reported by Franc,ois.
1996-10-13 17:58:50 +00:00
Jim Meyering
bc2d814543 (usage): Remove parameter, REASON.
(main): Update callers to use combination of error (0, 0, ... and
usage (EXIT_FAILURE).
1996-10-13 17:53:47 +00:00
Jim Meyering
8cb23387cb . 1996-10-13 13:00:34 +00:00
Jim Meyering
82fa812558 . 1996-10-13 12:34:56 +00:00
Jim Meyering
1487a7da95 . 1996-10-12 23:21:40 +00:00
Jim Meyering
1751c454c2 (fstype_to_string): Handle fstypes of freebsd.
From Arne Henrik Juul.
1996-10-12 23:21:32 +00:00
Jim Meyering
da59dde0bb . 1996-10-12 23:19:30 +00:00
Jim Meyering
6099958eda . 1996-10-12 14:02:48 +00:00
Jim Meyering
ffd5a79535 (EXTRA_DIST): Remove. 1996-10-12 05:09:28 +00:00
Jim Meyering
320268ae6d . 1996-10-12 05:04:44 +00:00
Jim Meyering
e45d62703e . 1996-10-12 05:04:04 +00:00
Jim Meyering
6ed9fd4b58 . 1996-10-12 04:17:28 +00:00
Jim Meyering
d0909b6911 (print_uptime): Change #ifdef guard on getloadavg
call from just HAVE_GETLOADAVG to HAVE_GETLOADAVG || C_GETLOADAVG.
From Kaveh R. Ghazi.
1996-10-12 04:17:25 +00:00
Jim Meyering
a64289005d . 1996-10-12 04:06:15 +00:00
Jim Meyering
e42dca4684 . 1996-10-12 04:04:16 +00:00
Jim Meyering
51293cdf6f . 1996-10-11 04:50:54 +00:00
Jim Meyering
4d0af9ead4 (EXTRA_DIST): Remove posixtm.y and getdate.y.
(fu_SOURCES): Put them here instead.
Remove rules for building getdate.c and posixtm.c;  now automake
generates those rules.
1996-10-11 04:49:50 +00:00
Jim Meyering
eed23c25dc (md5_stream): Apply fix from Ralph Loader
<loader@maths.ox.ac.uk> via Ulrich Drepper.
1996-10-11 04:43:40 +00:00
Jim Meyering
8204d34b97 . 1996-10-11 03:42:11 +00:00
Jim Meyering
d80da392e0 . 1996-10-10 14:08:46 +00:00
Jim Meyering
4c53aee40c . 1996-10-10 14:07:29 +00:00
Jim Meyering
3d35ef8670 . 1996-10-10 04:18:05 +00:00
Jim Meyering
5921df05c5 . 1996-10-10 04:15:54 +00:00
Jim Meyering
1a7260cada . 1996-10-10 04:14:40 +00:00
Jim Meyering
969950e526 . 1996-10-10 04:11:07 +00:00
Jim Meyering
fb9ee923ba [__sun]: Define sun. Reported by Kaveh Ghazi. 1996-10-10 03:14:48 +00:00
Jim Meyering
8af03634e6 . 1996-10-10 03:10:41 +00:00
Jim Meyering
e5e9f3ee5d (strftime): Accommodate the broken C compiler
that comes with SunOS -- don't initialize aggregates in decls of
automatic variables.  Reported by Kaveh Ghazi.
1996-10-10 02:56:10 +00:00
Jim Meyering
62ae6ccc22 . 1996-10-10 02:53:58 +00:00
Jim Meyering
c3830e800f indent copyright comment. 1996-10-10 02:51:16 +00:00
Jim Meyering
7200c7fd2e Use #if, not #ifdef in test for HAVE_CONFIG_H. 1996-10-10 02:50:37 +00:00
Jim Meyering
d16bea8f84 . 1996-10-10 02:48:37 +00:00
Jim Meyering
ae0dc43e79 . 1996-10-09 16:14:39 +00:00
Jim Meyering
c6500ed364 . 1996-10-09 12:27:16 +00:00
Jim Meyering
2a5b5534ab . 1996-10-09 12:25:28 +00:00
Jim Meyering
2dc3ad1a76 (usage): Improve brief descriptions of --sort and --time.
From Franois Pinard.
1996-10-09 12:24:26 +00:00
Jim Meyering
1e2d02ace5 . 1996-10-09 12:18:48 +00:00
Jim Meyering
fde482ef0e . 1996-10-09 12:00:05 +00:00
Jim Meyering
9de1f7a589 [!WITH_REGEX]: Include rx.h.
From Andreas Schwab.
1996-10-09 11:55:22 +00:00
Jim Meyering
983e0032e0 . 1996-10-09 05:27:46 +00:00
Jim Meyering
60cb394696 . 1996-10-09 03:47:10 +00:00
Jim Meyering
c5c0528abe update from texinfo-3.9 1996-10-09 03:20:31 +00:00
Jim Meyering
fecbdd9ab1 . 1996-10-09 02:42:17 +00:00
Jim Meyering
5b2210ce71 . 1996-10-09 02:37:53 +00:00
Jim Meyering
3df36d5e2f . 1996-10-09 02:36:55 +00:00
Jim Meyering
a49fa29fed . 1996-10-09 02:35:23 +00:00
Jim Meyering
bb3ecf85bc Include error.h to align with libit -- under protest, Franois :-). 1996-10-09 02:33:18 +00:00
Jim Meyering
b5a2377dc2 . 1996-10-09 02:29:10 +00:00
Jim Meyering
46b5894b8f , 1996-10-09 02:27:56 +00:00
Jim Meyering
1a68844645 . 1996-10-09 02:25:44 +00:00
Jim Meyering
dc522f984c . 1996-10-09 02:19:09 +00:00
Jim Meyering
8573fc6ac9 (usage): Improve diagnostic 1996-10-08 04:37:19 +00:00
Jim Meyering
d4cf394f30 (usage): Improve usage messages 1996-10-08 04:35:19 +00:00
Jim Meyering
79f3064bfa . 1996-10-08 04:34:11 +00:00
Jim Meyering
900e16e5d5 (EXTRA_DIST): Remove names of several files
that automake adds automatically.
(fu_SOURCES): Likewise.
(fu_DEPENDENCIES): Depend on fu_LIBADD.
1996-10-08 04:33:47 +00:00
Jim Meyering
dfc9fc2202 . 1996-10-08 04:31:57 +00:00
Jim Meyering
1b5b3bf6e2 . 1996-10-08 04:26:01 +00:00
Jim Meyering
cb806c0218 . 1996-10-08 02:23:35 +00:00
Jim Meyering
0e6d3d87e4 [__hpux]: Define hpux. From Eric Backus. 1996-10-08 02:06:34 +00:00
Jim Meyering
4b08923fe8 . 1996-10-08 00:58:23 +00:00
Jim Meyering
2edcf647de . 1996-10-08 00:54:50 +00:00
Jim Meyering
0a713ad019 . 1996-10-08 00:54:12 +00:00
Jim Meyering
7026c59810 . 1996-10-08 00:51:25 +00:00
Jim Meyering
4c4eb1ab6c . 1996-10-06 13:03:02 +00:00
Jim Meyering
638d6e19f0 . 1996-10-06 13:02:12 +00:00
Jim Meyering
27d2263af1 . 1996-10-06 03:19:07 +00:00
Jim Meyering
320b9cc697 . 1996-10-06 03:07:35 +00:00
Jim Meyering
28e0bda43b . 1996-10-06 02:54:21 +00:00
Jim Meyering
04af619ed2 . 1996-10-06 02:53:18 +00:00
Jim Meyering
255931762f . 1996-10-05 20:18:41 +00:00
Jim Meyering
f98969cf69 . 1996-10-05 20:17:53 +00:00
Jim Meyering
7c17502e74 (print_long_format): Add support for Cray's migrated dmf files.
From Johan Danielsson.
1996-10-05 20:17:09 +00:00
Jim Meyering
4a2eda04aa (ftypelet): Add support for Cray's migrated dmf files.
From Johan Danielsson.
1996-10-05 20:15:06 +00:00
Jim Meyering
ed43629995 . 1996-10-05 19:14:01 +00:00
Jim Meyering
c177b96b17 . 1996-10-05 18:06:07 +00:00
Jim Meyering
c5de1e3532 (main): update --version output to conform to coding standard 1996-10-05 18:04:52 +00:00
Jim Meyering
148ec1ad9c [HAVE_CONFIG_H]: Include config.h.
From Karl Berry.
1996-10-05 17:40:50 +00:00
Jim Meyering
a13e04ed9d fix --version output 1996-10-05 17:12:55 +00:00
Jim Meyering
98564790bd . 1996-10-05 16:47:37 +00:00
Jim Meyering
f04044ed86 (main): update --version output to conform to coding standard 1996-10-05 16:37:57 +00:00
Jim Meyering
09711894fe . 1996-10-05 13:15:07 +00:00
Jim Meyering
4f28f318d8 (main): update --version output to conform to coding standard 1996-10-05 13:14:11 +00:00
Jim Meyering
e22c80dcf0 . 1996-10-05 03:58:37 +00:00
Jim Meyering
b350b74916 Remove assertions. 1996-10-04 13:42:43 +00:00
Jim Meyering
3400ffe3f2 Add assertions. 1996-10-04 13:42:20 +00:00
Jim Meyering
fdd16fdb62 Update prototype. 1996-10-04 12:22:17 +00:00
Jim Meyering
6f67177fae (parse_long_options): Separate package name
and version number to accomodate new --version output requirement.
1996-10-04 12:21:39 +00:00
Jim Meyering
2c035a7cfd (main): update --version output again 1996-10-04 04:28:35 +00:00
Jim Meyering
be4153d2a8 (main): Remove dead code that used to print --version output. 1996-10-04 04:28:28 +00:00
Jim Meyering
630b771f1b (main): update --version output again 1996-10-04 04:25:46 +00:00
Jim Meyering
de05a873ec (main): update --version output to conform to coding standard 1996-10-04 04:16:01 +00:00
Jim Meyering
3361bd2bca (main): update --version output to conform to coding standard 1996-10-04 04:15:08 +00:00
Jim Meyering
1c6698b17d . 1996-10-03 02:46:05 +00:00
Jim Meyering
a3edb3f940 (usage): Deprecate --print-data-base even though
that's the way GNU make writes it.  `database' is one word.
Add description of FILE argument.
1996-10-03 02:45:59 +00:00
Jim Meyering
9b34a4a7c6 . 1996-10-02 02:57:29 +00:00
Jim Meyering
56c8b44ec6 . 1996-10-02 00:45:15 +00:00
Jim Meyering
50c823be8a . 1996-10-01 17:59:05 +00:00
Jim Meyering
4909374105 . 1996-10-01 17:57:29 +00:00
Jim Meyering
2a91869144 (fu_SOURCES): Remove getline.c
(EXTRA_DIST): Add getline.c
1996-10-01 17:57:04 +00:00
Jim Meyering
41bf50ecb3 . 1996-10-01 17:52:42 +00:00
Jim Meyering
349c3796be Oops! Use ../../src 1996-10-01 17:37:35 +00:00
Jim Meyering
717429e4bc . 1996-10-01 11:55:14 +00:00
Jim Meyering
6c81b98e46 (md5sum): Use ../src/md5sum. 1996-10-01 11:55:01 +00:00
Jim Meyering
cf64a504d8 (md5sum): Set to $srcdir/md5sum. 1996-10-01 04:47:55 +00:00
Jim Meyering
ec693397f0 . 1996-10-01 04:47:21 +00:00
Jim Meyering
04838c31ce . 1996-10-01 04:43:44 +00:00
Jim Meyering
fa3bbe8eb2 . 1996-10-01 04:38:28 +00:00
Jim Meyering
39c406f18a . 1996-10-01 01:10:54 +00:00
Jim Meyering
d7f77ef1cf . 1996-10-01 01:10:10 +00:00
Jim Meyering
31053908a0 (path_concat): Use K&R style function definition. 1996-10-01 01:09:07 +00:00
Jim Meyering
0c7040607d . 1996-09-30 03:49:53 +00:00
Jim Meyering
d81cbf71b4 . 1996-09-30 03:49:26 +00:00
Jim Meyering
b339cb8d84 . 1996-09-30 03:41:36 +00:00
Jim Meyering
d8880083a6 . 1996-09-30 03:05:41 +00:00
Jim Meyering
96cdeb978e (do_copy): Give better error message when copying multiple
files and the last one is not a directory.  From Karl Berry.
Call error (0, 0, ... then usage (1) -- instead of calling usage
with two arguments.
1996-09-30 03:04:54 +00:00
Jim Meyering
b2cc136736 . 1996-09-30 02:57:55 +00:00
Jim Meyering
b394529747 use exp_name in msg when open EXP fails. 1996-09-30 02:57:28 +00:00
Jim Meyering
edfafcd7b7 Reversed order of flags and input. 1996-09-30 02:56:34 +00:00
Jim Meyering
1c75eb6a98 . 1996-09-30 02:43:42 +00:00
Jim Meyering
814dc35407 Die if close fails. 1996-09-30 02:43:22 +00:00
Jim Meyering
99fe905035 . 1996-09-30 02:41:50 +00:00
Jim Meyering
ccf556a616 Die if close fails. 1996-09-30 02:39:46 +00:00
Jim Meyering
d96a2d9e14 . 1996-09-30 01:06:47 +00:00
Jim Meyering
8e11d5dfae . 1996-09-30 00:28:08 +00:00
Jim Meyering
f64f586fdc . 1996-09-30 00:27:48 +00:00
Jim Meyering
6f8e1b2134 . 1996-09-30 00:27:38 +00:00
Jim Meyering
8888bceb65 . 1996-09-30 00:27:11 +00:00
Jim Meyering
78315499ba . 1996-09-30 00:24:30 +00:00
Jim Meyering
e666e3459e . 1996-09-28 18:51:37 +00:00
Jim Meyering
6a9d144a66 . 1996-09-28 18:31:00 +00:00
Jim Meyering
f34578f297 . 1996-09-28 18:25:55 +00:00
Jim Meyering
1dc643390a . 1996-09-28 18:17:08 +00:00
Jim Meyering
ea3702aa6d (backup_types): Declare const.
(backup_args): Likewise.
1996-09-28 18:17:00 +00:00
Jim Meyering
59b9296742 . 1996-09-28 18:09:13 +00:00
Jim Meyering
bf3b759a61 . 1996-09-28 18:08:03 +00:00
Jim Meyering
bc24ebbed0 . 1996-09-28 03:25:27 +00:00
Jim Meyering
10ac9ed1ba Remove references to the now-deprecated --string option. 1996-09-27 02:10:37 +00:00
Jim Meyering
f28de0cbe3 . 1996-09-27 02:10:11 +00:00
Jim Meyering
d7477dbf0c (usage): Remove references in --help output to
the now-deprecated --string option.  Support for it will be
removed soon.
1996-09-27 02:09:57 +00:00
Jim Meyering
b4062862f6 Rewrite to avoid use of --string option. 1996-09-27 02:03:32 +00:00
Jim Meyering
4ddff14202 . 1996-09-26 03:10:04 +00:00
Jim Meyering
c98881bb59 . 1996-09-26 02:59:45 +00:00
Jim Meyering
9016aac157 (t): Factor out .in suffix.
Include new test: t16a.
1996-09-26 02:59:36 +00:00
Jim Meyering
8c5a8ba959 . 1996-09-23 21:16:06 +00:00
Jim Meyering
62a6b18a77 (sort invocation): from Andreas Schwab. 1996-09-23 15:40:34 +00:00
Jim Meyering
0f39512ec6 . 1996-09-23 15:26:37 +00:00
Jim Meyering
77becb06e1 . 1996-09-23 15:01:31 +00:00
Jim Meyering
2ff0c1870c (EXTRA_DIST): Distribute $(TESTS). 1996-09-23 15:01:23 +00:00
Jim Meyering
9438eff8ec . 1996-09-23 03:43:21 +00:00
Jim Meyering
4097b92a07 . 1996-09-23 03:03:36 +00:00
Jim Meyering
7c695a0e5a Add test from sign ext bug from Erick Branderhorst. 1996-09-23 03:03:27 +00:00
Jim Meyering
85cddd3119 (keycompare): Declare translate to be unsigned char *.
Otherwise, sign extension caused misordering when using e.g. -f.
1996-09-23 03:02:04 +00:00
Jim Meyering
3661c96081 . 1996-09-23 02:49:03 +00:00
Jim Meyering
d4368d4802 . 1996-09-23 02:48:35 +00:00
Jim Meyering
34c992c065 merge with 0.10.24 1996-09-22 14:30:37 +00:00
Jim Meyering
e904744174 . 1996-09-22 14:26:29 +00:00
Jim Meyering
47e8713900 . 1996-09-22 14:25:49 +00:00
Jim Meyering
5637dfa191 . 1996-09-21 20:22:14 +00:00
Jim Meyering
ce5730d5c2 . 1996-09-21 18:35:52 +00:00
Jim Meyering
f1a405c1e9 . 1996-09-21 18:34:26 +00:00
Jim Meyering
7f88c2b896 . 1996-09-21 15:24:04 +00:00
Jim Meyering
eaa41b023f (xstrndup): Use message that's the same as the one
you get from e.g., xmalloc.  Reported by Santiago Vila.
1996-09-21 15:23:35 +00:00
Jim Meyering
0867d4efd3 . 1996-09-20 03:48:08 +00:00
Jim Meyering
b12923594b . 1996-09-20 03:47:46 +00:00
Jim Meyering
4f208e731c (fu_SOURCES): Remove regex.c and rx.c.
(EXTRA_DIST): Put them here instead.
1996-09-20 03:47:37 +00:00
Jim Meyering
26b61d5962 . 1996-09-20 03:19:47 +00:00
Jim Meyering
955f5eb1f4 . 1996-09-20 03:17:28 +00:00
Jim Meyering
0e02a64c99 . 1996-09-20 03:16:17 +00:00
Jim Meyering
545c237530 (fu_SOURCES): Move getopt.c and getopt1.c back to here fro EXTRA_DIST. 1996-09-20 03:14:17 +00:00
Jim Meyering
3cc1863ab3 . 1996-09-19 15:39:43 +00:00
Jim Meyering
815261aefc . 1996-09-19 14:12:28 +00:00
Jim Meyering
f599541be9 . 1996-09-19 13:46:49 +00:00
Jim Meyering
c62a6dbaa9 . 1996-09-19 12:55:17 +00:00
Jim Meyering
74388abca3 . 1996-09-19 12:54:24 +00:00
Jim Meyering
e044081627 Replace with FSF version. 1996-09-19 12:54:15 +00:00
Jim Meyering
d1320b7277 . 1996-09-19 12:48:06 +00:00
Jim Meyering
6ac49bdf47 Merge with FSF version. 1996-09-19 12:47:49 +00:00
Jim Meyering
c74ae79fd9 . 1996-09-17 04:14:01 +00:00
Jim Meyering
4b29186f72 (strftime): New version, from GNU libc. 1996-09-17 04:13:22 +00:00
Jim Meyering
94435a6401 . 1996-09-16 04:10:40 +00:00
Jim Meyering
1e26d4455a . 1996-09-16 04:08:38 +00:00
Jim Meyering
3683b0b3ef . 1996-09-10 03:18:30 +00:00
Jim Meyering
2d30458a75 . 1996-09-10 03:10:26 +00:00
Jim Meyering
9cde1990ab (do_copy): Describe in a little *more* detail the code
that makes `cp non-directory file/' (eventually) fail.
1996-09-10 03:09:31 +00:00
Jim Meyering
3fc07d456b (do_copy): Describe in a little more detail the code
that makes `cp non-directory file/' (eventually) fail.
1996-09-10 03:05:15 +00:00
Jim Meyering
73ca459085 . 1996-09-08 22:00:42 +00:00
Jim Meyering
85219ddf0f (usage): Refer to LS_COLORS, not LS_COLOR.
From Santiago Vila Doncel.
1996-09-08 22:00:35 +00:00
Jim Meyering
f471847cac . 1996-09-08 19:10:03 +00:00
Jim Meyering
edbc415595 . 1996-09-08 18:56:57 +00:00
Jim Meyering
e4c1c5efca Prefix $in with \$srcdir/ so make check works with VPATH build.
From Uli Drepper.
1996-09-08 18:56:04 +00:00
Jim Meyering
c830d53afb . 1996-09-08 17:55:31 +00:00
Jim Meyering
4526777121 (do_copy): Set backup_type to `none' only *after*
calling to find_backup_file_name.  Reported by Eli Zaretskii.
1996-09-08 17:55:24 +00:00
Jim Meyering
97df7b0013 . 1996-09-07 18:00:25 +00:00
Jim Meyering
9c28acb705 . 1996-09-07 17:59:35 +00:00
Jim Meyering
7b9e7765ee (INCLUDES): Add -I../intl so compiler will find libintl.h for rpmatch.c. 1996-09-07 17:59:26 +00:00
Jim Meyering
14c6c66b64 . 1996-09-07 17:54:23 +00:00
Jim Meyering
58b136578a . 1996-09-07 17:52:07 +00:00
Jim Meyering
139408f867 Add comments re ctype IS* macros. 1996-09-07 17:50:05 +00:00
Jim Meyering
d2c6e7cba9 Define and use upper case variants of ctype.h IS* macros.
From Bruno Haible.
1996-09-07 17:42:58 +00:00
Jim Meyering
62e0054a8d . 1996-09-07 17:31:09 +00:00
Jim Meyering
a5be9924f2 (check_punctuation): Use ISPUNCT instead of ispunct.
(get_line): Use ISSPACE instead of isspace.
1996-09-07 17:27:25 +00:00
Jim Meyering
f709048a82 revert last change 1996-09-06 03:18:46 +00:00
Jim Meyering
d1f996b486 . 1996-09-06 03:12:38 +00:00
Jim Meyering
d3900b79bc New version from glibc. 1996-09-06 03:12:04 +00:00
Jim Meyering
34d871d67d . 1996-09-06 03:01:01 +00:00
Jim Meyering
71066e34b9 (main): Don't set verbose flag for --changes.
(change_file_mode): If chmod succeeds and --changes was given,
give a diagnostic describing the new permissions.
Reported by Philippe Schnoebelen (phs@fing.edu.uy).
1996-09-06 03:00:56 +00:00
Jim Meyering
4be8ee6d75 . 1996-09-05 23:19:42 +00:00
Jim Meyering
63a48d0278 (do_copy): When concatenating DEST (with a trailing `/') and the basename
part of non-directory SOURCE, don't add a slash between them.
1996-09-05 23:19:33 +00:00
Jim Meyering
b8d66b1704 . 1996-09-05 04:40:15 +00:00
Jim Meyering
d64ae4c1be . 1996-09-05 02:48:48 +00:00
Jim Meyering
1a9771061b Make sure NULL is defined by including stddef.h
(if STDC_HEADERS || _LIBC) or simply defining it (otherwise).
Include sys/types.h for definition of size_t needed by regex.h.
1996-09-05 02:48:41 +00:00
Jim Meyering
5c8eaa8139 . 1996-09-05 02:46:01 +00:00
Jim Meyering
4cfd024d37 (fu_SOURCES): Add regex.c and rx.c.
(noinst_HEADERS): Add regex.h and rx.h.
1996-09-05 02:45:35 +00:00
Jim Meyering
5e053a624b . 1996-09-03 13:15:05 +00:00
Jim Meyering
e3625e3032 this conforms to POSIX.2. From Paul Eggert <eggert@twinsun.com>. 1996-09-03 13:14:57 +00:00
Jim Meyering
4c9586c01b . 1996-09-02 16:31:23 +00:00
Jim Meyering
d9be56f638 . 1996-09-02 16:18:59 +00:00
Jim Meyering
57592bb00e (ENABLE_NLS): Include libintl.h and define _ to gettext. 1996-09-02 16:18:48 +00:00
Jim Meyering
d4fc1b970c . 1996-09-02 15:59:22 +00:00
Jim Meyering
c609fd3e0a . 1996-09-02 15:53:04 +00:00
Jim Meyering
e9d17da073 (usage): Tell where to report bugs. 1996-09-02 15:52:45 +00:00
Jim Meyering
82e99127d2 . 1996-09-02 15:35:05 +00:00
Jim Meyering
c609ba2d13 (usage): Tell where to report bugs. 1996-09-02 15:34:25 +00:00
Jim Meyering
6a52479e0a . 1996-09-02 14:12:33 +00:00
Jim Meyering
1cd5fb882c . 1996-09-01 13:21:48 +00:00
Jim Meyering
27586e4d1b . 1996-09-01 00:02:25 +00:00
Jim Meyering
bfe2a56ac6 (utime_now): Protoize.
Reported by David S. Miller (davem@caip.rutgers.edu).
1996-08-31 23:49:29 +00:00
Jim Meyering
c9fff51897 (usage): remove spurious trailing \n in puts. 1996-08-31 04:44:31 +00:00
Jim Meyering
7e294bac78 (usage): Tell where to report bugs. 1996-08-29 05:05:57 +00:00
Jim Meyering
3d672b27ca quote via kb 1996-08-29 04:23:53 +00:00
Jim Meyering
8726a1e79e . 1996-08-26 04:07:15 +00:00
Jim Meyering
7aea26b817 (EXTRA_DIST): Add $x-tests.
($x-tests): Guard dependencies with @MAINT@.
1996-08-26 04:05:51 +00:00
Jim Meyering
a8676a3282 . 1996-08-26 03:51:49 +00:00
Jim Meyering
e8f7310474 (EXTRA_DIST): Add $x-tests.
($x-tests): Guard dependencies with @MAINT@.
1996-08-26 03:51:33 +00:00
Jim Meyering
3e1ecd65dd . 1996-08-26 03:45:32 +00:00
Jim Meyering
b0ed797534 . 1996-08-25 03:43:03 +00:00
Jim Meyering
3329d17b3e . 1996-08-24 19:30:01 +00:00
Jim Meyering
41e757beb6 (cat): Cast first arg to stpcpy to char*. 1996-08-24 19:28:27 +00:00
Jim Meyering
efe35c166d . 1996-08-24 17:58:08 +00:00
Jim Meyering
2f70dd59c6 . 1996-08-24 17:57:58 +00:00
Jim Meyering
d57a5cc166 Reverse 10f and 10g so sort passes these tests. 1996-08-24 17:57:14 +00:00
Jim Meyering
7216f62cad . 1996-08-22 04:19:34 +00:00
Jim Meyering
f2be7b3cc4 . 1996-08-22 03:29:54 +00:00
Jim Meyering
5c0b9744ab Nit fixes from kb. 1996-08-20 04:44:13 +00:00
Jim Meyering
b0a21fce4c . 1996-08-19 02:30:32 +00:00
Jim Meyering
3649121dff . 1996-08-19 02:30:04 +00:00
Jim Meyering
383690a5f2 . 1996-08-19 02:28:42 +00:00
Jim Meyering
90ce25327c . 1996-08-19 02:24:52 +00:00
Jim Meyering
840c73b381 . 1996-08-19 02:10:31 +00:00
Jim Meyering
7ec03a4414 (noinst_HEADERS): Add path-concat.h.
(fu_SOURCES): Add path-concat.c.
1996-08-19 02:10:25 +00:00
Jim Meyering
0ba429223d Include path-concat.h.
(do_copy): Check path_concat return value.
(path_concat): Remove function.
1996-08-19 02:09:23 +00:00
Jim Meyering
7d234bb98e Include path-concat.h.
(movefile): Use path_concat instead of open-coding its functionality.
Declare pointer parameters const as appropriate.
1996-08-19 02:09:07 +00:00
Jim Meyering
a0d34ce173 . 1996-08-19 01:41:53 +00:00
Jim Meyering
1a6ee7a625 . 1996-08-19 01:28:11 +00:00
Jim Meyering
34ac19cd34 . 1996-08-19 01:27:40 +00:00
Jim Meyering
a79e4f054a Close comment. 1996-08-18 14:56:54 +00:00
Jim Meyering
ad1a0015be . 1996-08-18 14:53:00 +00:00
Jim Meyering
2592c30822 . 1996-08-18 14:40:07 +00:00
Jim Meyering
5e6706b750 . 1996-08-18 14:39:47 +00:00
Jim Meyering
77f32e0b49 In cmp, use $exp_name, not \$srcdir/$exp_name. 1996-08-18 14:39:33 +00:00
Jim Meyering
a0810c6cae . 1996-08-18 14:37:32 +00:00
Jim Meyering
a023f4519e . 1996-08-18 14:32:50 +00:00
Jim Meyering
0055d0a4cc . 1996-08-18 14:32:13 +00:00
Jim Meyering
416715cf93 . 1996-08-18 14:31:42 +00:00
Jim Meyering
730ec4650a Factor out tr as much as possible. 1996-08-18 05:25:08 +00:00
Jim Meyering
98b9e6e30b . 1996-08-18 05:23:53 +00:00
Jim Meyering
9d76e7ffbb . 1996-08-18 05:21:07 +00:00
Jim Meyering
d9f30fc643 . 1996-08-18 05:20:45 +00:00
Jim Meyering
597e0b2a8e . 1996-08-18 05:20:38 +00:00
Jim Meyering
56cd9b9a02 Rename Trtest.pm to Test.pm. 1996-08-18 05:19:55 +00:00
Jim Meyering
12d30b5cd0 . 1996-08-18 05:18:57 +00:00
Jim Meyering
c64c32d89e Converting to perl5 and LoL. 1996-08-18 05:00:28 +00:00
Jim Meyering
7d490ad462 . 1996-08-18 02:51:38 +00:00
Jim Meyering
0347f76632 . 1996-08-18 00:09:15 +00:00
Jim Meyering
b012712ff5 . 1996-08-17 23:59:18 +00:00
Jim Meyering
6f1a0acdbd . 1996-08-17 18:51:16 +00:00
Jim Meyering
b32398d02c (EXTRA_DIST): Distribute tests: inputs and expected outputs. 1996-08-17 18:50:54 +00:00
Jim Meyering
ea15a1e0e5 Prepend srcdir to @INC@. 1996-08-17 18:33:27 +00:00
Jim Meyering
c7066e8caa . 1996-08-17 18:30:48 +00:00
Jim Meyering
fa674d651c . 1996-08-17 18:30:28 +00:00
Jim Meyering
5220e9a46b Remove now-useless Trtest.pm arg to build-script. 1996-08-17 18:30:24 +00:00
Jim Meyering
afddedbd9f . 1996-08-17 17:53:24 +00:00
Jim Meyering
b98971b7a0 Rename test.data.pl to Trtest.pm. 1996-08-17 17:53:21 +00:00
Jim Meyering
9cccef82ce . 1996-08-17 17:50:07 +00:00
Jim Meyering
f6d73bdb80 . 1996-08-17 17:47:49 +00:00
Jim Meyering
91c0d0de6a . 1996-08-17 17:46:54 +00:00
Jim Meyering
283b1a297d . 1996-08-17 17:29:35 +00:00
Jim Meyering
26259134ee . 1996-08-17 17:28:20 +00:00
Jim Meyering
39cf848828 Revamp to use perl5-style list of lists. 1996-08-17 17:27:46 +00:00
Jim Meyering
8dd548d895 . 1996-08-17 17:27:10 +00:00
Jim Meyering
daa3462c64 Don't use main anymore. 1996-08-17 17:27:03 +00:00
Jim Meyering
b7bf84fd73 . 1996-08-17 17:26:29 +00:00
Jim Meyering
a62273dca5 . 1996-08-17 05:15:53 +00:00
Jim Meyering
32f7fc5503 Update from GNU libc -- this adds back %z and %s
formats and reverts to old behavior where unrecognized format like
%E is treated as eqivalent to `E'.
1996-08-17 05:15:44 +00:00
Jim Meyering
99708d72f6 . 1996-08-17 03:39:44 +00:00
Jim Meyering
ec4159d6f6 . 1996-08-17 03:38:17 +00:00
Jim Meyering
3c39169751 . 1996-08-17 03:37:22 +00:00
Jim Meyering
1a68c9ac75 . 1996-08-17 03:22:40 +00:00
Jim Meyering
e7a59c2594 . 1996-08-17 03:13:54 +00:00
Jim Meyering
1ddf714c24 (parse_group): Fail when given an invalid group name.
Reported as Debian Bug#4119 via Erick Branderhorst (branderh@IAEhv.nl).
Declare pointer parameters const as appropriate.
1996-08-17 03:13:46 +00:00
Jim Meyering
69a2d6bce1 . 1996-08-14 02:51:17 +00:00
Jim Meyering
408cfc09b2 . 1996-08-12 03:51:18 +00:00
Jim Meyering
eebe6a6c0c . 1996-08-12 03:48:18 +00:00
Jim Meyering
abd282bf34 . 1996-08-12 03:45:18 +00:00
Jim Meyering
441ebad5cc . 1996-08-12 03:44:11 +00:00
Jim Meyering
26a8544c83 . 1996-08-12 03:42:53 +00:00
Jim Meyering
4fd0132dfc . 1996-08-12 03:42:07 +00:00
Jim Meyering
bd3627904b . 1996-08-12 03:41:47 +00:00
Jim Meyering
a1ab7fb789 . 1996-08-09 04:03:31 +00:00
Jim Meyering
0e4f0390ef . 1996-08-09 03:59:16 +00:00
Jim Meyering
b741c592c5 . 1996-08-05 04:07:42 +00:00
Jim Meyering
81d574033a . 1996-08-05 04:06:11 +00:00
Jim Meyering
aa49f63378 . 1996-08-05 04:04:49 +00:00
Jim Meyering
1a038cb55e . 1996-08-05 03:49:29 +00:00
Jim Meyering
1c892790d9 . 1996-08-05 03:36:01 +00:00
Jim Meyering
bd51f25754 . 1996-08-05 00:14:16 +00:00
Jim Meyering
406c6613bb . 1996-08-04 23:34:33 +00:00
Jim Meyering
c5449cea5a . 1996-08-04 19:44:04 +00:00
Jim Meyering
7cc00778d1 . 1996-08-04 19:43:53 +00:00
Jim Meyering
1dc1d2996a Update for perl5 and use strict. 1996-08-04 16:03:00 +00:00
Jim Meyering
3cf0da722f . 1996-08-04 15:44:42 +00:00
Jim Meyering
7532e57941 (main): Allow `+' in options like -+8 and -+13. 1996-08-04 14:15:25 +00:00
Jim Meyering
5b8cad3534 (main): Set minus_flag to zero in two places.
Otherwise, `nice --1 -3' would mistakenly do the equivalent of `nice --3'.
Thanks to Eric Backus <ericb@lsid.hp.com> for the test cases.
1996-08-03 04:23:43 +00:00
Jim Meyering
e1df5e7167 . 1996-08-03 04:23:08 +00:00
Jim Meyering
1d8ed38329 . 1996-08-03 02:49:46 +00:00
Jim Meyering
c87d06546a (print_uptime) [HAVE_PROC_UPTIME]: Read from /proc/uptime.
From Ulrich Drepper.
1996-08-03 02:49:34 +00:00
Jim Meyering
afe669874a . 1996-08-02 03:45:50 +00:00
Jim Meyering
ee2e84bb6f . 1996-08-02 03:25:54 +00:00
Jim Meyering
d5aa78b540 (ST_NBLOCKS) [_CRAY]: Special case for Cray.
From by Johan Danielsson.
1996-08-02 03:25:39 +00:00
Jim Meyering
2a5f4c45e1 (get_fs_usage) [STAT_STATFS4] [_CRAY]: Define f_bavail to f_bfree.
From by Johan Danielsson.
1996-08-02 03:25:10 +00:00
Jim Meyering
0fa3eb4d22 . 1996-08-01 04:46:51 +00:00
Jim Meyering
b10f778bf5 [LINK_TYPE]: Remove macro. NLS messages aren't
extracted from macros.
(link_type_string): New global variable to be used instead of
LINK_TYPE.
(main): Set it here.
(do_link): Use it (instead of macro) here.
1996-08-01 04:42:08 +00:00
Jim Meyering
e9ed1c0601 tty: Use terminal, not `tty' in description of tty command.
date %W: fix typo in description
Both from Andreas Schwab.
1996-07-31 12:37:58 +00:00
Jim Meyering
729bd79cb8 . 1996-07-31 04:47:04 +00:00
Jim Meyering
402b4612f8 [HAVE_SYS_FS_S5PARAM_H]: Include sys/fs/s5param.h
to work around bug in sys/filsys.h of Fujitsu UXP/V.
Reported by Johan Danielsson.
1996-07-31 04:43:59 +00:00
Jim Meyering
a044608569 . 1996-07-31 04:39:33 +00:00
Jim Meyering
d660831c5a (DO_CHOWN): New macro -- derived from code in copy.
(copy): Use DO_CHOWN to assure that any newly-created symbolic
links have proper owner and group.
1996-07-31 04:39:25 +00:00
Jim Meyering
9ba877cf28 Update from GNU libc master. 1996-07-30 05:33:30 +00:00
Jim Meyering
e22b1e56e6 *** empty log message *** 1996-07-29 05:06:11 +00:00
Jim Meyering
cd2e2180d9 . 1996-07-27 22:30:11 +00:00
Jim Meyering
6932ade12e (bindtextdomain) [!ENABLE_NLS]: Undefine to avoid
redefinition warnings on solaris.
(textdomain) [!ENABLE_NLS]: Likewise.
1996-07-27 22:29:01 +00:00
Jim Meyering
c49c9a04e1 . 1996-07-26 04:32:30 +00:00
Jim Meyering
b294dd43a1 (unexpand): Move EOF check to follow code that
processes and generates output for pending spaces.
Before `printf '  ' |unexpand -t 1,2' generated no output.
1996-07-26 04:31:29 +00:00
Jim Meyering
7ce576ff06 (md5_check): Remove parameter, BINARY.
Rename local TYPE_FLAG to BINARY, so md5_file uses the binary mode
from the input stream rather than the one from the command line.
(main): Fail with a diagnostic if --binary or --text is specified
when verifying checksums.
Reported by Eli Zaretskii <eliz@is.elta.co.il>.
1996-07-26 04:11:21 +00:00
Jim Meyering
733c16465d . 1996-07-26 04:11:11 +00:00
Jim Meyering
981f5ba012 (main): Fix typo in getopt_long string: s/n/h/.
Reported by Ken Pizzini.
1996-07-26 02:11:34 +00:00
Jim Meyering
0e180c8f19 (usage): Remove -h. It is not an option.
Reported by Ulrich Drepper.
1996-07-25 03:25:32 +00:00
Jim Meyering
005ed75540 cv. 1996-07-22 04:50:43 +00:00
Jim Meyering
52211041ad . 1996-07-22 04:42:16 +00:00
Jim Meyering
304295c24c . 1996-07-22 01:57:10 +00:00
Jim Meyering
a56da10982 (rpmatch): Add back [[:alpha:]]. Drepper says it's the standard. 1996-07-22 01:01:10 +00:00
Jim Meyering
1089f9b929 . 1996-07-21 22:48:46 +00:00
Jim Meyering
ccd0e2e27a (yesno) [!HAVE_RPMATCH]: Remove function since we'll
always use the rpmatch-based version.
Declare rpmatch.
1996-07-21 22:48:41 +00:00
Jim Meyering
96a39fa3f6 . 1996-07-21 22:46:46 +00:00
Jim Meyering
08ffff5615 [STDC_HEADERS]: Guard inclusion of stdlib.h.
(_) [!_]: Define it.
(try): Add RESPONSE parameter.
(rpmatch): Update caller.
Change the regular expressions to be ^[yY] and ^[nN].
1996-07-21 22:46:39 +00:00
Jim Meyering
16efa02b77 . 1996-07-21 22:41:26 +00:00
Jim Meyering
7f26c2724a . 1996-07-21 17:25:50 +00:00
Jim Meyering
81b7ecbc14 (EXTRA_DIST): Add rpmatch.c. 1996-07-21 17:25:10 +00:00
Jim Meyering
bd6aa3080a . 1996-07-21 17:16:13 +00:00
Jim Meyering
7f1cf81aba . 1996-07-21 17:13:47 +00:00
Jim Meyering
3af4a12ae3 (yesno) [HAVE_RPMATCH]: New rpmatch-based version of the function. 1996-07-21 17:13:41 +00:00
Jim Meyering
deee2015f3 (EXTRA_DIST): Put error.c and obstack.c here...
(fu_SOURCES): Instead of here.
1996-07-21 17:11:10 +00:00
Jim Meyering
9d06a0075d . 1996-07-21 17:11:01 +00:00
Jim Meyering
1d791a1487 . 1996-07-21 17:01:52 +00:00
Jim Meyering
998e5ad1c0 . 1996-07-21 16:59:36 +00:00
Jim Meyering
67c2366944 . 1996-07-21 16:57:47 +00:00
Jim Meyering
bb952869e7 . 1996-07-21 14:52:33 +00:00
Jim Meyering
35b1d6a948 . 1996-07-21 14:51:46 +00:00
Jim Meyering
63dece38a1 (usage): Correct typo (-iucl -> -iuclc) in usage message.
From Thomas Olsson <d95to@efd.lth.se>.
1996-07-21 14:51:02 +00:00
Jim Meyering
3904fb599e . 1996-07-20 22:14:05 +00:00
Jim Meyering
7b7b289e2d . 1996-07-20 21:01:55 +00:00
Jim Meyering
f8939357a3 . 1996-07-20 05:24:15 +00:00
Jim Meyering
5f79c9e91b (path_concat): Rewrite to return new parameter.
(do_copy): Update uses of path_concat to use new parameter.
Use that new pointer to compute correct offset for make_path_private.
Before, cp --recursive --parents SRC DEST failed when SRC was
an absolute file name.  E.g.,
% cd /tmp; rm -rf d f; mkdir d; touch f; cp -PR /tmp/f d
cp: tmp: No such file or directory
Reported by Horst von Brand vonbrand@sleipnir.valparaiso.cl.
1996-07-20 05:24:09 +00:00
Jim Meyering
16c56c7d73 [_AIX]: Add #pragma alloca.
From Bernd Leibing <bernd.leibing@rz.uni-ulm.de>.
1996-07-19 03:56:23 +00:00
Jim Meyering
8c074a6577 . 1996-07-19 03:15:30 +00:00
Jim Meyering
2feeeb5972 . 1996-07-19 03:00:00 +00:00
Jim Meyering
89495b81dd (main): Initialize for internationalized message support:
call setlocale, bindtextdomain, and textdomain.  Reported by
Michel Robitaille <robitail@IRO.UMontreal.CA>.
1996-07-19 02:59:54 +00:00
Jim Meyering
a5c67e1c05 . 1996-07-18 04:44:54 +00:00
Jim Meyering
b288e0f8f5 . 1996-07-18 04:36:09 +00:00
Jim Meyering
5d3af013b0 . 1996-07-18 04:15:00 +00:00
Jim Meyering
b734adb860 Include <sys/types.h> before system.h. 1996-07-18 04:14:51 +00:00
Jim Meyering
88db35dd77 Include <sys/types.h> before system.h. 1996-07-18 04:14:19 +00:00
Jim Meyering
6efc03fd41 Include <sys/types.h> before system.h. 1996-07-18 04:13:52 +00:00
Jim Meyering
befcaa08e8 . 1996-07-18 03:37:55 +00:00
Jim Meyering
59834c2c06 . 1996-07-17 05:34:40 +00:00
Jim Meyering
ed48dc8cae Use `;' instead of (void)0. 1996-07-17 05:29:47 +00:00
Jim Meyering
f3bcc28b21 . 1996-07-17 03:30:55 +00:00
Jim Meyering
e549af7279 (OFF_T_MAX): Remove definition.
(main): Compare against LONG_MAX rather than OFF_T_MAX.
1996-07-17 03:13:54 +00:00
Jim Meyering
e5c3e23ec4 . 1996-07-17 03:13:45 +00:00
Jim Meyering
03cc8c8ca3 [OFF_T_MAX]: Use (unsigned long)1' rather than (off_t)1'
so the left operand of the << isn't signed.
From Kaveh Ghazi.
1996-07-16 05:14:00 +00:00
Jim Meyering
dc84f5c5c9 . 1996-07-16 05:13:16 +00:00
Jim Meyering
e0ac832842 Use `(void)0' as second arg to add macro.
Omitting that second arg made some HPUX C compiler report an error.
From Kaveh R. Ghazi.
1996-07-16 05:08:29 +00:00
Jim Meyering
ff1fc50954 Update from FSF. 1996-07-16 04:58:04 +00:00
Jim Meyering
9e10989282 (print_uptime): Reverse days' and day' in uptime message.
From Kaveh R. Ghazi.
1996-07-16 04:50:12 +00:00
Jim Meyering
4bca95c431 Update from libit. 1996-07-16 04:47:23 +00:00
Jim Meyering
f60dafdac2 Update FSF address.
Remove trailing blanks.
1996-07-16 04:44:29 +00:00
Jim Meyering
ee9cf50a0f . 1996-07-16 04:43:51 +00:00
Jim Meyering
e023911555 Oops. Always return destination. 1996-07-16 03:06:32 +00:00
Jim Meyering
b19da298ac . 1996-07-15 04:49:34 +00:00
Jim Meyering
7efa2ba5c4 indent cpp-directives 1996-07-15 03:57:44 +00:00
Jim Meyering
19bff1c02d indent cpp-directives 1996-07-15 03:56:06 +00:00
Jim Meyering
fd984b9655 . 1996-07-15 03:44:04 +00:00
Jim Meyering
6014da9e30 update FSF address in copyright 1996-07-15 03:43:36 +00:00
Jim Meyering
e5e6e34ead update FSF address in copyright 1996-07-15 03:38:07 +00:00
Jim Meyering
e8b07e3796 update FSF address in copyright 1996-07-15 03:36:16 +00:00
Jim Meyering
1b5bb5c05a update FSF address in copyright and remove any trailing blanks 1996-07-15 02:44:11 +00:00
Jim Meyering
1df37f767c update FSF address in copyright and remove any trailing blanks 1996-07-15 02:41:49 +00:00
Jim Meyering
77973edc33 cpp-indent 1996-07-15 02:29:59 +00:00
Jim Meyering
48e4b51e96 . 1996-07-15 01:07:26 +00:00
Jim Meyering
9c53920ae6 (print_uptime): Use 0, not undefined errno in
couldn't-get-boot-time diagnostic.  From Ulrich Drepper.
1996-07-15 01:07:16 +00:00
Jim Meyering
993b49a693 update fsf address 1996-07-15 00:04:51 +00:00
Jim Meyering
bf72a5728f update fsf address 1996-07-15 00:02:50 +00:00
Jim Meyering
48209ca1ba update fsf address 1996-07-15 00:00:57 +00:00
Jim Meyering
7cb6a4e2f1 update fsf address
cpp-indent
1996-07-14 23:59:45 +00:00
Jim Meyering
7d026dd508 [HAVE_LIMITS_H]: Include limits.h for INT_MAX.
[!INT_MAX]: Define it.
(main): Append INT_MAX to command-line-specified tab list to
ensure termination in unexpand's inner loop.
Derived from a patch from Keith Owens.
1996-07-14 22:28:52 +00:00
Jim Meyering
178f23fbb7 (unexpand): Fix bug that contributed to endless loop
when invoking `echo '  ' |unexpand -t 1,2': use print_tab_index, not
tab_index in inner flush_pend: while loop.  From Keith Owens
<kaos@audio.apana.org.au>.
1996-07-14 22:24:28 +00:00
Jim Meyering
75b93231ca Remove my address. 1996-07-14 21:47:23 +00:00
Jim Meyering
23684f8383 formatting... 1996-07-14 19:09:41 +00:00
Jim Meyering
4b8b59894b Return a value! 1996-07-14 15:05:40 +00:00
Jim Meyering
ade337e1a8 . 1996-07-14 12:54:20 +00:00
Jim Meyering
d38f60e27c (usage): Sort option descriptions in dictionary order. 1996-07-14 12:54:12 +00:00
Jim Meyering
bf75b72e46 Indent nested CPP-directives. 1996-07-14 12:45:09 +00:00
Jim Meyering
dbd0c33f24 update FSF address in copyright 1996-07-14 12:44:09 +00:00
Jim Meyering
4d7a57cf34 (long_options): Add missing last line of NULL
entries.  From Ralph Loader <loader@maths.ox.ac.uk>.
1996-07-14 12:37:24 +00:00
Jim Meyering
1c2c9330d9 . 1996-07-14 12:36:51 +00:00
Jim Meyering
836935c5e6 Libit tweaks. 1996-07-14 12:35:45 +00:00
Jim Meyering
2e789ea9b2 Tweak for libit. 1996-07-14 12:32:25 +00:00
Jim Meyering
a4a64560c0 Tweak for libit. 1996-07-14 12:32:01 +00:00
Jim Meyering
65f957107e fix comment 1996-07-14 12:19:15 +00:00
Jim Meyering
e9d60dc000 . 1996-07-14 04:11:25 +00:00
Jim Meyering
c58cd08bf9 (usage): Add a \' after \n' in usage message.
Otherwise, SunOS's /bin/cc chokes.
1996-07-14 04:11:17 +00:00
Jim Meyering
900a826cf8 . 1996-07-13 19:31:51 +00:00
Jim Meyering
7fe510422e [GWINSZ_BROKEN]: Remove thus-guarded `#undef TIOCGWINSZ'.
GWINSZ_BROKEN can't be defined anymore.
1996-07-13 19:31:34 +00:00
Jim Meyering
1ba9563160 . 1996-07-13 19:27:59 +00:00
Jim Meyering
4bef2ec5f7 . 1996-07-13 19:26:22 +00:00
Jim Meyering
c98ea50c21 . 1996-07-12 03:25:19 +00:00
Jim Meyering
78697777d7 . 1996-07-12 03:05:04 +00:00
Jim Meyering
83696460f0 . 1996-07-12 02:56:51 +00:00
Jim Meyering
bb8acb3640 . 1996-07-12 02:55:08 +00:00
Jim Meyering
4f29f1aeb2 . 1996-07-11 05:01:47 +00:00
Jim Meyering
36a4ba8ba3 . 1996-07-11 04:27:54 +00:00
Jim Meyering
aaafa60129 . 1996-07-11 04:27:27 +00:00
Jim Meyering
866e778210 . 1996-07-11 03:58:31 +00:00
Jim Meyering
805484b693 use latest from gettext-0.10.23 1996-07-11 03:57:04 +00:00
Jim Meyering
a10e992cbc . 1996-07-10 05:00:21 +00:00
Jim Meyering
44b11d6e67 (usage): Fix parentheses. 1996-07-10 03:56:45 +00:00
Jim Meyering
108f50670d . 1996-07-10 03:45:03 +00:00
Jim Meyering
5885cbf0d2 (UID_T_MAX): Use `(unsigned long)1' rather than
`(uid_t)1' to avoid problems on systems where uid_t is signed.
(GID_T_MAX): Likewise for gid_t.
From Kjetil Torgrim Homme <kjetilho@ifi.uio.no>.
1996-07-10 03:33:01 +00:00
Jim Meyering
640cdd2df4 . 1996-07-10 03:32:41 +00:00
Jim Meyering
a4d13e4b8f (long_options): Add print-data-base and print-database.
(usage): Rearrange option descriptions.
1996-07-10 03:26:18 +00:00
Jim Meyering
12beb90e58 . 1996-07-10 03:18:55 +00:00
Jim Meyering
4623f5dca3 (usage): Add a one-line description to --help message.
From Karl Berry.
1996-07-10 03:18:31 +00:00
Jim Meyering
b124be4eb1 Change C-shell to `C shell'. 1996-07-10 03:16:30 +00:00
Jim Meyering
c8feafc2a5 . 1996-07-10 03:15:51 +00:00
Jim Meyering
84b6d13a3c (dc_parse_stream): Don't give `unrecognized keyword'
message unless we've processed a matching TERM directive.
1996-07-10 03:15:39 +00:00
Jim Meyering
fb604ebdf4 . 1996-07-10 03:09:05 +00:00
Jim Meyering
778dd49f55 . 1996-07-10 03:06:54 +00:00
Jim Meyering
3e0fdc1a0b (MAXCOST): Use (unsigned long)1' rather than (COST)1'
so the left operand of the << isn't signed.
From Kjetil Torgrim Homme.
1996-07-10 03:02:54 +00:00
Jim Meyering
c4610f8bb6 . 1996-07-09 23:23:49 +00:00
Jim Meyering
824081f660 (install-data): Don't install NLS files when they're not requested.
From Ulrich Drepper.  Reported by Kjetil Torgrim Homme <kjetilho@ifi.uio.no>.
1996-07-09 23:23:33 +00:00
Jim Meyering
417bda1b99 . 1996-07-08 04:26:31 +00:00
Jim Meyering
dbb6fa88fd . 1996-07-08 04:26:09 +00:00
Jim Meyering
013f2fe433 Make initial colors for `color_indicator' match those
currently in dircolors.hin.
1996-07-08 04:25:49 +00:00
Jim Meyering
de75384c2b . 1996-07-08 04:23:38 +00:00
Jim Meyering
9d691ba42f Include termios.h.
Guard inclusion of sys/ioctl.h with #ifdef GWINSZ_IN_SYS_IOCTL,
rather than HAVE_SYS_IOCTL_H.  Modelled after sh-utils' stty.c
at suggestion from Chip Bennett <BennettC@j64.stratcom.af.mil>.
1996-07-08 04:19:36 +00:00
Jim Meyering
744ef2d96f Recognize more filename extensions. From Joshua Cowan. 1996-07-08 03:58:36 +00:00
Jim Meyering
0d978396d7 . 1996-07-08 03:55:55 +00:00
Jim Meyering
581db2ffeb . 1996-07-08 03:41:37 +00:00
Jim Meyering
0d1de84756 . 1996-07-07 20:20:44 +00:00
Jim Meyering
c4f9b63aea . 1996-07-06 22:53:29 +00:00
Jim Meyering
0472107417 (usage): Factor out backup-related text into separate string/printf statement. 1996-07-06 22:50:57 +00:00
Jim Meyering
e1de1d3a93 (usage): Factor out backup-related text into separate string/printf statement. 1996-07-06 22:50:36 +00:00
Jim Meyering
46b486ab5b . 1996-07-06 22:29:57 +00:00
Jim Meyering
68bd38e8a0 . 1996-07-06 21:55:23 +00:00
Jim Meyering
b5c86e8130 (su_SOURCES): Remove group-member.c.
(EXTRA_DIST): Add group-member.c here.
1996-07-06 17:50:16 +00:00
Jim Meyering
bd54740062 . 1996-07-06 17:49:27 +00:00
Jim Meyering
8596e37d97 . 1996-07-06 12:04:47 +00:00
Jim Meyering
5eb689ade0 Fix typo: top-srcdir -> top_srcdir. 1996-07-06 04:05:15 +00:00
Jim Meyering
195f8a213e [!STDC_HEADERS]: Declare free. From Marcus Daniels. 1996-07-06 03:17:09 +00:00
Jim Meyering
4d6b56a932 . 1996-07-06 03:02:44 +00:00
Jim Meyering
62a9c01c6d . 1996-07-06 03:00:44 +00:00
Jim Meyering
12dd329a29 Merge from gettext-0.10.23. 1996-07-06 02:59:12 +00:00
Jim Meyering
4a7000742c ($(PACKAGE).pot): Merge from gettext-0.10.23. 1996-07-06 02:58:59 +00:00
Jim Meyering
f41e1ff806 . 1996-07-05 03:58:06 +00:00
Jim Meyering
fa5ef15197 . 1996-07-05 03:40:39 +00:00
Jim Meyering
2b1f600cbd (usage): Remove space before newline in usage message. 1996-07-05 03:40:21 +00:00
Jim Meyering
0396e35b5a . 1996-07-05 03:39:21 +00:00
Jim Meyering
9824efff73 (usage): Remove space before newline in usage message. 1996-07-05 03:39:12 +00:00
Jim Meyering
7fbe57368e (usage): Remove space before newline in usage message. 1996-07-05 02:49:48 +00:00
Jim Meyering
21c0d8f1f0 (usage): Remove space before newline in usage message. 1996-07-05 02:29:10 +00:00
Jim Meyering
316490baea (usage): Remove space before newline in usage message. 1996-07-05 02:28:29 +00:00
Jim Meyering
bd77322580 . 1996-07-04 22:52:25 +00:00
Jim Meyering
09cf102456 . 1996-07-04 22:52:01 +00:00
Jim Meyering
f8514af7a6 (split_3): Add missing semicolon. From Jim Blandy. 1996-07-04 22:51:52 +00:00
Jim Meyering
6b4aadc588 . 1996-07-04 18:18:03 +00:00
Jim Meyering
e2e512d2d6 . 1996-07-04 18:14:46 +00:00
Jim Meyering
a7d29c59fa (main): Fix typo in last change. 1996-07-04 17:41:05 +00:00
Jim Meyering
b2e339dc25 . 1996-07-04 17:35:51 +00:00
Jim Meyering
e7342330e5 Make dir --version' and vdir --version' print their names, not `ls'.
Reported by Ulrich Drepper.
1996-07-04 17:35:47 +00:00
Jim Meyering
3f868304cf . 1996-07-04 14:53:28 +00:00
Jim Meyering
2926167cfa (md5_file): Replace obsolete comment with a description
of the function.
(md5_check): Don't use "s"-adding trick to form the plural of
`checksum.'  That doesn't work well with translation.
Suggestions from Ulrich Drepper.
1996-07-04 14:53:25 +00:00
Jim Meyering
84448306a4 . 1996-07-04 12:41:58 +00:00
Jim Meyering
b97436b18b (MIN_DIGEST_LINE_LENGTH): New macro.
[NEWLINE_REPLACEMENT_STRING*]: Remove macros.
(main): Output a leading backslash for a line describing a file
whose name contains a newline.  Then translate each NEWLINE byte
in the file name to the string, "\\n", and each backslash to "\\\\".
File names that don't contain NEWLINE aren't translated.
(split_3): Rewrite to handle file names with embedded newlines.
Miles Bader and Jim Blandy suggested this new encoding scheme.
1996-07-04 12:41:53 +00:00
Jim Meyering
db07df5448 . 1996-07-04 12:36:18 +00:00
Jim Meyering
4adeb81260 (split_3): Correct test for 35-byte line to accomodate
fact that leading blanks may be stripped.
1996-07-04 04:22:25 +00:00
Jim Meyering
9684207d04 . 1996-07-03 23:00:45 +00:00
Jim Meyering
b467d6d513 Include sys/types.h before system.h.
From Jim Blandy (jimb@cyclic.com).
1996-07-03 22:59:18 +00:00
Jim Meyering
36454232a5 . 1996-07-03 22:42:58 +00:00
Jim Meyering
ce85352146 [!MAXUID]: Define after inclusion of system.h to avoid
warning about redefinition on SunOS4, Solaris2.4 and SGI-irix5.3.
From Kaveh Ghazi.
1996-07-03 22:42:41 +00:00
Jim Meyering
7786c6e2cf . 1996-07-03 04:18:38 +00:00
Jim Meyering
4bd1ffa49a . 1996-07-03 04:05:07 +00:00
Jim Meyering
38762b8f78 (usage): Add omitted \n\ at the end of a line in the usage message. 1996-07-03 04:04:06 +00:00
Jim Meyering
7b2cea5ab2 [!EXIT_SUCCESS]: Define it.
[!EXIT_FAILURE]: Define it.
1996-07-03 04:00:36 +00:00
Jim Meyering
b0d3bfa316 . 1996-07-03 04:00:29 +00:00
Jim Meyering
1672bf6d27 (strndup): Include stdio.h and sys/types.h to
get definition of NULL and size_t on SunOS4.1.3.
1996-07-03 03:59:02 +00:00
Jim Meyering
8736952b0b . 1996-07-03 02:52:20 +00:00
Jim Meyering
bd1fc1c256 . 1996-07-02 04:55:06 +00:00
Jim Meyering
bb4d193ac7 [NEWLINE_REPLACEMENT_STRING]: Define.
(split_3): Translate NL bytes not to NUL, but to
NEWLINE_REPLACEMENT_STRING.
Suggested by Ulrich Drepper.
(main): Translate back to NL-containing filename.
1996-07-02 04:54:51 +00:00
Jim Meyering
7379bd7274 . 1996-07-02 04:48:57 +00:00
Jim Meyering
1372968ab0 (do_link): Update messages to ease translation.
Suggestion from Santiago Vila.
1996-07-02 04:48:32 +00:00
Jim Meyering
d2b4bca42e (main): Remove now-unnecessary diagnostic about filename containing NEWLINE. 1996-07-01 03:48:10 +00:00
Jim Meyering
6dceaa1d9d (split_3): Take an additional parameter, S_LEN.
Adapt caller.
Map translated NEWLINE-containing filename back into the original
NEWLINE-containing name.
(md5_check): Translate NEWLINE bytes to NUL bytes in filename.
1996-07-01 03:47:16 +00:00
Jim Meyering
b288652bbd . 1996-06-30 21:42:53 +00:00
Jim Meyering
2b37242292 (usage): Fix typo, 3nd->3rd, in usage message.
From Santiago Vila <sanvila@unex.es>.
1996-06-30 21:42:49 +00:00
Jim Meyering
afd2d8e4cf . 1996-06-30 14:30:00 +00:00
Jim Meyering
c18996947c . 1996-06-30 14:29:29 +00:00
Jim Meyering
23b80c8e30 . 1996-06-30 04:24:26 +00:00
Jim Meyering
3b92bd0090 . 1996-06-30 00:01:20 +00:00
Jim Meyering
14bc2891a8 . 1996-06-29 23:59:14 +00:00
Jim Meyering
1ebe204c2f . 1996-06-29 23:58:48 +00:00
Jim Meyering
27725d0745 . 1996-06-29 16:45:17 +00:00
Jim Meyering
8977920253 . 1996-06-29 05:33:00 +00:00
Jim Meyering
41b9ee8834 . 1996-06-29 05:29:08 +00:00
Jim Meyering
c4d50b0133 . 1996-06-29 05:28:48 +00:00
Jim Meyering
bb389bead8 Remove u from Colour. 1996-06-29 05:28:32 +00:00
Jim Meyering
326cc336af . 1996-06-29 04:12:05 +00:00
Jim Meyering
cd53ea93c5 (dc_parse_stream): Move enum states dcl into this function.
(dc_parse_stream): Remove parameter RESULT.
Adapt callers.
1996-06-29 04:11:43 +00:00
Jim Meyering
aec69ce220 . 1996-06-29 04:08:10 +00:00
Jim Meyering
b2d08f91db . 1996-06-29 04:07:18 +00:00
Jim Meyering
50cdbb37c8 . 1996-06-29 03:58:52 +00:00
Jim Meyering
e81d02baf1 (do_link): Allow `ln -sf --backup k k' to succeed in creating the
self-referential symlink, doing so doesn't remove the source but merely
renames it.
1996-06-29 03:58:48 +00:00
Jim Meyering
b73817cc6e . 1996-06-28 04:15:56 +00:00
Jim Meyering
0fefdeb526 . 1996-06-28 03:04:11 +00:00
Jim Meyering
8dfac9573a . 1996-06-27 04:27:10 +00:00
Jim Meyering
369361ae70 . 1996-06-27 02:37:51 +00:00
Jim Meyering
1afd3473fb (install-data): Add `else true;' to avoid
letting failing if-condition cause make to fail.
From Fred Fish (fnf@ninemoons.com).
1996-06-27 02:37:40 +00:00
Jim Meyering
117fb47f99 Elaborate on how sort -n works. 1996-06-27 02:34:30 +00:00
Jim Meyering
1bff89846b . 1996-06-26 12:39:19 +00:00
Jim Meyering
ba87d08c0e (do_link): Remove `!symlink &&' conjunct. 1996-06-26 12:31:13 +00:00
Jim Meyering
d9c0413f79 (same_name): Declare parameters to be const. 1996-06-26 12:05:35 +00:00
Jim Meyering
216777ea17 (same_name): New function.
(do_link): Use it to test reliably whether A and B (from
ln --force A B) are hard links to the same file.
From Andreas Schwab.
1996-06-26 12:02:02 +00:00
Jim Meyering
325411e109 . 1996-06-26 02:57:01 +00:00
Jim Meyering
e5aecd47c4 . 1996-06-25 05:16:30 +00:00
Jim Meyering
c84a7a232e . 1996-06-25 05:09:55 +00:00
Jim Meyering
16c5d19ce5 (strndup): Deansify.
[!STDC_HEADERS]: Include string.h and stdlib.h.
1996-06-25 05:06:53 +00:00
Jim Meyering
ac96f15bf3 (EXTRA_DIST): Add strndup.c.
(fu_SOURCES): Add getline.c.
(noinst_HEADERS): Add getline.h.
1996-06-25 05:05:43 +00:00
Jim Meyering
0c0537fdce . 1996-06-25 04:58:18 +00:00
Jim Meyering
f58702e8f9 (decode_switches): Allow 0 as argument to --tabsize (-T) option.
Interpret as a directive to use no TAB characters to separate columns.
(indent): Handle TABSIZE == 0.
1996-06-25 04:56:22 +00:00
Jim Meyering
80c03e37ba . 1996-06-25 04:26:12 +00:00
Jim Meyering
71e65bb036 (dc_parse_stream): Give `unrecognized keyword' for misspelled
`TERM' keyword as well as for others.
1996-06-25 04:26:01 +00:00
Jim Meyering
522141076e . 1996-06-25 03:41:41 +00:00
Jim Meyering
408a47499e (dc_parse_stream): Remove spurious newline in error message.
(dc_parse_file): Remove erroneous test of ERR.
1996-06-25 03:41:29 +00:00
Jim Meyering
30a65b1aa3 Use an obstack to accumulate value of LS_COLORS. 1996-06-24 03:06:52 +00:00
Jim Meyering
0a3fdd250a . 1996-06-24 03:01:46 +00:00
Jim Meyering
b617aa5f3f Add comma after e.g. in comment.
From Karl B.
1996-06-23 19:15:15 +00:00
Jim Meyering
8b0cf1dde4 . 1996-06-23 19:03:56 +00:00
Jim Meyering
d392de74de * (parse_line): Rewrite to avoid modifying LINE.
Put LINE first in parameter list.
Adjust caller.
(dc_parse_stream): Free KEYWD and ARG.
(main): Give diagnostic for unreasonable combinations of
options/arguments.
1996-06-23 19:03:31 +00:00
Jim Meyering
e5b4feb70a copied from id-utils-3.0k 1996-06-23 17:58:15 +00:00
Jim Meyering
af41baeb91 (main): New option --print (-p).
Detect write failure.
Add --bourne-shell and --c-shell aliases for --sh and --csh resp.
1996-06-22 22:27:32 +00:00
Jim Meyering
5540d977f4 . 1996-06-22 22:27:14 +00:00
Jim Meyering
98b663a29b Major overhaul. No longer read from /etc/DIR_COLORS or from ~/.dircolors.
Defaults are now compiled in.  If you specify a file on the command line,
it is used instead of the compiled-in defaults.
1996-06-22 22:02:37 +00:00
Jim Meyering
e3c3d0b385 (parse_ls_color): Use STREQ here instead of strcmp(...) == 0. 1996-06-19 04:22:28 +00:00
Jim Meyering
cfda609a21 (selected_fstype, excluded_fstype, show_disk, main):
Use STREQ here instead of strcmp(...) == 0.
1996-06-19 04:21:49 +00:00
Jim Meyering
229598b807 . 1996-06-19 04:17:36 +00:00
Jim Meyering
4c6221ee37 . 1996-06-19 04:14:29 +00:00
Jim Meyering
d76f7a7ce4 . 1996-06-19 04:11:32 +00:00
Jim Meyering
fc05e28803 (copy_reg): Cast both sides of comparison to size_t to avoid warning
about `comparison between signed and unsigned' from gcc -Wall.
1996-06-19 04:10:17 +00:00
Jim Meyering
0bbec4b26e . 1996-06-19 03:39:00 +00:00
Jim Meyering
93cff2fae1 . 1996-06-19 03:32:08 +00:00
Jim Meyering
ec0f2c34d3 (decode_switches): Correct typo in error message:
enironment -> environment.  From Santiago Vila Doncel
<sanvila@unex.es>.
1996-06-19 03:31:59 +00:00
Jim Meyering
e26d180b8c (decode_switches): Correct typo in error message: enironment -> environment.
From Santiago Vila Doncel <sanvila@unex.es>.
1996-06-19 03:25:44 +00:00
Jim Meyering
cb0cd6afdb . 1996-06-19 03:21:05 +00:00
Jim Meyering
b95e3d2f47 (do_copy): Use STREQ here instead of strcmp(...) == 0.
Declare pointer parameters const as appropriate.
1996-06-19 03:19:51 +00:00
Jim Meyering
b5eadff384 . 1996-06-19 03:15:58 +00:00
Jim Meyering
a0321a68c0 (do_copy): Change message from `missing file argument' to
more precise `missing destination file'.  From Karl Berry.
1996-06-19 02:56:06 +00:00
Jim Meyering
9ed0e96ba7 . 1996-06-19 02:53:14 +00:00
Jim Meyering
087f809fe7 . 1996-06-19 02:52:02 +00:00
Jim Meyering
dd6c617d24 . 1996-06-19 02:51:09 +00:00
Jim Meyering
b4e8fc709e (STREQ): New macro. 1996-06-19 02:00:24 +00:00
Jim Meyering
487366d091 . 1996-06-19 02:00:16 +00:00
Jim Meyering
6099222717 (do_copy): When the force and backup options have been
specified and the source and destination are the same name for an
existing, regular file, convert the user's command, e.g.
`cp --force --backup foo foo' to `cp --force foo fooSUFFIX'
where SUFFIX is determined by any version control options used.
At urging of (most recently) Karl Berry.
1996-06-19 01:59:12 +00:00
Jim Meyering
608e780536 . 1996-06-19 01:48:25 +00:00
Jim Meyering
0f73666749 . 1996-06-19 01:41:35 +00:00
Jim Meyering
e72e877181 . 1996-06-16 18:52:46 +00:00
Jim Meyering
4063f0aea3 . 1996-06-16 18:49:50 +00:00
Jim Meyering
0c8d33de03 . 1996-06-16 18:49:08 +00:00
Jim Meyering
e94070eb22 . 1996-06-16 18:48:30 +00:00
Jim Meyering
8aef0cde12 . 1996-06-16 18:47:38 +00:00
Jim Meyering
d355dcec62 (EXTRA_DIST): Add texinfo.tex. But it will
be removed once automake is fixed to add it automatically.
1996-06-16 18:47:30 +00:00
Jim Meyering
c0a9e11235 . 1996-06-16 18:41:48 +00:00
Jim Meyering
8469bec1cc . 1996-06-16 03:23:53 +00:00
Jim Meyering
28a71c3409 . 1996-06-16 03:23:06 +00:00
Jim Meyering
85c407a740 (EXTRA_DIST): Add basename.c.
(fu_SOURCES): Remove basename.c.
1996-06-16 03:21:47 +00:00
Jim Meyering
2a01f209a6 . 1996-06-16 03:18:07 +00:00
Jim Meyering
1137a26bcf Update from time-1.7. 1996-06-14 04:42:33 +00:00
Jim Meyering
8157b18b8a . 1996-06-14 03:52:05 +00:00
Jim Meyering
c8c25a4610 ($(PACKAGE).pot): Reapply change of May 30.
Depend on POTFILES only when using maintainer mode.
1996-06-14 03:51:57 +00:00
Jim Meyering
031e782bb9 . 1996-06-14 03:33:18 +00:00
Jim Meyering
289ee58ce3 . 1996-06-12 04:32:54 +00:00
Jim Meyering
53af79cfe4 . 1996-06-12 04:30:58 +00:00
Jim Meyering
57beda9b45 . 1996-06-11 17:26:10 +00:00
Jim Meyering
0f3ff1725d . 1996-06-11 00:13:09 +00:00
Jim Meyering
7188179fc0 . 1996-06-11 00:12:53 +00:00
Jim Meyering
6544a589ed . 1996-06-11 00:12:08 +00:00
Jim Meyering
79ae2a4af9 . 1996-06-10 23:23:53 +00:00
Jim Meyering
b952290dc3 . 1996-06-10 23:20:06 +00:00
Jim Meyering
737f1f03a5 . 1996-06-08 04:29:59 +00:00
Jim Meyering
cf83dc5456 . 1996-06-08 03:16:21 +00:00
Jim Meyering
652ad8aaa3 . 1996-06-07 05:14:55 +00:00
Jim Meyering
5e969c1033 . 1996-06-07 03:16:35 +00:00
Jim Meyering
e42cc5be8a Update from gettext-0.10.16. 1996-06-07 02:59:01 +00:00
Jim Meyering
8cb05a6bfa . 1996-06-06 03:54:38 +00:00
Jim Meyering
4fb75ded4c . 1996-06-02 04:49:35 +00:00
Jim Meyering
1c883e2882 Rename MO_ to SHELLTYPE_. 1996-06-02 02:58:05 +00:00
Jim Meyering
d6bf80ccc7 Declare pointer parameters const as appropriate. 1996-06-02 02:52:37 +00:00
Jim Meyering
cd536776a0 . 1996-06-01 23:08:53 +00:00
Jim Meyering
f51eb4a5cc (decode_switches): Set print_with_color in one statement. 1996-06-01 23:08:35 +00:00
Jim Meyering
de40301f0a Rename options and internal variables to reflect change to
--color=WHEN where WHEN is never, always, or auto (for consistency
with e.g. cp --sparse=WHEN.  For at least a while, the original
slackware-supported arguments `none', `force', `yes', etc will be
supported but deprecated by lack of documentation.
(decode_switches): Use STDOUT_FILENO instead of `1' in is_tty test.
(usage): Update/add description of the --color option.
1996-06-01 18:36:19 +00:00
Jim Meyering
aa41cdbb65 . 1996-06-01 03:21:53 +00:00
Jim Meyering
4d02bdd9b0 . 1996-06-01 03:19:25 +00:00
Jim Meyering
41e8b21fb7 . 1996-06-01 03:06:06 +00:00
Jim Meyering
fe9da7ee9b . 1996-05-31 03:45:49 +00:00
Jim Meyering
bd8218fbe9 . 1996-05-31 03:45:31 +00:00
Jim Meyering
d52bc68220 . 1996-05-31 03:45:16 +00:00
Jim Meyering
090cd9f443 . 1996-05-31 03:44:15 +00:00
Jim Meyering
b6c83bbaa0 . 1996-05-31 03:42:11 +00:00
Jim Meyering
5946c46972 . 1996-05-31 03:36:22 +00:00
Jim Meyering
20522f2f5d (main): Interpret the old-style +VALUE and -VALUE
options like -c VALUE and -c +VALUE (resp) when VALUE has one of
the [bkm] suffix multipliers.  This makes the code consistent
with --help output.
1996-05-31 03:35:32 +00:00
Jim Meyering
7b297f76c4 . 1996-05-31 03:08:07 +00:00
Jim Meyering
3c467c0d22 (limfield): #ifdef-out a block of code that makes
GNU sort incompatible with Unix sort when a key-end spec refers
to the N'th character in a field that has fewer than N characters.
The POSIX spec doesn't appear to specify behavior for this case.
From Karl Heuer.
1996-05-31 03:07:45 +00:00
Jim Meyering
b2ae052c6d . 1996-05-31 02:36:34 +00:00
Jim Meyering
8ee7e2c0c8 (.po.mo): Reenable dependency and rule.
It is required when using native NLS, e.g. on Solaris.
From Marcus Daniels.
1996-05-31 02:35:59 +00:00
Jim Meyering
3270b340e8 ($(PACKAGE).pot): Depend on POTFILES only when using maintainer mode.
Reported by Karl Heuer.
1996-05-31 02:26:23 +00:00
Jim Meyering
22978078f7 (stamp-cat-id): Avoid using temp filename longer than 14 characters.
(mostlyclean): Likewise.
From Karl Heuer.
1996-05-31 00:58:51 +00:00
Jim Meyering
53e41464fd (decode_one_format): Use %lu (not %d) printf formats
corresponding to unsigned long, SIZE.
1996-05-31 00:51:48 +00:00
Jim Meyering
86f7daf592 . 1996-05-31 00:51:23 +00:00
Jim Meyering
91e12f541f . 1996-05-30 06:34:25 +00:00
Jim Meyering
176a02c5d9 (installcheck): New target. 1996-05-30 06:34:16 +00:00
Jim Meyering
c6836cfdda . 1996-05-30 05:23:02 +00:00
Jim Meyering
090a56eb9c (decode_one_format): Take another parameter.
Give a specific diagnostic for invalid format spec here rather
than an overly general one from caller's caller.
(decode_format_string): Update caller.
(main): Don't give diagnostic here when decode_format_string fails.
Remove assertions that could fail on some Crays because they don't
have a two-byte type.
Johan Danielsson (joda@pdc.kth.se) reported the failed assertions.
1996-05-30 05:09:56 +00:00
Jim Meyering
8c0d3621b3 . 1996-05-30 05:09:31 +00:00
Jim Meyering
86d6d4c47c . 1996-05-30 02:32:19 +00:00
Jim Meyering
f1d4b41340 (docolon): Give a warning when the first character
of the basic regular expression is `^'.
1996-05-30 02:32:03 +00:00
Jim Meyering
ab8cec12c9 . 1996-05-30 02:31:45 +00:00
Jim Meyering
3bd31fac90 (main): Use STDIN_FILENO instead of less portable fileno (stdin). 1996-05-30 00:59:50 +00:00
Jim Meyering
31f9f9f24c . 1996-05-29 04:46:00 +00:00
Jim Meyering
e7b4a0bced . 1996-05-28 23:42:01 +00:00
Jim Meyering
a3b44d2fd5 . 1996-05-28 23:41:11 +00:00
Jim Meyering
55dcae1c8d (main): Don't mark "%s" as a translatable string.
From Gran Uddeborg.
1996-05-28 23:40:11 +00:00
Jim Meyering
a01eaef0fd (print_stats): Don't mark "%u %s" as a translatable string.
From Gran Uddeborg (gvran@uddeborg.pp.se).
1996-05-28 23:39:12 +00:00
Jim Meyering
9da759a317 (main): Use STDIN_FILENO and STDOUT_FILENO instead of less portable fileno(*). 1996-05-28 01:42:07 +00:00
Jim Meyering
d2d2d043ff Hack out broken WEAK junk. 1996-05-24 03:06:01 +00:00
Jim Meyering
afd4dcf3b2 Define __P. 1996-05-24 02:45:38 +00:00
Jim Meyering
9b7bbe7b0b . 1996-05-23 13:14:11 +00:00
Jim Meyering
d84462d473 FIXME: fill this in 1996-05-23 13:13:35 +00:00
Jim Meyering
e3579cb231 . 1996-05-23 13:05:04 +00:00
Jim Meyering
1a34934e94 (read_filesystem_list) [MOUNTED_LISTMNTENT]: New function.
From Johan Danielsson (joda@pdc.kth.se).
1996-05-23 13:04:41 +00:00
Jim Meyering
c2705c1e62 [_CRAY]: Don't include sys/filsys.h because although
Unicos-9 has it, it's not needed and would cause other problems
because it requires inclusion of other, non-standard headers.
1996-05-23 13:04:03 +00:00
Jim Meyering
63d49273c4 (usage): Make --literal (-N) description clearer. 1996-05-23 12:52:54 +00:00
Jim Meyering
2df44bba5b Add copyright header. 1996-05-22 12:37:29 +00:00
Jim Meyering
4b17c0b9ac Update from GNU libc-copies. 1996-05-22 12:37:11 +00:00
Jim Meyering
71d6f09173 . 1996-05-22 12:07:38 +00:00
Jim Meyering
5faf3cd5fb . 1996-05-22 12:03:18 +00:00
Jim Meyering
b4a30ded4c . 1996-05-21 12:15:50 +00:00
Jim Meyering
e1dc14d3a1 (euidaccess) [!S_IROTH]: Define.
[!S_IWOTH]: Define.
[!S_IXOTH]: Define.
Marcus Daniels <marcus@sysc.pdx.edu> reported that m68k NEXTSTEP 3.2
doesn't define S_IROTH or S_IWOTH unless some posix compile option
is used and associated symbols defined.
1996-05-21 12:15:27 +00:00
Jim Meyering
4c8f853735 (xgetgroups): New function, factored out of
print_group_list and print_full_info.
(print_group_list): Call it.
(print_full_info): Call it.

From Andreas Schwab:
(print_group_list): When USERNAME is specified use
getugroups to get the number of groups.
(print_full_info): Likewise.
1996-05-21 04:19:02 +00:00
Jim Meyering
6225a43223 . 1996-05-21 04:13:19 +00:00
Jim Meyering
abda80a05a . 1996-05-21 04:12:36 +00:00
Jim Meyering
6ab8d020db . 1996-05-21 04:11:45 +00:00
Jim Meyering
5daa998b30 . 1996-05-21 03:58:12 +00:00
Jim Meyering
5840eaec8d . 1996-05-21 03:57:51 +00:00
Jim Meyering
4a6d0824c9 . 1996-05-21 03:57:21 +00:00
Jim Meyering
166523ca2b . 1996-05-21 03:52:57 +00:00
Jim Meyering
04a5f54547 . 1996-05-21 03:40:45 +00:00
Jim Meyering
8f47502291 . 1996-05-21 02:56:29 +00:00
Jim Meyering
fb71b69665 . 1996-05-20 04:31:49 +00:00
Jim Meyering
f8a5744b34 . 1996-05-20 02:46:30 +00:00
Jim Meyering
e3fa3463d6 (usage): Make it a little clearer. 1996-05-20 02:46:22 +00:00
Jim Meyering
a712177a4b Tweak indentation. 1996-05-19 20:25:28 +00:00
Jim Meyering
b9ad7b9a9c . 1996-05-19 19:46:25 +00:00
Jim Meyering
47e20014b0 . 1996-05-19 18:15:59 +00:00
Jim Meyering
2f4e768ff4 . 1996-05-19 18:10:22 +00:00
Jim Meyering
f1aea23023 . 1996-05-19 17:14:19 +00:00
Jim Meyering
4734b96d4e . 1996-05-19 17:13:58 +00:00
Jim Meyering
faf0038376 New option: --no-dereference (-h).
[!MAXUID]: Define to INT_MAX.
(change_file_group): Use lchown if --no-dereference (-h) was given.
(usage): Update.
(main): Fail if user requests --no-dereference on a system that
doesn't have support for it.
1996-05-19 17:13:36 +00:00
Jim Meyering
dd7aea80f7 New option: --no-dereference (-h).
(change_file_owner): Use lchown if --no-dereference (-h) was given.
(usage): Update.
(main): Fail if user requests --no-dereference on a system that
doesn't have support for it.
1996-05-19 14:36:09 +00:00
Jim Meyering
4ff1b892d0 . 1996-05-18 19:35:36 +00:00
Jim Meyering
22125a047d . 1996-05-18 19:29:22 +00:00
Jim Meyering
b2191ea8e1 (main): Don't recognize --help, --h, --he, --version, --v, etc.
if the POSIXLY_CORRECT environment variable is set.
1996-05-18 18:37:11 +00:00
Jim Meyering
971c5b1379 (main): Don't recognize --help, --h, --he, --version, --v, etc.
if the POSIXLY_CORRECT environment variable is set.
1996-05-18 18:36:36 +00:00
Jim Meyering
2d8de9b8ab (main): Don't recognize --help, --h, --he, --version, --v, etc.
if the POSIXLY_CORRECT environment variable is set.
(docolon) [RE_SYNTAX_POSIX_BASIC]: Revert my misguided change of Mar 1.
1996-05-18 18:36:10 +00:00
Jim Meyering
271a7e6bb3 . 1996-05-17 03:19:01 +00:00
Jim Meyering
573c16a666 Update prototype to match. 1996-05-17 03:16:54 +00:00
Jim Meyering
bae16cb45b (get_fs_usage): Declare parameter PATH to be const. 1996-05-17 03:16:34 +00:00
Jim Meyering
b80225264a . 1996-05-17 03:16:21 +00:00
Jim Meyering
dcc145f13a Rearrange function definitions to precede respective uses to obviate
all forward dcls. Remove forward dcls.
Declare parameters const as appropriate.
1996-05-16 05:00:12 +00:00
Jim Meyering
51958e82aa . 1996-05-16 04:59:49 +00:00
Jim Meyering
ca0a087f3d . 1996-05-16 04:44:39 +00:00
Jim Meyering
22dc22c127 . 1996-05-16 04:31:54 +00:00
Jim Meyering
a56783bbb4 (selected_fstype): Move definition to precede use.
Remove prototype.  Declare parameter FSTYPE to be const.
(excluded_fstype): Likewise.
(main): Fail with a diagnostic if both --human-readable and
--portability are used.
Likewise if --megabytes and --portability are used.
1996-05-16 04:31:45 +00:00
Jim Meyering
699808bcad (do_link): Declare pointer parameters to be const. 1996-05-16 04:13:52 +00:00
Jim Meyering
7176037aa2 . 1996-05-16 04:02:10 +00:00
Jim Meyering
55447abbdf (getdate.c): Disable dependencies that can
require rerunning YACC when not in maintainer mode.
(posixtm.c): Likewise.
1996-05-16 04:01:39 +00:00
Jim Meyering
2c226bf49d Update prototypes. 1996-05-16 03:58:44 +00:00
Jim Meyering
8a623ebc61 (mode_compile): Declare parameter MODE_STRING const.
Remove register attribute.
(mode_adjust): Likewise for CHANGES.
1996-05-16 03:57:49 +00:00
Jim Meyering
fce70ef38b (describe_change): Declare pointer parameters to be const.
(change_file_mode): Likewise.
(change_dir_mode): Likewise.
1996-05-16 03:55:44 +00:00
Jim Meyering
9622bd6207 (md5_t_stats): Restructure pluralization of error message so it's easier
to translate.
1996-05-15 04:45:12 +00:00
Jim Meyering
f177941b93 (print_stats): Restructure pluralization of error message so it's easier
to translate.
1996-05-15 04:37:50 +00:00
Jim Meyering
a2c6905133 (main): Restructure pluralization of error message so it's easier to translate. 1996-05-15 04:37:08 +00:00
Jim Meyering
3df9acbfc9 . 1996-05-15 02:03:39 +00:00
Jim Meyering
9f58b3b3d5 . 1996-05-13 05:33:36 +00:00
Jim Meyering
e6b5a4d682 *** empty log message *** 1996-05-13 05:31:33 +00:00
Jim Meyering
1fb27efd70 . 1996-05-12 03:25:59 +00:00
Jim Meyering
d4a3e63ec8 Sat May 11 13:30:53 1996 enami tsugutomo <enami@ba2.so-net.or.jp>
* regex.c (re_match_2_internal): Fix off-by-one error; don't use
       length of exactn as character, and don't use length of bitmap of
       charset as bitmap.
1996-05-12 02:57:30 +00:00
Jim Meyering
f64964aa1d . 1996-05-11 01:59:25 +00:00
Jim Meyering
97775c5655 (all-yes): Always depend on CATALOGS. From Ulrich Drepper.
(.po.mo): Disable dependency and rule when not in maintainer mode.
1996-05-11 01:49:04 +00:00
Jim Meyering
483e2421c9 . 1996-05-10 05:10:34 +00:00
Jim Meyering
ac4a274dcf . 1996-05-10 03:31:07 +00:00
Jim Meyering
8b3d87d197 . 1996-05-10 03:30:32 +00:00
Jim Meyering
bee873f407 . 1996-05-10 03:27:51 +00:00
Jim Meyering
7b33a9910c . 1996-05-10 03:26:38 +00:00
Jim Meyering
d60264342d . 1996-05-10 03:20:30 +00:00
Jim Meyering
3cd2c9e1c8 , 1996-05-10 03:06:48 +00:00
Jim Meyering
c94ffee869 (all-yes): Also dependend on GMOFILES.
Depend on CATALOGS and GMOFILES files only in maintainer mode.
1996-05-10 03:05:51 +00:00
Jim Meyering
7da69e79df . 1996-05-08 05:01:01 +00:00
Jim Meyering
a79461545e . 1996-05-08 03:11:42 +00:00
Jim Meyering
32e36bd888 Update from GNU libc. 1996-05-07 03:41:17 +00:00
Jim Meyering
15e49fdbfb . 1996-05-06 04:20:07 +00:00
Jim Meyering
1b0419e8fd . 1996-05-06 01:28:23 +00:00
Jim Meyering
bd395b3bfc (main): Use fputs, not puts. Avoids spurious newline. 1996-05-06 01:26:25 +00:00
Jim Meyering
b7c1e2526a . 1996-05-06 01:25:32 +00:00
Jim Meyering
9300fb41f8 . 1996-05-05 18:48:42 +00:00
Jim Meyering
c434fa5195 Look for SYSTEM_FILE, not USER_FILE in SHAREDIR. 1996-05-05 02:41:29 +00:00
Jim Meyering
7f504f2317 . 1996-05-05 02:15:53 +00:00
Jim Meyering
cafa5c1c2d Make enumerated constants upper case.
(main): Don't rely on ANSI-style string concatenation.
Add `static' and/or `const' to some file scope variables.
1996-05-05 02:15:23 +00:00
Jim Meyering
73a90d1006 . 1996-05-05 02:04:32 +00:00
Jim Meyering
d4e2205ea9 Remove useless void casts of *printf return values. 1996-05-05 02:04:04 +00:00
Jim Meyering
8e9d1adf75 . 1996-05-05 01:56:17 +00:00
Jim Meyering
2f6c94da4c [IN_CTYPE_DOMAIN]: Rename from ISASCII. 1996-05-05 01:55:52 +00:00
Jim Meyering
68898bb9a7 . 1996-05-05 01:55:26 +00:00
Jim Meyering
812fdadfca [IN_CTYPE_DOMAIN]: Rename from ISASCII. 1996-05-05 01:55:16 +00:00
Jim Meyering
0e307a526c . 1996-05-05 01:55:04 +00:00
Jim Meyering
c1997cb5c3 . 1996-05-05 01:53:15 +00:00
Jim Meyering
74445dae42 [IN_CTYPE_DOMAIN]: Rename from ISASCII. 1996-05-05 01:51:50 +00:00
Jim Meyering
fcf3192814 [IN_CTYPE_DOMAIN]: Rename from ISASCII. 1996-05-05 01:51:26 +00:00
Jim Meyering
916861c0e8 . 1996-05-05 01:40:46 +00:00
Jim Meyering
437e9a0bc4 . 1996-05-02 02:47:10 +00:00
Jim Meyering
389c4049b3 (parse_ls_color, usage): Remove support for alternate spellings:
--colours and LS_COLOURS.
(parse_ls_color): Reverse sense of test for LS_COLORS environment
variable and return -- save a level of indentation on a 100+-line block.
1996-05-02 02:45:43 +00:00
Jim Meyering
a9ec4db8f2 . 1996-05-02 02:37:09 +00:00
Jim Meyering
9cda4e6527 . 1996-05-02 02:35:53 +00:00
Jim Meyering
cf1bd0e401 (EXTRA_DIST): Add strcasecmp.c. 1996-05-01 05:24:54 +00:00
Jim Meyering
419daeb511 . 1996-05-01 05:20:22 +00:00
Jim Meyering
5555b3c9db . 1996-05-01 05:19:38 +00:00
Jim Meyering
482d5be531 (parse_ls_color, usage): Remove support for alternate spellings:
--colours and LS_COLOURS.
1996-05-01 05:19:34 +00:00
Jim Meyering
87afdbeb7d . 1996-04-30 03:51:11 +00:00
Jim Meyering
a84f4f6087 . 1996-04-30 03:49:12 +00:00
Jim Meyering
12da649245 (usage): Change TAB in message to spaces. Doing that seems
to have worked around a problem with something in gettext that was
producing a truncated usage message for date's usage.
Franois Pinard.
1996-04-30 03:30:51 +00:00
Jim Meyering
22aec49d4c (main): Separate messages about too few' and too many'
arguments to ease translation.
From Franc,ois.
1996-04-30 03:29:01 +00:00
Jim Meyering
6580f24783 Mark translatable strings.
(main): Separate messages about `too few' and `too many'
arguments to ease translation.
From Franc,ois.
1996-04-30 03:26:34 +00:00
Jim Meyering
a3c143bd82 Mark translatable strings. 1996-04-30 03:20:38 +00:00
Jim Meyering
07e148c8e7 (print_name_with_quoting): Add braces around inner if-else stmt. 1996-04-29 04:53:53 +00:00
Jim Meyering
8455ea2e13 (LEN_STR_PAIR): New macro.
(color_indicator): Use it in this declaration.
(parse_ls_color): Use error, not fprintf.
(decode_switches): Add a comment.
1996-04-29 04:52:16 +00:00
Jim Meyering
95439d0f33 (parse_ls_color): Use strcpy to initialize 3-character array.
Automatic aggregate initialization isn't portable.
1996-04-29 04:31:24 +00:00
Jim Meyering
aa7d0d8c85 Remove all ^L's.
(get_funky_string): Declare static and move to precede single
caller: parse_ls_color.
1996-04-29 04:29:06 +00:00
Jim Meyering
3ce3cb772d (get_funky_string): Upper-case anon. union `state'. 1996-04-29 04:26:47 +00:00
Jim Meyering
e08a28e045 Apply color ls changes from Drepper. 1996-04-29 04:24:07 +00:00
Jim Meyering
6ea9602009 . 1996-04-29 04:04:59 +00:00
Jim Meyering
ea11fd8868 FIXME 1996-04-29 01:44:33 +00:00
Jim Meyering
346b0368cf . 1996-04-29 01:43:52 +00:00
Jim Meyering
175585876f . 1996-04-29 01:36:49 +00:00
Jim Meyering
1ecd1b9c52 . 1996-04-29 01:35:24 +00:00
Jim Meyering
30f76e827e (main): Give a better diagnostic for `sort -0'. Reported by Karl Berry. 1996-04-29 01:35:18 +00:00
Jim Meyering
8b9e784e1e . 1996-04-29 01:29:16 +00:00
Jim Meyering
5a5938db82 (copy_rest): Don't copy past end of prefix. Output
trailing spaces if the prefix had any.  Before, the command
perl -e 'print "| S";' |fmt -p' |  '|tr '\0' @ output `|@S'.
Reported by Franois Pinard.
1996-04-29 01:28:06 +00:00
Jim Meyering
3c57cea2ce . 1996-04-28 22:12:33 +00:00
Jim Meyering
0143b2901f . 1996-04-28 21:41:28 +00:00
Jim Meyering
527b07a1ad Indent CPP conditionals. 1996-04-28 21:41:20 +00:00
Jim Meyering
347c2d6d30 [HAVE_ST_BLOCKS || _POSIX_VERSION]: Add extern dcl
of unused variable so that after preprocessing, the file will never
be empty.  Otherwise, some compilers in ANSI mode (among them, the
Dec Alpha OSF 2.0 C compiler) reject empty files.  From Kaveh Ghazi.
1996-04-28 21:34:00 +00:00
Jim Meyering
9af8f15624 . 1996-04-27 04:11:35 +00:00
Jim Meyering
c17caa0c0f Fri Apr 26 05:52:03 1996 Karl Eichwalder <ke@ke.Central.DE>
* ls.c (usage): Add newline at end of printf format string.
1996-04-27 04:10:54 +00:00
Jim Meyering
77da45645d . 1996-04-25 04:38:01 +00:00
Jim Meyering
8b2c88998b Add copyright. 1996-04-25 04:33:03 +00:00
Jim Meyering
4cf126f7ce . 1996-04-25 04:32:42 +00:00
Jim Meyering
1c4ecd2a95 Get year as last rather than 6th field in output of date.
Otherwise, people with 2-word TZ (like `MET DST') lost.
1996-04-25 04:28:22 +00:00
Jim Meyering
56d10407e7 (main): Use verbose_fmt_string, not string literal in
call to make_path for --parents.  From Uli.
1996-04-25 03:10:57 +00:00
Jim Meyering
f3194fe603 (do_link): With --force, don't remove DEST when it's
the same as SOURCE.  Before, `ln -f FILE FILE' would remove FILE.
Reported by Bruno Haible.
1996-04-25 02:47:07 +00:00
Jim Meyering
f59d1dac46 (do_link): Remove duplicate `if (lstat' block. 1996-04-25 02:34:36 +00:00
Jim Meyering
359f885aae . 1996-04-24 05:05:39 +00:00
Jim Meyering
272f8d891e (usage): The long-named arg is --human-readable, not --human. 1996-04-24 05:05:34 +00:00
Jim Meyering
25f22cdc5d Be consistent. Accept --human-readable, not --human.
(usage): Reflect the change.
1996-04-24 05:04:44 +00:00
Jim Meyering
af781b708c . 1996-04-24 04:54:04 +00:00
Jim Meyering
0a9eb68f77 . 1996-04-24 04:51:29 +00:00
Jim Meyering
59d334f4d4 update Copyright years for 1996 1996-04-24 04:50:53 +00:00
Jim Meyering
e6eece1575 update Copyright years for 1996 1996-04-24 04:45:54 +00:00
Jim Meyering
8fbeb80792 . 1996-04-24 04:43:27 +00:00
Jim Meyering
dc98736719 update Copyright years for 1996 1996-04-24 04:42:21 +00:00
Jim Meyering
3f4c6398be . 1996-04-24 04:30:07 +00:00
Jim Meyering
7e4384f810 . 1996-04-24 04:29:20 +00:00
Jim Meyering
fdd4dd9b35 (find_backup_file_name): Constify decls of formal parameters. 1996-04-24 04:29:00 +00:00
Jim Meyering
bba8ab25f1 (find_backup_file_name, max_backup_version, make_version_name,
version_number, concat): Constify decls of formal parameters.
1996-04-24 04:28:21 +00:00
Jim Meyering
aa05c43a5f . 1996-04-24 04:08:14 +00:00
Jim Meyering
69e6145e1e [HAVE_LCHOWN]: Define chown to lchown. 1996-04-24 03:44:29 +00:00
Jim Meyering
fb19d01b96 [chown]: Move definition up a little. 1996-04-24 03:41:33 +00:00
Jim Meyering
b380f45a13 [HAVE_LCHOWN]: Define chown to lchown. 1996-04-24 03:41:10 +00:00
Jim Meyering
8e12bada8a [HAVE_LCHOWN]: Define chown to lchown. 1996-04-24 03:40:18 +00:00
Jim Meyering
ade410fae0 [HAVE_LCHOWN]: Define chown to lchown. 1996-04-24 03:35:55 +00:00
Jim Meyering
6d668c6160 . 1996-04-24 03:25:02 +00:00
Jim Meyering
78273e9d23 (main): Declare to return int, not void. 1996-04-24 03:24:54 +00:00
Jim Meyering
2b5207bc59 (main): Declare to return int, not void. 1996-04-24 03:23:54 +00:00
Jim Meyering
deeb3e0c49 (usage): Add missing close paren and open paren. 1996-04-24 03:23:37 +00:00
Jim Meyering
2b00449aa7 . 1996-04-24 03:13:47 +00:00
Jim Meyering
98d8740ccd (su_SOURCES): Remove getopt.c and getopt1.c.
(EXTRA_DIST): Add getopt.c and getopt1.c
1996-04-24 03:13:41 +00:00
Jim Meyering
56bc01ab4a . 1996-04-24 03:09:50 +00:00
Jim Meyering
1d43796211 . 1996-04-24 02:34:42 +00:00
Jim Meyering
e8a641509f . 1996-04-22 03:20:47 +00:00
Jim Meyering
674180c97f (usage): Use FIRST, LAST consistently in description. 1996-04-22 03:20:14 +00:00
Jim Meyering
c264e159a4 (usage): Describe new %V format. 1996-04-22 03:19:14 +00:00
Jim Meyering
a5a67731da . 1996-04-22 03:17:19 +00:00
Jim Meyering
d7bf7dee47 (usage): Reflect that now --no-sync is the default. 1996-04-22 03:17:14 +00:00
Jim Meyering
3032beba73 New version from gettext-0.10.12. 1996-04-22 03:02:55 +00:00
Jim Meyering
50b029f4d9 (md5_check): Remove spurious `\n' at end of error format string. 1996-04-22 03:00:52 +00:00
Jim Meyering
c07d15973c (decode_one_format): Use printf's L modifier for long doubles,
not `l'.  From Eric Backus.
1996-04-21 21:07:13 +00:00
Jim Meyering
5beebbd8da Include <values.h>.
[!BITSPERBYTE]: Define.
[OFF_T_MAX]: Use BITSPERBYTE, not 8, and cast the result to off_t.
1996-04-21 14:17:13 +00:00
Jim Meyering
763d748cf2 . 1996-04-21 13:32:54 +00:00
Jim Meyering
0e442c97a5 . 1996-04-21 05:20:10 +00:00
Jim Meyering
2411847f16 Include xstrtol.h.
[!BITSPERBYTE]: Define.
[!UID_T_MAX]: Define.
[!GID_T_MAX]: Define.
(get_ids): Use xstrtol, not atoi.
(is_number): Remove now-unused function.
1996-04-21 05:18:19 +00:00
Jim Meyering
874f418e03 Remove obsolete FIXME. 1996-04-21 05:15:39 +00:00
Jim Meyering
0126f74936 (decode_switches): Replace two more atoi uses with xstrtol. 1996-04-21 04:45:12 +00:00
Jim Meyering
7d956ece8c (decode_switches): Use getenv (POSIXLY_CORRECT), not undefined posix_pedantic. 1996-04-21 04:11:43 +00:00
Jim Meyering
ee708ff4aa (decode_switches): Clean up last change.
[posix_pedantic]: Don't consider TABSIZE environment variable.
1996-04-21 04:07:41 +00:00
Jim Meyering
c1f1f8ac3a (decode_switches): Use xstrtol, not atoi.
Detect and ignore invalid value for COLUMNS environment variable.
In error about invalid TABSIZE, don't reference optarg!
1996-04-21 03:52:30 +00:00
Jim Meyering
0aa556c39c . 1996-04-21 03:27:32 +00:00
Jim Meyering
b76ab178d1 (usage): Improve help message. From Karl Berry. 1996-04-21 03:26:46 +00:00
Jim Meyering
dfbe6788b4 (usage): Improve help message. From Karl Berry. 1996-04-21 03:25:53 +00:00
Jim Meyering
1d2c0959c9 (usage): Improve help message.
Enclose message strings in _().
From Karl Berry.
1996-04-21 03:24:47 +00:00
Jim Meyering
fc0f5b4539 . 1996-04-20 04:50:26 +00:00
Jim Meyering
49af3f858e . 1996-04-20 04:46:11 +00:00
Jim Meyering
0528939c0a . 1996-04-20 03:51:17 +00:00
Jim Meyering
a2d90c1616 No longer call sync by default. 1996-04-20 03:51:10 +00:00
Jim Meyering
5ac0cdbfce (main): Make separation of case for n_files == 0 more clear. 1996-04-20 03:43:10 +00:00
Jim Meyering
b8654f033b . 1996-04-19 05:07:58 +00:00
Jim Meyering
f60c8ea48b (copy_reg): Rearrange arithmetic in conditional to avoid
integer overflow with large files.
1996-04-19 05:07:52 +00:00
Jim Meyering
dafd2cb4e2 (basename): Rewrite so it doesn't rely on strrchr,
and hence doesn't need to include string.h -- on some alpha-based
OSF systems, there's a conflicting prototype for basename in string.h.
Reported by Kaveh Ghazi.
1996-04-19 04:41:27 +00:00
Jim Meyering
f970591c5a . 1996-04-19 04:34:53 +00:00
Jim Meyering
d729e4cab7 . 1996-04-19 03:17:31 +00:00
Jim Meyering
cccb23f01b (main): Make code clearer: use new variable `n_files' in
place of `argc - optind'.  Use `file' instead of `argv + optind'.
1996-04-19 03:17:23 +00:00
Jim Meyering
199923e3cc Indent cpp-directives. 1996-04-18 23:02:17 +00:00
Jim Meyering
706389d9df . 1996-04-17 05:03:22 +00:00
Jim Meyering
bba21e6815 . 1996-04-17 05:02:34 +00:00
Jim Meyering
0f459ed24c . 1996-04-17 05:01:56 +00:00
Jim Meyering
c1a0ddea63 . 1996-04-17 05:01:10 +00:00
Jim Meyering
337e927dae . 1996-04-17 05:00:17 +00:00
Jim Meyering
d8ab22727f . 1996-04-17 03:41:47 +00:00
Jim Meyering
505b859fe9 Test cpp-defined __sun as well as sun, because
in strict ANSI mode, only __sun is defined.  From Kaveh Ghazi.
1996-04-14 02:12:46 +00:00
Jim Meyering
e6cfa98486 . 1996-04-14 00:34:30 +00:00
Jim Meyering
93bd527109 . 1996-04-13 18:27:27 +00:00
Jim Meyering
d283aef5ca (usage): Add missing `\n\' at the end of newly added lines for %e and %z. 1996-04-13 18:27:24 +00:00
Jim Meyering
be333ac3a5 (print_uptime): Invoke getloadavg only if we have it. 1996-04-13 18:26:39 +00:00
Jim Meyering
62b978f77c . 1996-04-13 18:13:16 +00:00
Jim Meyering
84e64a529a Unprotoize.
[ISASCII]: Define.
[ISUPPER]: Define.
1996-04-13 18:13:09 +00:00
Jim Meyering
b4a20010e6 (decode_field_spec): Rename local variable `valid'
to invalid (and reverse sense) to avoid conflict with the
macro definition in /usr/include/locale.h on SunOS 4.1.3.
1996-04-13 18:11:43 +00:00
Jim Meyering
b8b9306a9a . 1996-04-13 04:42:15 +00:00
Jim Meyering
5ec32b62e5 . 1996-04-13 03:59:26 +00:00
Jim Meyering
c659704b20 (main): Add new option: --verbose.
Remove long-deprecated and nowhere-documented --path, a synonym
for --parents.  It was confusing to get an error about `--p'
being ambiguous.
1996-04-13 03:59:20 +00:00
Jim Meyering
ce339a4a50 . 1996-04-13 03:58:33 +00:00
Jim Meyering
53ff5566ce . 1996-04-13 03:18:47 +00:00
Jim Meyering
c1bf67ee67 Mark translatable strings in new code. 1996-04-13 03:17:44 +00:00
Jim Meyering
5dbe03ea6c . 1996-04-13 03:07:54 +00:00
Jim Meyering
a2b6134e37 . 1996-04-13 03:05:56 +00:00
Jim Meyering
d82c2c9274 (usage): Document %e and %z. Reported by Karl Berry. 1996-04-13 03:04:21 +00:00
Jim Meyering
cc6711057e . 1996-04-13 02:54:59 +00:00
Jim Meyering
c60619245a . 1996-04-13 02:54:13 +00:00
Jim Meyering
a7b3ea4189 . 1996-04-12 04:27:03 +00:00
Jim Meyering
7057c83fd4 Reindent.
(UT_TIME_MEMBER): New macro.
(print_uptime): Use it instead of #ifdef HAVE_UTMPX_H #else.
(print_entry): Likewise.
1996-04-11 02:30:09 +00:00
Jim Meyering
737ea4d4f9 (print_uptime) [UPTIME]: New function. From Kaveh Ghazi. 1996-04-10 04:57:09 +00:00
Jim Meyering
ac22df9290 . 1996-04-10 04:03:47 +00:00
Jim Meyering
a33c222135 . 1996-04-10 03:52:01 +00:00
Jim Meyering
f6d1e06932 . 1996-04-10 03:51:41 +00:00
Jim Meyering
447a13cdd4 Document uniq's new --ignore-case option. 1996-04-10 03:51:07 +00:00
Jim Meyering
727a9ed970 Add new option --ignore-case (-i).
Include memcasecmp.h.
(different): Compare with memcasecmp if ignoring case.
(main): Handle 'i'.
1996-04-10 03:50:31 +00:00
Jim Meyering
5d5979d9a8 (memcasecmp): Remove static definition of function.
Include memcasecmp.h instead.
1996-04-10 03:47:28 +00:00
Jim Meyering
5eb19629b0 . 1996-04-10 03:29:05 +00:00
Jim Meyering
cbfdc4fd51 . 1996-04-08 04:57:19 +00:00
Jim Meyering
24c0303794 . 1996-04-08 04:56:36 +00:00
Jim Meyering
d9422a21e0 . 1996-04-08 04:54:35 +00:00
Jim Meyering
4be30f34c2 . 1996-04-08 04:54:00 +00:00
Jim Meyering
4da76e0c6f (mon_week_ISO): New function to implement new %V format.
(sun_week): Make TM parameter `const'.
(mon_week): Likewise.
(mon_week): Rewrite to correctly implement %W format..
1996-04-08 04:53:54 +00:00
Jim Meyering
39c92b4dc4 (print_numbers): Fix off-by-one error in backwards-counting loop.
Reported by Karl Eichwalder.
1996-04-08 04:37:45 +00:00
Jim Meyering
c74a04a26f . 1996-04-07 17:56:40 +00:00
Jim Meyering
aedf3f9fc5 updage from gettext-0.10.12 1996-04-07 17:53:50 +00:00
Jim Meyering
7e76b8b7da (usage): Give minimal description of the program.
(print_factors): Give a better diagnostic.
(main): Suggest --help upon failure.
Reported by Karl Eichwalder <ke@ke.Central.DE>.
1996-04-07 17:46:03 +00:00
Jim Meyering
d9fe359377 . 1996-04-07 17:27:27 +00:00
Jim Meyering
c32c5775be Fiddle with messages. 1996-04-07 17:27:11 +00:00
Jim Meyering
3220407d48 (print_numbers): Give more precise diagnostic when increment
is inconsistent with FROM and TO.
(usage): Clean up help message.
1996-04-07 17:10:21 +00:00
Jim Meyering
45c51b256a (main): Rearrange loops to get it right.
Reported by Karl Eichwalder <ke@ke.Central.DE>.
1996-04-07 16:59:12 +00:00
Jim Meyering
c1505fc01f (sun_week): Make %U work properly.
Before, `date -d '1 Jan 1995' +%U' output `00'.  Now it prints `01'.
1996-04-05 23:33:09 +00:00
Jim Meyering
cca1377d96 . 1996-04-05 16:08:32 +00:00
Jim Meyering
8024d6459c . 1996-04-05 16:04:56 +00:00
Jim Meyering
78732c5421 Remove diagnostic. 1996-04-05 16:04:15 +00:00
Jim Meyering
0e199278c1 (main): Use `if' stmt, not while loop, around getopt invocation.
Otherwise, `./nice --a=1 -1 ./nice' (in which old-style option
follows a long option) gets an error.
1996-04-05 13:32:39 +00:00
Jim Meyering
9d22ab92f9 Patch from Frank Korz. 1996-04-05 13:14:59 +00:00
Jim Meyering
8a6f26dfd6 . 1996-04-05 04:37:05 +00:00
Jim Meyering
43b84ec02e Remove fixed FIXME. 1996-04-05 04:00:05 +00:00
Jim Meyering
dadd9cf997 . 1996-04-05 03:58:37 +00:00
Jim Meyering
dacd5d7572 . 1996-04-05 03:55:07 +00:00
Jim Meyering
a8b09f0b0a . 1996-04-05 03:28:34 +00:00
Jim Meyering
7670167015 . 1996-04-05 03:27:21 +00:00
Jim Meyering
7f00439ebe . 1996-04-05 03:11:47 +00:00
Jim Meyering
a6263137d7 . 1996-04-05 01:22:42 +00:00
Jim Meyering
efb6a6917b . 1996-04-04 23:16:13 +00:00
Jim Meyering
987f70fee5 . 1996-04-04 23:10:35 +00:00
Jim Meyering
42a0e84308 The following commands all failed unnecessarily.
tr -cs '[:upper:]' '[X*]'
tr -dcs '[:lower:]' n-rs-z
tr -ds '[:xdigit:]' [:alnum:]'
tr -dcs '[:alnum:]' [:digit:]'
tr -dc '[:upper:]'
Reported by Ross Ridge (ross@worf.mks.com).
(validate): Add missing conjunct (translating) in test for
`translating and complementing character classes' error.  Before,
valid uses of tr could fail.  E.g. `tr -dcs '[:cntrl:]' '[:alnum:]''.
(homogeneous_spec_list): New function.
(validate): Use it to relax the old (overly restrictive) restriction
that prohibited use of complemented character classes when translating.
Now, that is allowed as long as the translation maps many to one.
(get_spec_stats): Rename and redefine global has_char_class from
has_upper_or_lower.
1996-04-04 23:08:30 +00:00
Jim Meyering
564707901d . 1996-04-04 20:57:13 +00:00
Jim Meyering
70a316cc3d Add tests from Ross Ridge. 1996-04-04 20:22:10 +00:00
Jim Meyering
7ef62e1fda . 1996-04-04 12:58:29 +00:00
Jim Meyering
118e780f0d . 1996-04-04 12:45:16 +00:00
Jim Meyering
3c5b5b8b03 . 1996-04-03 13:19:59 +00:00
Jim Meyering
0a6412bea9 Include stdio.h before grp.h.
Because <grp.h> on alpha OSF1 V2.0 uses "FILE *".  From Kaveh Ghazi.
1996-04-03 13:19:16 +00:00
Jim Meyering
4a8b8d5f68 . 1996-04-03 12:56:09 +00:00
Jim Meyering
e00bceb7f2 update from gettext-0.10.11 1996-04-03 12:52:22 +00:00
Jim Meyering
58dce30461 . 1996-04-03 12:33:23 +00:00
Jim Meyering
3583bcd14d . 1996-04-03 12:28:18 +00:00
Jim Meyering
3191649a85 (copy_reg): Use ST_NBLOCKS (sb) * 512', not sb.st_blocks *
DEV_BSIZE.'  From H.J. Lu (hjl@lucon.org).
1996-04-03 12:20:24 +00:00
Jim Meyering
4325d27ddd Include assert.h (disabled).
(path_concat): New function.
(do_copy): Use path_concat instead of open-coding part of its
functionality in two places.  This has the additional benefit
of avoiding forming destination names like `D//file' when the
destination directory D includes a trailing slash -- as would
happen when cp is used like this:
mkdir D; touch file D/file; cp -i file D/
Reported by Franois Pinard.
1996-04-03 05:42:14 +00:00
Jim Meyering
834a0cf023 . 1996-04-02 15:57:23 +00:00
Jim Meyering
778abcac1e . 1996-04-02 14:28:26 +00:00
Jim Meyering
741c894274 (unsetenv): unprotoize. 1996-04-01 04:29:28 +00:00
Jim Meyering
651e543fd6 . 1996-04-01 00:16:11 +00:00
Jim Meyering
ae56578d18 . 1996-03-31 23:30:43 +00:00
Jim Meyering
74ca57dfe8 . 1996-03-31 22:31:30 +00:00
Jim Meyering
91aab55475 . 1996-03-31 17:20:34 +00:00
Jim Meyering
fa9c4632bb . 1996-03-31 17:20:02 +00:00
Jim Meyering
3d1c60aba7 . 1996-03-31 17:19:06 +00:00
Jim Meyering
399abab9bc (quote_filename): Use ISGRAPH and ISPRINT in place of
ASCII-centric tests against literals.
(length_of_file_name_and_frills): Likewise.
1996-03-31 17:18:28 +00:00
Jim Meyering
908040f25e Rip out color support. 1996-03-31 14:22:12 +00:00
Jim Meyering
ac906fde2f update from FSF:/home/gd/gnu/lib 1996-03-30 14:26:16 +00:00
Jim Meyering
57dcd53d86 Update from libc. 1996-03-30 12:39:36 +00:00
Jim Meyering
45479ef311 Upgrade from gettext-0.10.10. 1996-03-30 12:19:38 +00:00
Jim Meyering
21fb4595e6 . 1996-03-30 04:18:13 +00:00
Jim Meyering
43c812bc6a . 1996-03-29 16:14:36 +00:00
Jim Meyering
86110845b2 . 1996-03-29 05:47:21 +00:00
Jim Meyering
f9045181fd . 1996-03-29 05:45:25 +00:00
Jim Meyering
850ad58630 . 1996-03-29 05:01:14 +00:00
Jim Meyering
a95c870766 . 1996-03-29 05:00:05 +00:00
Jim Meyering
56d806cf6f . 1996-03-29 04:54:45 +00:00
Jim Meyering
c2efd628df . 1996-03-29 04:53:57 +00:00
Jim Meyering
5eceb4fed1 . 1996-03-28 06:19:37 +00:00
Jim Meyering
38457c3dac . 1996-03-28 06:18:24 +00:00
Jim Meyering
fee163dd57 Move usage to precede main.
Say `too few arguments' if that's why we display usage.
Protoize.
Include error.h.
Update copyright.
1996-03-28 06:17:34 +00:00
Jim Meyering
f954f74302 . 1996-03-28 06:14:59 +00:00
Jim Meyering
0271d97259 from Roland 1996-03-28 05:42:56 +00:00
Jim Meyering
9cb8617078 . 1996-03-28 05:35:48 +00:00
Jim Meyering
7c5f9f7faa (cksum): Use format "%lu %ld" (instead of "%10lu %8ld")
to be POSIX compliant.  From Stephen Gildea <gildea@x.org>.
1996-03-28 05:35:31 +00:00
Jim Meyering
053855b040 . 1996-03-26 05:46:05 +00:00
Jim Meyering
a5b5719d3b Document and example --rfc.
Document %z and %Z.
1996-03-26 05:44:03 +00:00
Jim Meyering
01b69091e2 . 1996-03-24 18:50:47 +00:00
Jim Meyering
d30fa5d58e . 1996-03-24 18:49:38 +00:00
Jim Meyering
b54cd94fe7 . 1996-03-24 18:48:25 +00:00
Jim Meyering
5de0b392f2 Update FSF's address. 1996-03-24 18:47:09 +00:00
Jim Meyering
3613700a38 Update FSF's address. 1996-03-24 18:40:53 +00:00
Jim Meyering
318a497768 Update FSF's address. 1996-03-24 18:33:12 +00:00
Jim Meyering
7b428cdeda . 1996-03-24 18:23:44 +00:00
Jim Meyering
b28595b502 . 1996-03-24 18:20:25 +00:00
Jim Meyering
f9714aa24d Include xstrtod.h.
(scan_double_arg): Use xstrtod rather than strtod directly.
1996-03-24 18:16:10 +00:00
Jim Meyering
a9ff449aa6 . 1996-03-24 18:13:56 +00:00
Jim Meyering
236c02759b Make parameters const where appropriate.
Rename global FROM to START.
(print_numbers): Rewrite loops to avoid incrementing.  Instead,
use `x = first + i * increment' paradigm.  Otherwise, with inexact
increment, you could miss the last value.
1996-03-24 17:50:09 +00:00
Jim Meyering
777948e773 Protoize and reorder functions. 1996-03-24 17:43:41 +00:00
Jim Meyering
6e45576dd6 (main): Reformat if-block a little.
Declare index I to be of type size_t to avoid warning from gcc -Wall.
1996-03-24 17:21:40 +00:00
Jim Meyering
2bc35b0348 . 1996-03-24 16:59:29 +00:00
Jim Meyering
818d29db9b Call error with EXIT_FAILURE (rather than `1') as first actual parameter. 1996-03-24 16:59:11 +00:00
Jim Meyering
47f70113d4 Exit with status EXIT_SUCCESS or EXIT_FAILURE, rather than 0 or 1.
This doesn't change `error (1' calls.
1996-03-24 14:58:01 +00:00
Jim Meyering
2fa0c16e5e . 1996-03-24 05:15:00 +00:00
Jim Meyering
8060afb088 . 1996-03-24 02:31:39 +00:00
Jim Meyering
a1bc39d130 . 1996-03-24 02:26:30 +00:00
Jim Meyering
e6fae6c23f [SORT_FAILURE]: New macro.
Be careful to exit with 1 only when -c is used and the
input is not properly sorted.  In all other cases, use
SORT_FAILURE as required by POSIX.
(main): Change some `error (1, ...' to use SORT_FAILURE.
Upon successful termination, exit with EXIT_SUCCESS instead of `0'.
Replace all uses of `2' (as exit code) with SORT_FAILURE.
1996-03-24 02:26:21 +00:00
Jim Meyering
adb160df0f . 1996-03-24 02:20:06 +00:00
Jim Meyering
74a776f9ae . 1996-03-24 02:19:39 +00:00
Jim Meyering
12ea18c68d . 1996-03-24 02:19:31 +00:00
Jim Meyering
f870ecb4a6 . 1996-03-22 04:57:19 +00:00
Jim Meyering
6d6bfafbdd . 1996-03-22 04:55:00 +00:00
Jim Meyering
7178674807 Include assert.h, but disable assertions.
(process_line_count): Replace if-abort with a slightly relaxed
assertion.  Before, `echo |csplit - 1 1' would abort.
Reported by Samuli.Karkkainen@hut.fi.
(parse_patterns): Disallow uses like `csplit FILE 0' with zero
line number, `csplit FILE 2 1' with decreasing line numbers, and
warn about uses like `csplit FILE 3 3' that have equal line numbers.
1996-03-22 04:54:46 +00:00
Jim Meyering
1954f681c6 (main): Declare to be of type int, not void. 1996-03-21 22:47:02 +00:00
Jim Meyering
bb6a548712 (main): Declare to be of type int, not void. 1996-03-21 22:45:19 +00:00
Jim Meyering
403816eb85 . 1996-03-21 22:43:38 +00:00
Jim Meyering
adb7c216b2 (main): Declare to be of type int, not void. 1996-03-21 22:41:04 +00:00
Jim Meyering
92d78458e0 . 1996-03-21 13:00:25 +00:00
Jim Meyering
dd5db06467 (main): Declare to return int, not void. From Peter Seebach
<seebs@taniemarie.solon.com>.
1996-03-21 13:00:15 +00:00
Jim Meyering
b13e6b03cc . 1996-03-18 05:52:07 +00:00
Jim Meyering
a2b8387b70 . 1996-03-16 22:37:33 +00:00
Jim Meyering
4229a555fc Don't include version.h.
(main): Use PACKAGE_VERSION instead of version_string.
1996-03-16 22:30:54 +00:00
Jim Meyering
688833b80e . 1996-03-16 16:54:48 +00:00
Jim Meyering
ca0246a4c1 Don't include version.h.
(main): Use PACKAGE_VERSION instead of version_string.
1996-03-16 16:49:28 +00:00
Jim Meyering
c1cdafa1b4 Change @VERSION@ to @PKG_VERSION@. 1996-03-16 16:41:36 +00:00
Jim Meyering
ed960988ee . 1996-03-16 16:14:50 +00:00
Jim Meyering
3ee97d4d5b Don't include version.h.
(main): Use PACKAGE_VERSION instead of version_string.
1996-03-16 16:14:26 +00:00
Jim Meyering
b34f300eaf . 1996-03-16 05:44:09 +00:00
Jim Meyering
2e5cc5e04e (read_utmp): Declare n_read to be of type size_t rather than int. 1996-03-16 05:44:02 +00:00
Jim Meyering
182c784a99 (validate_path): Cast path_max to size_t before
comparing with strlen(path).
1996-03-16 05:43:24 +00:00
Jim Meyering
b14b621029 Remove __P-protected prototype for basename.
Reported by Franois Pinard.
(remove_suffix): Move to precede use.  Remove prototype.
Declare formal parameter SUFFIX to be const.
1996-03-16 05:42:53 +00:00
Jim Meyering
8825dba4e7 . 1996-03-14 05:21:43 +00:00
Jim Meyering
9922b56ffb add ## comment on first line 1996-03-14 05:15:16 +00:00
Jim Meyering
6681674e3c (EXTRA_DIST): Renamed form DIST_OTHER. 1996-03-14 05:05:22 +00:00
Jim Meyering
99f35e8204 . 1996-03-14 04:52:29 +00:00
Jim Meyering
c46f149efd . 1996-03-13 05:24:33 +00:00
Jim Meyering
644d185dea . 1996-03-13 05:13:52 +00:00
Jim Meyering
6fc4ae7a28 (main): Initialize for internationalized message support:
call setlocale, bindtextdomain, and textdomain.
1996-03-12 23:49:29 +00:00
Jim Meyering
3f92a4421a . 1996-03-12 04:20:57 +00:00
Jim Meyering
7a4a5dd66c . 1996-03-12 04:14:47 +00:00
Jim Meyering
fe456215a6 [_]: Don't define this away. 1996-03-12 04:02:07 +00:00
Jim Meyering
65957278ab . 1996-03-12 04:01:04 +00:00
Jim Meyering
6f2e1d1ce2 (max_backup_version): Declare file_name_length to be of type size_t. 1996-03-12 03:58:25 +00:00
Jim Meyering
51078dff7f . 1996-03-12 03:35:21 +00:00
Jim Meyering
03824c9e29 . 1996-03-12 03:29:57 +00:00
Jim Meyering
10c96c43ac (main): Initialize for internationalized message support: call setlocale,
bindtextdomain, and textdomain.
1996-03-12 03:08:30 +00:00
Jim Meyering
8e8fd5439a Add definitions and includes for NLS. 1996-03-12 03:06:47 +00:00
Jim Meyering
d3bcbd9968 . 1996-03-11 22:07:30 +00:00
Jim Meyering
6526b37460 (write_bytes): Renamed from xfwrite.
Remove SIZE parameter.  It was always 1.
Update all callers.
Rename NELEM parameter to N_BYTES and change its type to size_t.
1996-03-11 22:07:21 +00:00
Jim Meyering
9379b5aed5 Merge changes from FSF. 1996-03-10 05:00:20 +00:00
Jim Meyering
f2794b3c5d . 1996-03-09 20:26:12 +00:00
Jim Meyering
f090816a3f (star_digits_closebracket): Declare formal param, IDX, and local I to
be of type size_t (rather than int) to avoid warnings from gcc -Wall.
1996-03-09 20:25:29 +00:00
Jim Meyering
d385bbc985 (memcasecmp): Declare local I to be unsigned to avoid warning from gcc -Wall. 1996-03-09 20:24:01 +00:00
Jim Meyering
715765a548 (main): Initialize for internationalized message support: call setlocale,
bindtextdomain, and textdomain.
1996-03-09 20:19:13 +00:00
Jim Meyering
de0fdbb080 . 1996-03-09 20:17:53 +00:00
Jim Meyering
e6800f5073 Use /usr/bin/perl.
Remove unused $test.
1996-03-09 17:53:59 +00:00
Jim Meyering
e1ff4d762b Change some more " to '. 1996-03-09 17:53:18 +00:00
Jim Meyering
ffccedee33 Fix for perl5 (there were % inside double-quoted strings).
Change a lot of "" to ''.
1996-03-09 17:50:59 +00:00
Jim Meyering
8ddd60a387 (copy): Comment change to avoid overwriting source with backup. 1996-03-09 04:59:22 +00:00
Jim Meyering
eaf359df0c . 1996-03-08 02:26:21 +00:00
Jim Meyering
ff6400a018 (main): Tell read_filesystem_list that it should determine file system type
when the user specifies --print-type or -T.  From Michael Rendell
<michael@cs.mun.ca>
1996-03-08 02:25:40 +00:00
Jim Meyering
a74458a36e (print_entry): Use STRUCT_UTMP, not `struct utmp'. 1996-03-07 03:41:22 +00:00
Jim Meyering
e6c847ea05 . 1996-03-07 03:41:11 +00:00
Jim Meyering
c7d28e2bd8 . 1996-03-06 05:13:10 +00:00
Jim Meyering
898f3e5757 . 1996-03-06 05:10:30 +00:00
Jim Meyering
c239e82816 (usage): Reorder --time and --help so --help is the latter (just
before --version) to be consistent with other usage functions.
1996-03-06 05:04:05 +00:00
Jim Meyering
aaa9cb7c22 (RelativeMonth): Add 1900 to the year so that relative date specs
that push the year through the end of the century work.  For example,
`date -d "01/01/1998 3 years" +%Y' now prints 2001.
From Peter Dalgaard (pd@kubism.ku.dk).
1996-03-06 04:57:01 +00:00
Jim Meyering
73d802bead . 1996-03-06 04:50:26 +00:00
Jim Meyering
29b0ceae9f . 1996-03-05 05:47:09 +00:00
Jim Meyering
b21af8a7dd (main): Exit after processing --version. 1996-03-05 05:47:04 +00:00
Jim Meyering
7a888be2e5 . 1996-03-02 05:46:23 +00:00
Jim Meyering
815b5ca1d5 (WINDOWS_SETFILEMODE_BINARY): New macro.
(skip) [_WIN32 && _O_BINARY]: Use it.
(read_char): Likewise.
(read_block): Likewise.
Based on changes by Gary Newman <gnewman@shore.net>.
1996-03-02 05:45:45 +00:00
Jim Meyering
76118226b6 Document sort -z. From eichin@cygnus.com. 1996-03-02 03:42:56 +00:00
Jim Meyering
091c054eed . 1996-03-02 03:00:54 +00:00
Jim Meyering
3d2a9041f9 (docolon): Don't use deceptively-named RE_SYNTAX_POSIX_BASIC -- it recognizes
non-BRE \?, \+, and \|.  Instead, use RE_SYNTAX_POSIX_MINIMAL_BASIC.
1996-03-02 02:45:20 +00:00
Jim Meyering
aeb85812a1 . 1996-02-29 05:19:24 +00:00
Jim Meyering
3a3b589b06 . 1996-02-29 05:10:23 +00:00
Jim Meyering
20c8b4db54 . 1996-02-29 05:09:45 +00:00
Jim Meyering
c44dd6ddad . 1996-02-29 05:09:32 +00:00
Jim Meyering
446976666c General cleanup. Use xstrtoul, not atoi.
Change output format.  Allow inputs as large as ULONG_MAX.
Allow more than one command line argument.
1996-02-29 05:07:34 +00:00
Jim Meyering
c997ad6f05 . 1996-02-29 03:08:29 +00:00
Jim Meyering
27a6efc25b . 1996-02-29 03:06:42 +00:00
Jim Meyering
557514f55c (wrapf) [!__STDC__]: Indent by one space the first line of the pre-ANSI
function definition so ansi2knr doesn't munge it.
1996-02-29 03:06:10 +00:00
Jim Meyering
5ba09e9ace . 1996-02-29 02:55:04 +00:00
Jim Meyering
60ae95f973 . 1996-02-29 02:53:42 +00:00
Jim Meyering
9a181424ac (eval6): Cast strlen to int to avoid warning from gcc -Wall. 1996-02-29 02:53:37 +00:00
Jim Meyering
4e3478c9d6 . 1996-02-29 02:33:57 +00:00
Jim Meyering
3803547285 . 1996-02-29 02:27:43 +00:00
Jim Meyering
cbdd4ce994 Use @sc{} around POSIX and POSIX.2. 1996-02-29 02:14:16 +00:00
Jim Meyering
3749705b11 . 1996-02-28 05:14:04 +00:00
Jim Meyering
c940655b0f . 1996-02-28 05:11:50 +00:00
Jim Meyering
db18c4898e Adapt for automake-0.30.
(noinst_HEADERS): Rename from HEADERS.
1996-02-28 05:10:05 +00:00
Jim Meyering
5d78a2a235 . 1996-02-28 05:05:21 +00:00
Jim Meyering
268ddc7d50 Revert last change. Comment didn't add anything. 1996-02-27 03:57:49 +00:00
Jim Meyering
dee715bb6f Elaborate comment. 1996-02-27 03:33:23 +00:00
Jim Meyering
edac0ff420 (copy): Remove bogus (now that we're using full_write) increment of w_partial.
Change sense of the tests (though they're equivalent) that check
the value returned by full_write. making it clearer where errno
is valid.  full_write always writes the full amount or fails.
1996-02-27 03:24:31 +00:00
Jim Meyering
3f10c64fca . 1996-02-27 03:24:07 +00:00
Jim Meyering
d706ee318c . 1996-02-26 04:20:07 +00:00
Jim Meyering
a4d2c17357 . 1996-02-25 12:55:48 +00:00
Jim Meyering
6f37efd8b2 (batch_convert): Put `' around filename in error in case it's empty. 1996-02-25 05:31:26 +00:00
Jim Meyering
746c5e5528 Unprotoize. 1996-02-24 18:30:46 +00:00
Jim Meyering
6ff9e537fe . 1996-02-24 18:29:11 +00:00
Jim Meyering
b12057e3bd __P-protect forward declarations.
(main): Protoize function definition.
1996-02-24 18:27:11 +00:00
Jim Meyering
34e1cf8304 (cmpf): Indent macro uses so ansi2knr doesn't mistake them
for function dcls and munge them.
(arithf): Likewise.
(arithdivf): Likewise.
1996-02-24 18:25:29 +00:00
Jim Meyering
178d3b59d5 . 1996-02-23 16:29:43 +00:00
Jim Meyering
ce4e2493ee [HAVE_SYS_SOCKET_H]: Include <sys/socket.h> for definition of AF_INET
on at least SunOS 4.
1996-02-23 16:14:27 +00:00
Jim Meyering
85f9983c19 (docolon): Set re_syntax_options to RE_SYNTAX_POSIX_BASIC
so expr's pattern matching uses BASIC (not GNU-extended) REs.
Reported by Jim Kingdon.
1996-02-23 16:13:53 +00:00
Jim Meyering
9cb56e2980 (print_entry): Use strchr, not index. 1996-02-23 16:12:01 +00:00
Jim Meyering
c5134a9b13 (batch_convert): Declare BUFLEN local to be of type size_t, not int. 1996-02-23 16:11:14 +00:00
Jim Meyering
475d6600c1 . 1996-02-23 14:40:13 +00:00
Jim Meyering
3dbdcab168 . 1996-02-23 14:37:47 +00:00
Jim Meyering
756fe67e60 (xfields) [without -t]: Ignore leading blanks.
From David Dyck	(dcd@tc.fluke.COM).
1996-02-22 00:58:12 +00:00
Jim Meyering
23d07a32b2 . 1996-02-22 00:57:24 +00:00
Jim Meyering
9f82a64eb6 . 1996-02-22 00:56:40 +00:00
Jim Meyering
79b86f69e6 . 1996-02-21 19:53:35 +00:00
Jim Meyering
4d81490eb3 . 1996-02-20 02:33:14 +00:00
Jim Meyering
28a24ea3be [TOLOWER]: Define.
(usage): Briefly describe new --ignore-case (-i) option.
(memcasecmp): New function.
(main): Set IGNORE_CASE for -i.
(keycmp): Compare with memcasecmp if IGNORE_CASE is set.
Suggestion and an initial patch from Alberto Accomazzi
<alberto@cfa0.harvard.edu>.
1996-02-18 18:08:01 +00:00
Jim Meyering
6a4e9d5422 . 1996-02-18 18:07:36 +00:00
Jim Meyering
777d5f0ba8 (join): Describe new --ignore-case (-i) option. 1996-02-18 17:58:01 +00:00
Jim Meyering
9e7cf8346d . 1996-02-18 04:11:40 +00:00
Jim Meyering
1f37d82ce4 Add -z option. Change all occurrences of '\n' to `eolchar'.
(usage): Describe it.
(main): Set eolchar to 0 for -z.
From Mark W. Eichin <eichin@cygnus.com>.
1996-02-18 00:55:08 +00:00
Jim Meyering
baf2a7b0fe . 1996-02-17 03:45:17 +00:00
Jim Meyering
73d5e9c5dd Mark a few error strings for translation.
From Franc,ois Pinard.
1996-02-17 03:42:26 +00:00
Jim Meyering
daf7870cb0 . 1996-02-16 05:16:46 +00:00
Jim Meyering
796e41bedf . 1996-02-16 05:15:26 +00:00
Jim Meyering
816194943b (copy): Detect (and fail) when creating backup file would destroy source.
Reported by Martin C. Martin <mcm@cs.cmu.edu>.
1996-02-16 05:08:04 +00:00
Jim Meyering
2eabfeeea8 . 1996-02-16 03:30:58 +00:00
Jim Meyering
5715c04ceb . 1996-02-14 05:49:26 +00:00
Jim Meyering
dd05029135 (main): When failing because there were `too many arguments,' say so. 1996-02-14 05:48:48 +00:00
Jim Meyering
78362fb43a . 1996-02-13 05:37:09 +00:00
Jim Meyering
1723365c85 . 1996-02-13 05:31:19 +00:00
Jim Meyering
7e9524d7b9 . 1996-02-13 05:30:27 +00:00
Jim Meyering
c4b593538b Be careful to always return something. 1996-02-13 05:28:38 +00:00
Jim Meyering
0b2ebf9875 (print_entry): If possible, canonicalize the host hame.
From Miles Bader (miles@gnu.ai.mit.edu).
1996-02-13 05:27:16 +00:00
Jim Meyering
aa35ed104c . 1996-02-13 05:24:05 +00:00
Jim Meyering
737a7a7116 . 1996-02-13 05:23:35 +00:00
Jim Meyering
4634a5c628 . 1996-02-13 05:22:15 +00:00
Jim Meyering
c33725a845 (info_TEXINFOS): Renamed from TEXINFOS. 1996-02-13 05:21:44 +00:00
Jim Meyering
e70623f196 (CONFIG_HEADER): Don't define. Automake now does it. 1996-02-13 05:21:12 +00:00
Jim Meyering
862593b1f7 . 1996-02-13 05:17:50 +00:00
Jim Meyering
215318944a . 1996-02-13 03:24:52 +00:00
Jim Meyering
58e02de834 [.TRUE]: Undefine before defining.
[FALSE]: Undefine before defining.
From Derek Clegg (dclegg@next.com).
1996-02-13 03:12:52 +00:00
Jim Meyering
e02a4a825a . 1996-02-13 03:12:38 +00:00
Jim Meyering
73c74c0303 (canon_host): Cast returned he->h_name to char*. 1996-02-04 13:22:22 +00:00
Jim Meyering
2d882a7200 . 1996-02-04 12:47:33 +00:00
Jim Meyering
d2a3720ad0 . 1996-02-03 22:20:54 +00:00
Jim Meyering
e6777f1523 . 1996-02-03 03:24:22 +00:00
Jim Meyering
41d5fb8189 (main): Decalare local, BS. 1996-02-01 06:16:57 +00:00
Jim Meyering
3480c29030 . 1996-02-01 06:14:18 +00:00
Jim Meyering
a5c268a9f9 __P-protect dcls. 1996-02-01 06:13:54 +00:00
Jim Meyering
4f3121b654 . 1996-02-01 06:11:41 +00:00
Jim Meyering
73b2951ffe . 1996-02-01 06:10:10 +00:00
Jim Meyering
46505987ea (main): Accept new option, --rfc-822 (-R).
(show_date): Use RFC822-mandated strftime format.
From H. Peter Anvin (hpa@storm.net).
(usage): Add a line describing the new option.
1996-02-01 05:44:59 +00:00
Jim Meyering
bf58f8aea9 . 1996-02-01 05:44:38 +00:00
Jim Meyering
6c52fbcdfd (add_num_tz): New function.
(strftime): Handle new %z format.
From H. Peter Anvin (hpa@storm.net).
Don't use local, LENGTH, before it's defined.
1996-02-01 05:40:32 +00:00
Jim Meyering
e76eb59d84 (main): New options --human-readable (-h) and --megabytes (-m).
(human_readable_1k_blocks): New function.
(print_header): Honor new options.
(show_dev): Honor new options.
Add ifdef'd-out code to avoid printing lines for mount points that
match ^/auto/.* and ^/tmp_mnt.*.  Rather than hard-coding those
two prefixes, the code should allow the user to specify a regular
expression.  From Larry McVoy (lm@sgi.com).

(human_readable_1k_blocks): Likewise
(usage): Update usage message to reflect additions.
1996-02-01 05:30:14 +00:00
Jim Meyering
5b093c28e1 . 1996-02-01 05:29:26 +00:00
Jim Meyering
9d3b949aa6 . 1996-02-01 05:26:35 +00:00
Jim Meyering
a468d7579f (dump_remainder): Flush stdout when tailing-forever on multiple files.
From Carlos Canau <Carlos.Canau@relay.puug.pt>.
1996-02-01 05:25:54 +00:00
Jim Meyering
4eb32cb4f2 . 1996-02-01 05:22:08 +00:00
Jim Meyering
8f08533808 . 1996-02-01 04:22:48 +00:00
Jim Meyering
3b69e6514c Remove comma after last item in enum.
(human_readable): Fix off-by-one error that converted
1024*1024 to 1024K rather than 1G.  Describe the function.
1996-02-01 04:13:26 +00:00
Jim Meyering
9018ec3d41 (skip): Change type of parameter #5 from char* to unsigned char* to match
type of argument.
(copy): Cast first arg in memset call to char* to avoid warnings from
SunOS's acc.
(copy_simple): Likewise.
1996-02-01 03:50:06 +00:00
Jim Meyering
5d16193294 (getdate.c, posixtm.c): Add rules for building these. 1996-02-01 03:43:49 +00:00
Jim Meyering
61b305d30d (DIST_OTHER): Add perm.texi and getdate.texi. Remove mdate-sh. 1996-02-01 03:42:56 +00:00
Jim Meyering
efc9004234 . 1996-01-31 17:01:05 +00:00
Jim Meyering
ba733f2d38 . 1996-01-31 14:53:02 +00:00
Jim Meyering
34a122edc8 . 1996-01-30 01:27:32 +00:00
Jim Meyering
a5afd877aa . 1996-01-26 05:25:09 +00:00
Jim Meyering
1289479fce . 1996-01-25 12:00:18 +00:00
Jim Meyering
7bfb13dea7 Tweak usage. 1996-01-20 14:27:56 +00:00
Jim Meyering
744d31d57a (main): New options --human-readable (-h) and --megabytes (-m).
(human_readable): New function.
From Larry McVoy (lm@sgi.com).
1996-01-20 14:26:04 +00:00
Jim Meyering
a58305d61e . 1996-01-20 12:41:13 +00:00
Jim Meyering
3bd2561144 . 1996-01-20 12:37:23 +00:00
Jim Meyering
156a61c86d (usage): Copy backup/suffix stuff from ln.c.
(main): Handle 'S' in getopt switch.
1996-01-20 12:37:12 +00:00
Jim Meyering
5850877aea (BUILT_SOURCES): Set to posixtm.c getdate.c. 1996-01-20 12:35:06 +00:00
Jim Meyering
847dcc878b . 1996-01-20 12:33:59 +00:00
Jim Meyering
84791e75cc . 1996-01-20 12:22:38 +00:00
Jim Meyering
e30230223c Year is 6th field, not 7th. 1996-01-20 12:18:50 +00:00
Jim Meyering
884e63790c . 1996-01-20 12:11:48 +00:00
Jim Meyering
a0b8bf89d3 . 1996-01-19 17:39:42 +00:00
Jim Meyering
c3e64b1b2d (copy_files): Accept backup options just as cp, ln, and
mv do: --backup (-b).  From Marty Leisner <leisner@sdsp.mc.xerox.c>.
1996-01-19 17:39:06 +00:00
Jim Meyering
2131b2e9d5 Protoize. 1996-01-19 16:05:23 +00:00
Jim Meyering
6981af01ee . 1996-01-19 16:00:29 +00:00
Jim Meyering
863c253425 (argdecode): Declare parameter const. 1996-01-17 17:50:08 +00:00
Jim Meyering
08d800d44e (advance): Protoize function. 1996-01-17 17:46:12 +00:00
Jim Meyering
e23e3f656a Break some long lines.
Add const attribute to a few parameters.
1996-01-17 17:44:22 +00:00
Jim Meyering
4ad4b8aaec (integer_arg): Use xstrtol instead of open-coding this. 1996-01-17 17:41:00 +00:00
Jim Meyering
0f32a82524 (.su_SOURCES): Add xstrtol.c.
(HEADERS): Add xstrtol.h.
1996-01-17 17:38:27 +00:00
Jim Meyering
2a0d3143dd (visible): Change parameter type to unsigned int from unsigned char. 1996-01-17 17:20:41 +00:00
Jim Meyering
6e867c19c9 Protoize and __P-protect forward dcls. 1996-01-17 17:19:07 +00:00
Jim Meyering
c78152220a Indent cpp directives. 1996-01-14 04:31:59 +00:00
Jim Meyering
be2519d4dd . 1996-01-14 04:19:34 +00:00
Jim Meyering
9800c1597f Include config.h. 1996-01-14 04:18:48 +00:00
Jim Meyering
2bf12371d8 . 1996-01-08 06:15:59 +00:00
Jim Meyering
7243acff2a . 1996-01-08 06:15:20 +00:00
Jim Meyering
bfa30819b9 . 1996-01-08 04:54:29 +00:00
Jim Meyering
ac5e053d8f . 1996-01-08 04:53:30 +00:00
Jim Meyering
13751495a1 (print_element): Change type of argument from char
to int to avoid potential promotion problem.
1996-01-07 04:08:44 +00:00
Jim Meyering
1d2f218bff (print_esc_char): Change type of argument from char to int to avoid
potential promotion problem.
1996-01-07 04:06:41 +00:00
Jim Meyering
00b953713e Fix typo in __P use. 1996-01-07 04:04:48 +00:00
Jim Meyering
ed4a024430 . 1996-01-06 11:57:17 +00:00
Jim Meyering
53398947a1 Protoize and __P-protect forward dcls. 1996-01-06 11:44:05 +00:00
Jim Meyering
5e14cce7ae Define WHO and include new file, who-users.c. 1996-01-06 11:17:50 +00:00
Jim Meyering
27276e481d . 1996-01-06 11:16:08 +00:00
Jim Meyering
7949927db6 rename from who.c 1996-01-06 11:13:11 +00:00
Jim Meyering
634853cee6 Remove NGROUPS_MAX junk. It wasn't being used. 1996-01-06 06:10:08 +00:00
Jim Meyering
0f100b0d3f (putenv): Declare.
(universal_time): Remove.
(main): If -u is given, set TZ to "UTC0"; this causes date to use
UTC uniformly and fixes bugs in the handling of date -u +'%s %Z'.
(show_date): Just use localtime and a single format, since TZ will
be set properly if -u is given.  From Paul Eggert.
1996-01-06 06:07:23 +00:00
Jim Meyering
83adf65c37 Remove no-longer-used NGROUPS_MAX cpp macros.
(print_group_list) [HAVE_GETGROUPS]: Reorganize to use getgroups (0, NULL)
to compute number of groups at run time rather than relying on NGROUPS_MAX
at compile time.
(print_full_info) [HAVE_GETGROUPS]: Likewise.
Suggestion from Roland McGrath.
1996-01-06 06:04:09 +00:00
Jim Meyering
67b467223a . 1996-01-06 05:28:49 +00:00
Jim Meyering
2e6b75c735 . 1996-01-06 00:30:45 +00:00
Jim Meyering
0ec5eacc92 . 1996-01-05 04:56:53 +00:00
Jim Meyering
b024130dc2 . 1996-01-05 02:46:41 +00:00
Jim Meyering
aff66fa170 Include rx.h after limit.h to avoid warning about
redeclaration of RE_DUP_MAX in limit.h.  rx.h protects its
definition.  From Kaveh Ghazi.
1996-01-05 02:44:42 +00:00
Jim Meyering
92e8245d90 . 1996-01-05 02:37:28 +00:00
Jim Meyering
c300ac7a4d [SYNTAX]: Rename from SYNTAX_TABLE.
[SYNTAX_TABLE]: Remove extern dcl or re_syntax_table.
(RE_SEARCH_2_FN): Cast string1 and string2 to avoid pointer type
mismatch errors from e.g. SunOS's /bin/cc.
Reported by Kaveh Ghazi.
1996-01-05 02:35:39 +00:00
Jim Meyering
67b836ed72 . 1996-01-04 12:48:25 +00:00
Jim Meyering
388569f846 . 1996-01-04 05:35:34 +00:00
Jim Meyering
981d081027 (usage): Tweak wording in --help output. 1996-01-04 05:31:58 +00:00
Jim Meyering
6a7bd50a0b Use $year', not year' as expr arg. 1996-01-04 05:29:09 +00:00
Jim Meyering
f280d719f3 update from gettext 1996-01-04 05:24:48 +00:00
Jim Meyering
1d39399861 . 1996-01-03 18:20:16 +00:00
Jim Meyering
008d74220b . 1996-01-03 06:04:46 +00:00
Jim Meyering
0f0189167b Fix comments. 1996-01-03 05:55:26 +00:00
Jim Meyering
bf6bcd3c16 . 1996-01-03 05:51:15 +00:00
Jim Meyering
b439039b9b . 1996-01-03 05:49:22 +00:00
Jim Meyering
2cada8c970 . 1996-01-02 06:10:49 +00:00
Jim Meyering
360b2870d8 (keycompare): Rewrite cases handling -i and -if to fix bug whereby
non-ascii characters (supposed to be ignored with -i) were treated
as significant.  Reported by Carl Johnson <carlj@cjlinux.home.org>.
1996-01-02 06:10:39 +00:00
Jim Meyering
b669dbd1ad 14b: Just like 14a, but add -f. 1996-01-02 00:15:46 +00:00
Jim Meyering
b81692a8a9 Correct 14a per manual. 1996-01-01 23:55:02 +00:00
Jim Meyering
dfa0cede72 . 1996-01-01 22:33:52 +00:00
Jim Meyering
add1d7c11f . 1995-12-31 06:46:46 +00:00
Jim Meyering
221ef68cc3 . 1995-12-31 04:12:10 +00:00
Jim Meyering
a7190a7381 (extract_regexp) [!WITH_REGEX]: Initialize re_compiled.syntax_parens.
From Andreas Schwab.
1995-12-31 04:10:13 +00:00
Jim Meyering
f721ed2bf4 . 1995-12-26 05:50:19 +00:00
Jim Meyering
6dde9c58fe . 1995-12-23 18:19:26 +00:00
Jim Meyering
f1a5372cbc . 1995-12-23 17:39:21 +00:00
Jim Meyering
c22b040b21 (decode_switches): Make -o a synonym for -lG for compatibility
with most other versions of ls.  Reported by Karl Berry.
(usage): Update.
1995-12-23 17:38:08 +00:00
Jim Meyering
0c5abc43a0 . 1995-12-23 16:39:20 +00:00
Jim Meyering
d5f4d5f22e (usage): Align text in -n line. 1995-12-22 15:30:31 +00:00
Jim Meyering
2a5c6dea54 . 1995-12-22 06:51:26 +00:00
Jim Meyering
05d30f2715 (cleanup): New function -- broken out from quit.
(interrupt_handler): Rewrite to reset default signal handler,
call cleanup, then repost caught signal.
1995-12-22 06:49:10 +00:00
Jim Meyering
c8d085374c . 1995-12-22 06:39:47 +00:00
Jim Meyering
9ceb93e7ff . 1995-12-22 05:31:58 +00:00
Jim Meyering
b808e70940 Include argmatch.h. 1995-12-22 05:31:17 +00:00
Jim Meyering
654ad9e596 (main): Accept new option, --sparse={never,auto,always},
to control creation of sparse files.
(copy_reg): Set local, make_holes, from global flag_sparse.
Include argmatch.h.
1995-12-22 05:30:48 +00:00
Jim Meyering
8cff7ef2b9 (argmatch): Add const attribute to parameters.
(invalid_arg): Add const attribute to parameters.
1995-12-22 05:17:31 +00:00
Jim Meyering
137cf55755 . 1995-12-22 05:16:11 +00:00
Jim Meyering
ddc22e05ab . 1995-12-22 05:15:35 +00:00
Jim Meyering
42fcbf3950 (HEADERS): Add argmatch.h. 1995-12-21 23:06:40 +00:00
Jim Meyering
11f5ed65ba . 1995-12-21 23:05:56 +00:00
Jim Meyering
99cf57df5f . 1995-12-20 05:47:35 +00:00
Jim Meyering
b71a140977 . 1995-12-19 04:31:06 +00:00
Jim Meyering
e49897affc [SYMBOLIC_SPACE_STRING]: New macro.
(do_link): Use it instead of open-coded #ifdef.
For --verbose, say `create link DEST to SRC' instead of ambiguous
(or inconsistent with cp -v and mv -v) `SRC -> DEST.'
1995-12-19 04:30:32 +00:00
Jim Meyering
2ef6cb6073 . 1995-12-19 04:25:24 +00:00
Jim Meyering
4db03fe797 . 1995-12-19 03:46:25 +00:00
Jim Meyering
8506a6bc2a (noinst_LIBRARIES): Define this, not plain LIBRARIES. 1995-12-17 22:28:45 +00:00
Jim Meyering
8303c90f14 . 1995-12-15 15:40:40 +00:00
Jim Meyering
a530d04879 . 1995-12-15 15:38:09 +00:00
Jim Meyering
4a99368c87 new version from FSF 1995-12-15 15:36:02 +00:00
Jim Meyering
46faa9979f new version from FSF 1995-12-15 15:35:15 +00:00
Jim Meyering
c038102c6a Apply the usual REL_ALLOC patch. 1995-12-15 15:34:07 +00:00
Jim Meyering
23cfe44342 new, from FSF 1995-12-15 15:33:36 +00:00
Jim Meyering
b3d7a51157 Remove trailing white space. 1995-12-15 15:31:09 +00:00
Jim Meyering
23f91764bc Include config.h. 1995-12-15 15:18:43 +00:00
Jim Meyering
2ab1921d24 Update from latest. 1995-12-15 15:12:58 +00:00
Jim Meyering
1c2d713cab . 1995-12-15 04:52:36 +00:00
Jim Meyering
395224e372 . 1995-12-15 03:40:06 +00:00
Jim Meyering
43cdd09d2d (main): Use xstrtol instead of atoi. 1995-12-15 03:34:34 +00:00
Jim Meyering
de6c7a9b78 (nl): Change --first-page to --starting-line-number. 1995-12-15 03:25:59 +00:00
Jim Meyering
7d7530446c . 1995-12-15 03:20:50 +00:00
Jim Meyering
208fa17ad0 (main): Use xstrtol instead of atoi. 1995-12-15 03:20:40 +00:00
Jim Meyering
5a1b7d267a (main): Use xstrtol instead of atoi.
Rename misleading --first-page=N option to --starting-line-number=N.
(usage): Update.
1995-12-15 03:20:18 +00:00
Jim Meyering
1bcceb8ba4 (main): Use xstrtol instead of atoi.
(fold_file): Make a couple locals `int', not size_t, and cast
fwrite's arg3 to size_t.
1995-12-15 03:19:51 +00:00
Jim Meyering
e0bcf6c00d . 1995-12-09 04:06:38 +00:00
Jim Meyering
0a5f63aee2 . 1995-12-09 04:00:17 +00:00
Jim Meyering
2008517b36 . 1995-12-09 02:52:17 +00:00
Jim Meyering
517bef6ccd . 1995-12-08 22:44:18 +00:00
Jim Meyering
e2db29a312 . 1995-12-08 22:39:38 +00:00
Jim Meyering
a3fa97f5e3 . 1995-12-08 20:19:49 +00:00
Jim Meyering
7fc45bccbd . 1995-12-08 20:18:40 +00:00
Jim Meyering
7d3a280b7a Add copyright. 1995-12-08 04:50:48 +00:00
Jim Meyering
be60b8e319 . 1995-12-07 23:42:31 +00:00
Jim Meyering
4090d52520 . 1995-12-06 23:40:00 +00:00
Jim Meyering
1f88c647cd [!WITH_REGEX]: Include rx.h. 1995-12-06 23:39:26 +00:00
Jim Meyering
08b596b409 fix typos. From Karl Heuer. 1995-12-06 23:26:20 +00:00
Jim Meyering
e625640bd0 (main): Diagnose improper form of arguments to -k, then fail. 1995-12-05 23:50:43 +00:00
Jim Meyering
a6a2dbc63c (main): Diagnose improper form of arguments to -k, then fail.. 1995-12-05 23:50:18 +00:00
Jim Meyering
5c3c1931dd (rm): Work around SunOS 4 bug whereby lstat doesn't fail
when given a zero-length file name argument.  Reported by
Mark Calabretta <mcalabre@atnf.csiro.au>.
1995-12-05 23:39:06 +00:00
Jim Meyering
d75c1aaea1 . 1995-12-05 23:38:40 +00:00
Jim Meyering
f1a905664b . 1995-12-05 17:54:59 +00:00
Jim Meyering
5cf455d736 (numcompare): Properly handle all cases in which signs differ. From Karl Heuer. 1995-12-05 17:53:39 +00:00
Jim Meyering
8ef322d66f (bsd_sum_file): Remove misleading comment. From Karl Heuer. 1995-12-05 15:53:31 +00:00
Jim Meyering
1d5b09348e . 1995-12-04 16:29:54 +00:00
Jim Meyering
5782ca8976 Update to look like the one from textutils. 1995-12-03 04:36:25 +00:00
Jim Meyering
623ce837c7 make like the one in textutils 1995-12-02 04:29:17 +00:00
Jim Meyering
73f21f7813 . 1995-12-01 07:40:46 +00:00
Jim Meyering
a8377ab773 . 1995-12-01 07:38:16 +00:00
Jim Meyering
5106e930d1 Exercise bug re comparing `-' and integers. 1995-12-01 07:32:12 +00:00
Jim Meyering
74b4707ea6 treat `-' as if it were zero. Reported by Ross Alexander
<r.alexander@auckland.ac.nz>.
1995-12-01 07:03:47 +00:00
Jim Meyering
99b8fcfb0d . 1995-11-30 21:00:06 +00:00
Jim Meyering
5df13c9b0a . 1995-11-30 20:59:37 +00:00
Jim Meyering
5eeef11a3b standardizing... 1995-11-30 20:26:33 +00:00
Jim Meyering
cfbca54a71 . 1995-11-30 20:08:07 +00:00
Jim Meyering
f0f6a9c44e . 1995-11-30 20:06:49 +00:00
Jim Meyering
cc1a9180a7 . 1995-11-30 20:06:11 +00:00
Jim Meyering
155639bf0f Lots of new tests -- related to -k2,2 bug and non-functional -b and `b'. 1995-11-30 20:06:06 +00:00
Jim Meyering
c0f51577fd . 1995-11-30 19:42:58 +00:00
Jim Meyering
efac765819 . 1995-11-30 04:34:22 +00:00
Jim Meyering
1c7a2ac60f . 1995-11-30 04:34:06 +00:00
Jim Meyering
f4b094e098 . 1995-11-30 04:32:31 +00:00
Jim Meyering
e984b74461 . 1995-11-30 04:28:27 +00:00
Jim Meyering
c1e61448b3 . 1995-11-30 03:51:59 +00:00
Jim Meyering
2f077ef41f (limfield): Remove field_start junk.
Don't try to trim trailing blanks here -- it's not possible
because we don't know where the field begins.
Properly distinguish between cases where TAB character is specified
and when the default is used.
(trim_trailing_blanks): New function.
(findlines): Call it.
(keycompare): Likewise.
1995-11-29 22:51:04 +00:00
Jim Meyering
cfc48b6ee9 [_]: Define it. 1995-11-29 19:47:42 +00:00
Jim Meyering
073c4cb543 Mark all translatable strings using po-mode.el. 1995-11-29 19:24:52 +00:00
Jim Meyering
8bacb0720c Mark all translatable strings using po-mode.el. 1995-11-29 19:23:30 +00:00
Jim Meyering
da8c36f53f (begfield): Replace unnecessary loop with if-else.
(limfield): Fix bug that made field specs like -k1.5 return a
pointer into LINE beyond the first field.
Rewrite to properly ignore trailing blanks.
Replace unnecessary loop with if-else.
(main): Don't decrement T2 corresponding to `x' in field specs like -ku.v,w.x.
1995-11-28 20:07:17 +00:00
Jim Meyering
83cf5efca9 Tests for bug reported by Roger Peel" <R.Peel@ee.surrey.ac.uk> 1995-11-28 16:52:49 +00:00
Jim Meyering
4d9669b8d9 . 1995-11-27 14:25:39 +00:00
Jim Meyering
18573f3eb2 (usage): Clarify description of --no-dereferences. 1995-11-27 05:46:24 +00:00
Jim Meyering
57ec0f45c9 s/non-zero/nonzero/g 1995-11-27 05:34:31 +00:00
Jim Meyering
a7830ac93b . 1995-11-27 05:29:44 +00:00
Jim Meyering
488bd9911e . 1995-11-27 03:11:36 +00:00
Jim Meyering
7956c15081 s/non-zero/nonzero/g 1995-11-27 03:09:18 +00:00
Jim Meyering
0402200daf Clarify usage. From Karl Berry. 1995-11-26 22:09:43 +00:00
Jim Meyering
dc0708fa82 . 1995-11-26 21:51:42 +00:00
Jim Meyering
7b9ad5a22f [!UINT_MAX]: Define.
[!INT_MAX]: Define.
Include xstrtoul.h.
(string_to_number): Remove function.
(check_for_offset): Use xstrtoul instead of string_to_number.
(parse_repeat_count): Likewise.
(parse_patterns): Likewise.
(main): Likewise.
1995-11-26 21:49:53 +00:00
Jim Meyering
c4e9f56745 . 1995-11-24 05:29:28 +00:00
Jim Meyering
b69a467146 . 1995-11-23 05:17:50 +00:00
Jim Meyering
75cce0c815 . 1995-11-18 20:19:17 +00:00
Jim Meyering
546754d2e9 . 1995-11-18 18:17:42 +00:00
Jim Meyering
e8f8b7a82d Remove autodep junk. 1995-11-18 06:36:47 +00:00
Jim Meyering
c54a604289 Indent cpp directives. 1995-11-18 06:17:07 +00:00
Jim Meyering
f52e14c576 . 1995-11-17 03:41:20 +00:00
Jim Meyering
a0aef26c06 . 1995-11-17 03:29:26 +00:00
Jim Meyering
4d4a6210f7 Remove obsolete FIXME. 1995-11-16 07:39:44 +00:00
Jim Meyering
a5ad9a2579 . 1995-11-16 07:32:45 +00:00
Jim Meyering
79d6ddd36a Fix up description of md5sum --check. 1995-11-16 06:18:17 +00:00
Jim Meyering
18da62e303 . 1995-11-15 23:41:08 +00:00
Jim Meyering
77469b714b (*format_address): Tweak dcl. 1995-11-15 22:16:30 +00:00
Jim Meyering
1fbac54162 [__P]: Don't define it here. 1995-11-15 22:12:59 +00:00
Jim Meyering
cf14c509f3 Use __P. 1995-11-15 21:59:55 +00:00
Jim Meyering
02bde8d334 . 1995-11-15 21:59:20 +00:00
Jim Meyering
e99f534046 . 1995-11-15 21:58:58 +00:00
Jim Meyering
aeac9910cb . 1995-11-15 21:48:06 +00:00
Jim Meyering
f84513b43e (sort, -g): Document it.
(join, new `0' format): Likewise.
1995-11-15 21:47:44 +00:00
Jim Meyering
34fc818d7e Add support for sorting numbers in scientific notation.
Include xstrtod.h.
(struct keyfield): Add field: general_numeric.
(usage): Describe -g option.
(general_numcompare): New function.
(keycompare): Use new comparison function when general_numeric
flag is set.
(set_ordering): Honor `g' flag.
(main): Initialize and use new field.
From Marcus Daniels <marcus@sysc.pdx.edu>.
1995-11-15 21:42:47 +00:00
Jim Meyering
f1e1eb58be Break long lines. 1995-11-15 15:45:28 +00:00
Jim Meyering
3d6c17e94f Indent. 1995-11-15 15:04:51 +00:00
Jim Meyering
ef3e297950 . 1995-11-15 05:40:11 +00:00
Jim Meyering
5cf3719e7b (cleanup): Don't exit.
(cleanup_fatal): New function.  Call cleanup, then exit.
(sighandler): New function.
(cleanup_fatal): Renamed from cleanup.  Call cleanup, then exit.
Update callers.
(tac_stdin): Set up sighandler as signal handler, not `cleanup'.
1995-11-15 05:39:58 +00:00
Jim Meyering
b36e366ef4 (cleanup): Don't exit.
(cleanup_fatal): New functoin.  Call cleanup, then exit.
(interrupt_handler): Rewrite to reset default signal handler
then repost caught signal.
(xmalloc, xrealloc, read_input, write_to_file, handle_line_error,
process_line_count, process_regexp, create_output_file, close_output_file):
Call cleanup_fatal, not cleanup.
Add const attribute to lots of parameters.
1995-11-15 05:32:28 +00:00
Jim Meyering
c2b86aabe0 . 1995-11-11 22:09:47 +00:00
Jim Meyering
849a1c46cf (skip): Cast fseek's offset argument to `long'.
Erik Bennett <bennett@cvo.oneworld.com> reported that this is
necessary on BSDI systems.  And if offset doesn't fit in a long,
then try using lseek instead.
1995-11-11 22:08:16 +00:00
Jim Meyering
7c863aef95 . 1995-11-11 21:46:41 +00:00
Jim Meyering
cc7705fe6f (xmalloc): Declare static.
(xrealloc): Likewise.
1995-11-11 21:46:32 +00:00
Jim Meyering
e97b60d16a . 1995-11-11 14:36:06 +00:00
Jim Meyering
1b1382a3a9 (cleanup): Add signal number parameter.
Update callers.
1995-11-11 14:35:27 +00:00
Jim Meyering
ff0e048521 . 1995-11-11 14:22:33 +00:00
Jim Meyering
0af7afd19f . 1995-11-11 14:21:24 +00:00
Jim Meyering
24aec7f87f (main): Don't die when dev/ino of input and output are
the same and the file descriptors correspond to stdin and stdout.
This is necessary on at least Digital UNIX (aka OSF1) 3.2C.
Otherwise, running `cat << X > $$' would fail with `cat: -: input
file is output file'.  From Jarkko Hietaniemi <jhi@epsilon.hut.fi>.
1995-11-11 14:21:15 +00:00
Jim Meyering
acb7c4ee48 Add __P in dcl of format_address function. 1995-11-11 03:28:38 +00:00
Jim Meyering
5796c221a1 (usage): Clarify meaning of --spaces. 1995-11-11 03:27:15 +00:00
Jim Meyering
dde28b7ffe Don't include error.h here. 1995-11-10 15:20:00 +00:00
Jim Meyering
dfa21e5966 . 1995-11-10 15:15:38 +00:00
Jim Meyering
8014db4d68 Protect prototyped forward dcls with __P. 1995-11-10 14:56:21 +00:00
Jim Meyering
c6394074a8 (parse_ls_color): Use strcpy to initialize 3-character array.
Automatic aggregate initialization isn't portable.
1995-11-10 14:54:08 +00:00
Jim Meyering
83ce0dcba6 Remove fwd dcls. 1995-11-10 14:48:57 +00:00
Jim Meyering
9a69ea769a Don't protoize dcl of basename. 1995-11-10 14:48:03 +00:00
Jim Meyering
3044600151 Don't protoize dcl of basename. 1995-11-10 14:47:09 +00:00
Jim Meyering
da6d91f64b Don't protoize dcls of getpwnam and getgrnam. 1995-11-10 14:45:31 +00:00
Jim Meyering
c6ca8a1528 Remove bogus __P junk on xstat dcl. 1995-11-10 14:44:37 +00:00
Jim Meyering
8108bc26d6 Don't protoize fwd dcl of dirname. 1995-11-10 14:43:31 +00:00
Jim Meyering
908b4d6cb9 . 1995-11-10 14:42:39 +00:00
Jim Meyering
0683df4bf8 Protoize and add const attribute to parameters. 1995-11-10 14:42:08 +00:00
Jim Meyering
05907fc584 Include error.h. 1995-11-10 14:41:20 +00:00
Jim Meyering
ca56751421 Remove prototypes for stat, lstat. 1995-11-10 14:22:07 +00:00
Jim Meyering
dd084ce340 [__P]: Define it. 1995-11-10 12:56:15 +00:00
Jim Meyering
92278a462b . 1995-11-10 05:28:05 +00:00
Jim Meyering
ca56be1e3e . 1995-11-10 05:27:29 +00:00
Jim Meyering
09f8e7fb03 (main): Move to the end.
Remove fwd dcls.
1995-11-10 03:16:16 +00:00
Jim Meyering
c2e9e7a31b (main): Move to the end.
Remove fwd dcls.
1995-11-10 03:14:41 +00:00
Jim Meyering
49f397e6e7 Rearrange functions to obviate forward dcls.
Remove forward dcls.
1995-11-09 23:52:40 +00:00
Jim Meyering
6161f25abc (main): Move to the end.
Remove fwd dcls.
1995-11-09 23:49:53 +00:00
Jim Meyering
0898b54377 (main): Move to the end.
Remove fwd dcls.
1995-11-09 23:49:02 +00:00
Jim Meyering
6f1c4b7a75 Protect prototypes with __P. 1995-11-09 23:47:52 +00:00
Jim Meyering
b7b00aad08 Protect prototypes with __P. 1995-11-09 23:41:10 +00:00
Jim Meyering
ec2a94a410 (main): Move to the end.
Remove most fwd dcls.
1995-11-09 23:31:16 +00:00
Jim Meyering
4796ddfe36 (main): Move to the end.
Remove most fwd dcls.
1995-11-09 23:27:55 +00:00
Jim Meyering
31856b16c3 indent. 1995-11-09 23:27:32 +00:00
Jim Meyering
6732422b97 (main): Move to the end.
Remove most fwd dcls.
1995-11-09 23:26:17 +00:00
Jim Meyering
2b3ce6fab9 Move main to the end.
Remove fwd dcls.
1995-11-09 23:16:13 +00:00
Jim Meyering
b951477c80 (translate_charset): Make parameter `const'. 1995-11-09 23:02:27 +00:00
Jim Meyering
0bf332a016 (struct pathstack): Move dcl to precede prototypes. 1995-11-09 23:00:32 +00:00
Jim Meyering
3e12088cf0 (enum filetype): Move dcl to precede prototypes.
(struct fileinfo): Likewise.
Add const attribute to some parameters.
1995-11-09 23:00:14 +00:00
Jim Meyering
c0d94c89ec Protoize. 1995-11-09 17:02:23 +00:00
Jim Meyering
dd3a088973 . 1995-11-08 05:55:55 +00:00
Jim Meyering
5c15113c49 . 1995-11-08 05:54:16 +00:00
Jim Meyering
553eb65acd (usage): Clarify descriptions of ignpar and ignbrk.
From Theodore Ts'o and Ulrich Windl.
1995-11-08 05:54:07 +00:00
Jim Meyering
0c43179cf9 Remove trailing white space. 1995-11-08 05:51:11 +00:00
Jim Meyering
b031f89b29 Clarify descriptions of ignpar and ignbrk.
From Theodore Ts'o and Ulrich Windl.
1995-11-08 05:50:51 +00:00
Jim Meyering
b7df779b8b New option: --verbose.
(main): Recognize it.
(usage): Document it.
From Marty Leisner <leisner@sdsp.mc.xerox.com>.
1995-11-07 04:56:08 +00:00
Jim Meyering
96ed803f48 . 1995-11-07 04:55:16 +00:00
Jim Meyering
fd798dd6fe From FSF. 1995-11-06 17:06:24 +00:00
Jim Meyering
dd8b68966f . 1995-11-06 16:24:07 +00:00
Jim Meyering
72ce8c67c5 (usage): Remove last sentence. It is redundant. 1995-11-06 14:01:46 +00:00
Jim Meyering
22132a47aa [__P]: Define. Use it in prototyped forward decls. 1995-11-06 05:06:25 +00:00
Jim Meyering
0705aa7388 (store_columns): Remove spurious 2nd argument in call to read_line. 1995-11-06 05:01:16 +00:00
Jim Meyering
762769cf3b Protoize. 1995-11-06 04:58:56 +00:00
Jim Meyering
82eae6c9b5 (join): Protoize. Somehow, protoize missed this one. 1995-11-05 16:58:15 +00:00
Jim Meyering
86f04e3bb3 . 1995-11-05 13:16:57 +00:00
Jim Meyering
ce5f4177bc Protect prototypes with __P. 1995-11-05 13:16:24 +00:00
Jim Meyering
48f3bca87e Move prototypes after struct declarations.
Remove prototypes for xmalloc, xrealloc.
(new_control_record): Cast arg 1 to realloc.
1995-11-05 13:12:54 +00:00
Jim Meyering
adf0ec7008 Protoize. 1995-11-05 13:02:44 +00:00
Jim Meyering
5b4dde5a7b [__P]: Test PROTOTYPES, not __STDC__.
Protoize.
1995-11-05 12:59:52 +00:00
Jim Meyering
2224409994 (close_output_file): Set output_stream to NULL so we don't recurse
endlessly between this function and cleanup.
1995-11-05 05:51:53 +00:00
Jim Meyering
30d11429a9 (unquote): Add casts to avoid signed char* from/to char* warnings. 1995-11-05 05:48:57 +00:00
Jim Meyering
c4176dd559 . 1995-11-03 20:03:44 +00:00
Jim Meyering
47d5042d1e . 1995-11-03 20:03:18 +00:00
Jim Meyering
6df632b672 New version from glibc. 1995-11-03 20:02:00 +00:00
Jim Meyering
6875b205d6 (remove_file, remove_dir): Use euidaccess instead of euidaccess_stat.Likewise. 1995-11-03 20:01:13 +00:00
Jim Meyering
47306242ec (do_move): Use euidaccess instead of euidaccess_stat.Likewise. 1995-11-03 20:00:24 +00:00
Jim Meyering
83780d95f0 (copy): Use euidaccess instead of euidaccess_stat. 1995-11-03 19:59:44 +00:00
Jim Meyering
5b804afa6a New version from glibc. 1995-11-03 19:56:08 +00:00
Jim Meyering
83b9d5e9ef Add `const' attribute to some parameters. 1995-11-02 17:11:51 +00:00
Jim Meyering
a2b0b9846d . 1995-11-02 17:11:17 +00:00
Jim Meyering
a0ad16498b . 1995-11-02 17:11:04 +00:00
Jim Meyering
aa084c8407 Protoize. 1995-11-02 17:08:24 +00:00
Jim Meyering
ac821ab1ef Reorder functions to obviate forward dcls.
Remove forward dcls.
1995-11-02 17:06:52 +00:00
Jim Meyering
6e146d4216 (isdigits, convint): Remove these.
(main): Use xstrtol instead.
1995-10-31 12:52:29 +00:00
Jim Meyering
e4a96fff58 . 1995-10-31 12:52:14 +00:00
Jim Meyering
aa6cde5ca1 Add `const' attribute to some parameters. 1995-10-31 12:39:18 +00:00
Jim Meyering
05a5e42609 protoize. 1995-10-31 12:36:43 +00:00
Jim Meyering
11a013bf87 Reorder functions to obviate forward dcls.
Remove forward dcls.
1995-10-31 12:34:48 +00:00
Jim Meyering
de4de17bc5 (usage, next_line_num, main): Protoize. 1995-10-31 02:22:23 +00:00
Jim Meyering
b0302bb3a6 Add `const' attribute to some parameters. 1995-10-31 02:21:37 +00:00
Jim Meyering
334f8dcbb7 Add `const' attribute to some parameters. 1995-10-31 02:21:13 +00:00
Jim Meyering
47eaf4a1e8 Protoize. 1995-10-30 21:01:35 +00:00
Jim Meyering
1e30b2f8c4 Reorder functions to obviate forward dcls.
Remove forward dcls.
1995-10-30 21:00:36 +00:00
Jim Meyering
84df8be864 (eaccess_stat): Make static. 1995-10-30 18:00:05 +00:00
Jim Meyering
f05befc26c (copy): Update one of the calls to eaccess_stat to use 3 arguments. Ugh! 1995-10-30 17:53:48 +00:00
Jim Meyering
96e22ecc78 . 1995-10-29 20:44:54 +00:00
Jim Meyering
9eb195d6a5 . 1995-10-29 20:44:14 +00:00
Jim Meyering
40f0f4d2e8 (xwrite): Give output buffer parameter const attribute.
(output): Likewise for both parameters.
(tac): Likewise for file name parameter.
(tac_file): Likewise.
1995-10-29 20:38:01 +00:00
Jim Meyering
4fa07774d6 protoize. 1995-10-29 20:35:11 +00:00
Jim Meyering
7567c84e76 Reorder functions to obviate forward dcls.
Remove forward dcls.
1995-10-29 20:33:04 +00:00
Jim Meyering
a87c771012 (bsd_sum_file): Give file name parameter const attribute.
(sysv_sum_file): Likewise.
1995-10-29 20:24:53 +00:00
Jim Meyering
a2535fc95f Protoize. 1995-10-29 20:20:08 +00:00
Jim Meyering
d2aaf842b4 (main): Move function body to end of file.
Remove forward dcls.
1995-10-29 20:19:26 +00:00
Jim Meyering
13e93efe91 (nl_file): Give parameter const attribute.
Protoize.
1995-10-29 20:15:54 +00:00
Jim Meyering
af1033c63c Reorder functions to obviate forward dcls.
Remove forward dcls.
1995-10-29 20:12:32 +00:00
Jim Meyering
768f92072f (main): Move function body to end of file.
Remove forward dcls and protoize.
1995-10-29 20:05:29 +00:00
Jim Meyering
8b92864e1d Rename --file to --reference.
Leave --file as an alias, for now.  It will be removed later.
(usage): Update, but don't mention --file.
1995-10-29 19:29:19 +00:00
Jim Meyering
d97d668b69 . 1995-10-29 19:28:59 +00:00
Jim Meyering
5d1c0a2af5 . 1995-10-29 19:21:08 +00:00
Jim Meyering
b1c9ce6621 [TEST_STANDALONE]: Define. 1995-10-29 19:20:36 +00:00
Jim Meyering
aec547d764 . 1995-10-29 19:20:12 +00:00
Jim Meyering
185c59d3bd (mostlyclean): Remove *.info. 1995-10-29 14:26:48 +00:00
Jim Meyering
f1c5cfd5f2 (distclean): Remove .deps. 1995-10-29 14:23:11 +00:00
Jim Meyering
c848009e29 . 1995-10-29 14:22:15 +00:00
Jim Meyering
a0d766c204 . 1995-10-29 14:20:13 +00:00
Jim Meyering
c1f248d670 (INCLUDE, COMPILE): New variables.
(.c.o): Rewrite to be more like src/Makefile.in.
Add line that (--with-autodeps) will include mkdep-Makefile.
1995-10-29 12:14:37 +00:00
Jim Meyering
9b1d63b4a3 . 1995-10-28 21:07:18 +00:00
Jim Meyering
c7262bbe86 *** empty log message *** 1995-10-28 21:04:08 +00:00
Jim Meyering
008028896b . 1995-10-28 21:02:57 +00:00
Jim Meyering
c5716550a6 (md5_check): Use the same message format when the single file has a
read error or checksum mismatch as when there are more.
Write diagnostic to stderr, not stdout.
1995-10-28 21:01:01 +00:00
Jim Meyering
b43f5fb25b . 1995-10-28 05:55:34 +00:00
Jim Meyering
013277d331 New option --reference=FILE (-r FILE) analogous to the
like-named touch option.
(main): Recognize it and give diagnostic for misuse.
(usage): Describe briefly.
From Franc,ois Pinard.

(batch_convert): Close input stream also when it's not stdin.
(main): Reorganize to do option-consistency checks before all else.
1995-10-28 05:52:24 +00:00
Jim Meyering
09eedba01f . 1995-10-28 05:51:44 +00:00
Jim Meyering
ca59b76b50 (batch_convert): Close input stream also when it's not stdin. 1995-10-27 15:12:31 +00:00
Jim Meyering
b9485b8d52 (main): Use xfopen, not xtmpopen to open final output file. 1995-10-26 13:20:25 +00:00
Jim Meyering
66b9285a6f (xtmpfopen): New function -- for opening temp files.
Use it instead of xfopen.
1995-10-26 13:19:10 +00:00
Jim Meyering
470e773e76 . 1995-10-26 05:14:53 +00:00
Jim Meyering
039942bfc1 (xfopen): Rewrite using open/fdopen in order to set
proper permissions on temporary files.  Reported by Erik Corry
(erik@kroete2.freinet.de).
1995-10-26 05:14:41 +00:00
Jim Meyering
a94e341d85 . 1995-10-24 04:24:06 +00:00
Jim Meyering
db98ca11cf . 1995-10-24 04:17:33 +00:00
Jim Meyering
22a5274de9 . 1995-10-21 12:52:05 +00:00
Jim Meyering
2ee6cf8ea0 . 1995-10-21 12:50:56 +00:00
Jim Meyering
baf81e4974 . 1995-10-20 04:29:00 +00:00
Jim Meyering
bda4a5e5b7 (BEGIN_STATE): Use INT_MAX - 1 so as not to interfere with large repeat counts.
(struct E_string): New struct.

(find_closing_delim): Take E_string arg rather than char* and length.
(find_bracketed_repeat): Likewise.
(star_digits_closebracket): New function.

(append_char_class): No longer give diagnostic.
(append_equiv_class): No longer give diagnostic.
(build_spec_list): Give them here instead, allowing things like [:*][:upper:]
that got errors before.
Take E_string arg rather than char*.
Convert switch stmts into if-then so as to use ES_MATCH.
1995-10-20 04:26:56 +00:00
Jim Meyering
0598102472 . 1995-10-19 22:40:10 +00:00
Jim Meyering
4aba8a55f2 . 1995-10-19 22:39:16 +00:00
Jim Meyering
6f6a35a9a1 Indent cpp directives. 1995-10-19 22:38:39 +00:00
Jim Meyering
d691ea7ebc (build_spec_list): Propagate interface change.
(parse_str): Likewise.
1995-10-19 15:42:45 +00:00
Jim Meyering
ca63ca90ab (struct E_string): Define.
(unquote): Convert string to E_string instead of overwriting input.
Backslash-escaped non-special characters are marked as quoted in E_string.
(build_spec_list): Convert outer switch stmt to an if-stmt.
(parse_str): Update sole caller of unquote.
1995-10-19 15:33:33 +00:00
Jim Meyering
43dd57eba9 New version from FSF. 1995-10-19 14:21:35 +00:00
Jim Meyering
6dd358e12d Break lines longer than 79-80 chars. 1995-10-19 13:29:34 +00:00
Jim Meyering
c73aa6b629 . 1995-10-19 04:10:45 +00:00
Jim Meyering
63b348b3a9 Use HAVE_SYS_WAIT_H, not _POSIX_VERSION in conditional
inclusion of sys/wait.h.
[endgrent]: Test !HAVE_ENDGRENT rather than _POSIX_SOURCE.
[endpwent]: Test !HAVE_ENDPWENT rather than _POSIX_SOURCE.
1995-10-18 22:05:29 +00:00
Jim Meyering
6181f175e3 Use HAVE_SYS_IOCTL_H, rather than !_POSIX_SOURCE || _AIX. 1995-10-18 22:05:06 +00:00
Jim Meyering
5a52e61271 (duplicate_entry): Always return 0 if !D_INO_IN_DIRENT, rather than
if _POSIX_SOURCE
1995-10-18 17:02:07 +00:00
Jim Meyering
e74c290ac7 . 1995-10-18 16:33:52 +00:00
Jim Meyering
5ea57c875d . 1995-10-18 16:28:14 +00:00
Jim Meyering
492b177ca5 (main): Fail if the same file system type was both selected and excluded. 1995-10-18 16:11:58 +00:00
Jim Meyering
daa976fff6 [endgrent]: Test !HAVE_ENDGRENT rather than _POSIX_SOURCE. 1995-10-18 16:08:13 +00:00
Jim Meyering
871d176f15 [endpwent]: Test !HAVE_ENDPWENT rather than _POSIX_SOURCE.
[endgrent]: Remove unused definition.
1995-10-18 16:07:44 +00:00
Jim Meyering
fc2e23b1ad [HAVE_ENDGRENT]: Define away endgrent.
[HAVE_ENDPWENT]: Define away endpwent.
1995-10-18 15:59:12 +00:00
Jim Meyering
1cde2ceb5c Use _POSIX_VERSION, not _POSIX_SOURCE. 1995-10-18 15:57:50 +00:00
Jim Meyering
539457f1ae Merge latest change from FSF. 1995-10-18 14:31:14 +00:00
Jim Meyering
b6ff24fb7f Get latest from FSF. 1995-10-18 14:29:16 +00:00
Jim Meyering
da20dc044a . 1995-10-18 03:48:29 +00:00
Jim Meyering
a42c7fe2d1 Prootize. 1995-10-18 03:45:44 +00:00
Jim Meyering
b792f7aa0e Add `const' attribute to dcls of lots of formals. 1995-10-17 14:01:00 +00:00
Jim Meyering
9242af95a3 Protoize. 1995-10-17 13:49:32 +00:00
Jim Meyering
9583179c1b Protoize. 1995-10-17 13:47:48 +00:00
Jim Meyering
d9dee002e6 Reorder functions to obviate forward dcls. Remove forward dcls. 1995-10-17 13:43:00 +00:00
Jim Meyering
434b809272 Reorder functions to obviate forward dcls. Remove forward dcls. 1995-10-17 13:39:44 +00:00
Jim Meyering
4feb3b1e06 Protoize. Reorder functions to obviate forward dcls. Remove forward dcls. 1995-10-17 13:35:26 +00:00
Jim Meyering
14390d1fed Protoize. Reorder functions to obviate forward dcls.
Remove forward dcls.
1995-10-17 13:13:19 +00:00
Jim Meyering
8831ffbec4 Protoize.
Reorder functions to obviate forward dcls.
Remove forward dcls.
1995-10-16 21:30:25 +00:00
Jim Meyering
45d4def5e4 Move struct dcls to precede dcls of file-scope variables.
(monthtab, keyhead): Separate variable dcls from type dcls.
1995-10-16 14:45:09 +00:00
Jim Meyering
b9c1393e5f (usage): Move function definition to precede uses and
remove remove forward dcl.
Protoize and add `const' attribute to dcls of lots of formals.
1995-10-16 14:38:11 +00:00
Jim Meyering
c5bf4b6c9c . 1995-10-14 01:39:01 +00:00
Jim Meyering
3ac64eda17 (prjoin): Handle case in which file spec is 0.
(add_field): Update assertions.
(decode_field_spec): For S == "0", set file spec to zero and don't modify
*FIELD_INDEX.  Otherwise, *FIELD_INDEX gets the zero-based index.
1995-10-13 17:22:58 +00:00
Jim Meyering
148f37c34e Add tests to exercize -o 0. 1995-10-13 17:16:48 +00:00
Jim Meyering
9845d179b3 (prjoin): Rewrite loop that iterates over field specs. 1995-10-13 13:16:34 +00:00
Jim Meyering
11b87d29cc (add_field_list): Allow SPACE and TAB as well as `,' as list item separators. 1995-10-12 21:42:52 +00:00
Jim Meyering
bc7210e563 Remove bogus FIXME. 1995-10-12 04:08:35 +00:00
Jim Meyering
e1ab53f969 . 1995-10-09 13:59:55 +00:00
Jim Meyering
790196a645 . 1995-10-09 13:59:25 +00:00
Jim Meyering
b5c8c81d4d Indent cpp directives to reflect nesting. 1995-10-09 03:48:08 +00:00
Jim Meyering
91a709b210 Modified from glibc copy. 1995-10-09 03:46:41 +00:00
Jim Meyering
5e25ee19e4 (SOURCES): Add strpbrk.c..
Remove bcopy.c.
1995-10-09 03:42:21 +00:00
Jim Meyering
70390f60ec . 1995-10-09 03:42:11 +00:00
Jim Meyering
c22889019c . 1995-10-08 04:02:09 +00:00
Jim Meyering
06ea91f2f3 (main): Close input files. 1995-10-08 04:02:00 +00:00
Jim Meyering
3c7699600f Add alloca junk. 1995-10-08 03:38:09 +00:00
Jim Meyering
c8c90bb532 . 1995-10-08 03:30:22 +00:00
Jim Meyering
6f63d53e1b (add_field): No longer return a value.
(decode_field_spec): New function.
(add_field_list): Rewrite to be more strict about what is accepted.
Before, `,1.2' was accepted as valid.
(main): Use xstrtol instead atoi.
Combine nearly identical -a and -v cases.
1995-10-08 03:28:21 +00:00
Jim Meyering
cd1dbbcfc1 . 1995-10-06 19:23:31 +00:00
Jim Meyering
4bbadbb14a . 1995-10-06 02:55:44 +00:00
Jim Meyering
cc61df7131 Include limits.h.
[!INT_MAX]: Define it.
1995-10-06 02:55:14 +00:00
Jim Meyering
965c0bf39d [!HAVE_UTIME_H]: Don't declare struct utimbuf here.
[!HAVE_STRUCT_UTIMBUF]: Declare struct utimbuf here instead.
1995-10-06 02:53:42 +00:00
Jim Meyering
6fc3c211ec . 1995-10-06 02:51:04 +00:00
Jim Meyering
c25dcdd843 (read_filesystem_list): Cast -1 to dev_t before assignment. 1995-10-05 14:14:45 +00:00
Jim Meyering
e387fd1471 (show_point): Cast -2 to dev_t before assignment. 1995-10-05 14:12:29 +00:00
Jim Meyering
1c7bc6028a protoize 1995-10-04 21:21:23 +00:00
Jim Meyering
74f061de82 Remove forward dcl of usage. 1995-10-04 21:20:40 +00:00
Jim Meyering
47b91b8948 (usage): Move to precede all other functions. 1995-10-04 21:19:28 +00:00
Jim Meyering
2d73c959cc (main): Report `too few/many non-option arguments' then print --help
output rather than just the latter.
Properly interpret obsolescent usage like `join -o 2.1 2.1 2.2'.
(usage): Describe POSIX -1, -2 options and deprecate -j* ones
1995-10-04 21:17:43 +00:00
Jim Meyering
9a17340b10 . 1995-10-04 03:46:43 +00:00
Jim Meyering
a9de4d485a Test SA_INTERRUPT, not _POSIX_VERSION,
to determine whether `sigaction' functions are available.
Reported by Paul Nevai <nevai@ops.mps.ohio-state.edu>.
Fix suggested by Karl Berry.
1995-10-04 03:46:35 +00:00
Jim Meyering
111cb717e8 (set_fields): Use memset (not open coded loop) to initialize array. 1995-10-03 20:28:44 +00:00
Jim Meyering
6a45f61547 Convert a lot of int' types to unsigned int' to avoid warnings from
`gcc -Wall' about comparing signed and unsigned types.
1995-10-03 20:21:32 +00:00
Jim Meyering
026d10d369 (main): Declare counter, N_STRINGS, to be an integral type, not `char'. 1995-10-03 20:18:39 +00:00
Jim Meyering
d832bf77eb Correct typos, mostly from Jens Schweikhardt. 1995-10-03 19:05:47 +00:00
Jim Meyering
de97a7099c .c 1995-10-01 22:50:25 +00:00
Jim Meyering
1d15980fb6 Remove trailing whitespace. 1995-10-01 22:49:07 +00:00
Jim Meyering
b3303ba072 Declare stat, xstat. 1995-10-01 22:40:11 +00:00
Jim Meyering
eddb25aa26 Declare stat, xstat. 1995-10-01 20:17:25 +00:00
Jim Meyering
40c6966137 (SOURCES): Add strtoul. 1995-10-01 19:02:29 +00:00
Jim Meyering
4de6eab547 (get_fs_usage) [STATFS_TRUNCATES_BLOCK_COUNTS]: Copy untruncated block
counts from f_spare array into proper members of struct statfs.
From Eirik Fuller (eirik@netapp.com);
1995-10-01 18:23:29 +00:00
Jim Meyering
caa2df2274 . 1995-09-29 04:50:31 +00:00
Jim Meyering
4c8c0b69ba . 1995-09-29 04:49:08 +00:00
Jim Meyering
527d04d44b (dired_dump_obstack): Don't generate any output if the obstack is empty.
(main): Always initialize and dump subdired_obstack, not just if -R.
`ls -lDR dir dir2' was using uninitialized subdired_obstack.
Reported by Samuli K{rkk{inen <hskarkka@snakemail.hut.fi>.
1995-09-29 04:09:22 +00:00
Jim Meyering
9a12d05216 (decode_one_format): Remove spurious semicolon. 1995-09-27 15:58:18 +00:00
Jim Meyering
77c46a6b42 . 1995-09-27 04:06:28 +00:00
Jim Meyering
744393f0f4 (show_point): Ignore mtab entries with either
nonexistent mount points or with inconsistent device number.
From Eirik Fuller <eirik@synopsys.com>.
1995-09-26 04:18:55 +00:00
Jim Meyering
6f200d7982 . 1995-09-25 04:14:36 +00:00
Jim Meyering
12e85d31e2 Protoize. 1995-09-24 13:36:13 +00:00
Jim Meyering
17821cc15e [REL_ALLOC]: #ifdef-out dcls of unused variables. 1995-09-23 20:55:02 +00:00
Jim Meyering
0bcd6e68a9 . 1995-09-23 20:46:22 +00:00
Jim Meyering
528390fa58 (print_kth): Change order of args in compare, and reverse sense of comparison
(Hence, no semantic change).
1995-09-23 20:42:52 +00:00
Jim Meyering
a719a87508 Merge in changes for ConvexOS 11.0. 1995-09-23 20:28:39 +00:00
Jim Meyering
a1fa4eff25 New version from FSF. 1995-09-23 20:28:10 +00:00
Jim Meyering
f344b7fab6 (md5_check): Distinguish between open/read failure and checksum mismatch. 1995-09-23 20:22:05 +00:00
Jim Meyering
eca98f76ac . 1995-09-23 20:21:22 +00:00
Jim Meyering
f30618bac7 . 1995-09-23 20:09:52 +00:00
Jim Meyering
dc4a18b537 . 1995-09-23 19:56:32 +00:00
Jim Meyering
9801e9cde1 Update to reflect changes in md5sum.c.
Add FIXME with Karl's comm suggestion.
1995-09-21 18:17:14 +00:00
Jim Meyering
1b16c152bd (main): Reverse order of check' and compute sums' blocks in if-else
chain to make it a little more readable.
1995-09-20 12:47:37 +00:00
Jim Meyering
3ed71a2fdd . 1995-09-19 14:30:59 +00:00
Jim Meyering
0e15d57a89 Rewrite confusing comment. 1995-09-19 12:59:49 +00:00
Jim Meyering
c253d247ca (checkfp): Rearrange loop to avoid duplicate test.
Move a couple dcls from function scope into inner block.
1995-09-19 12:50:34 +00:00
Jim Meyering
656fac3d80 . 1995-09-19 12:48:46 +00:00
Jim Meyering
dde2c138e9 Protoize. 1995-09-18 12:44:47 +00:00
Jim Meyering
7823351d6b (main, usage): Remove -h, -s, -v short options.
Rename --verbose to --warn, --quiet to --status.
(main): Handle --help and --version using parse_long_options.
(md5_check): Check ferror.
1995-09-18 12:36:12 +00:00
Jim Meyering
b23b6bbcf7 (tempname): Replace `16' with a more readable expansion.
Make sure that SEQ never exceeds 99999.
1995-09-14 13:31:52 +00:00
Jim Meyering
800e219a2d (sort): Rename local: ntemp -> n_temp_files, to avoid confusion
with another local, ntmp.
1995-09-14 13:09:27 +00:00
Jim Meyering
ecf0d31b72 Fix typo in comment. 1995-09-13 13:15:35 +00:00
Jim Meyering
c3f476d467 . 1995-08-11 06:26:39 +00:00
Jim Meyering
7f3e86b27b . 1995-08-11 06:26:12 +00:00
Jim Meyering
b0453a43c0 (main) [handling --string option]: Don't output nonstandard `b' binary flag. 1995-08-10 21:11:24 +00:00
236 changed files with 43994 additions and 16324 deletions

224
ABOUT-NLS Normal file
View File

@@ -0,0 +1,224 @@
Notes on the GNU Translation Project
************************************
GNU is going international! The GNU Translation Project is a way to
get maintainers, translators, and users all together, so that GNU will
gradually become able to speak many languages. A few packages already
provide translations for their messages.
If you found this `ABOUT-NLS' file inside a GNU distribution, you
may assume that the distributed package does use GNU `gettext'
internally, itself available at your nearest GNU archive site. But you
do *not* need to install GNU `gettext' prior to configuring, installing
or using this package with messages translated.
Installers will find here some useful hints. These notes also
explain how users should proceed for getting the programs to use the
available translations. They tell how people wanting to contribute and
work at translations should contact the appropriate team.
When reporting bugs in the `intl/' directory or bugs which may be
related to internationalization, you should tell about the version of
`gettext' which is used. The information can be found in the
`intl/VERSION' file, in internationalized packages.
One advise in advance
=====================
If you want to exploit the full power of internationalization, you
should configure it using
./configure --with-included-gettext
to force usage of internationalizing routines provided within this
package, despite the existence of internationalizing capabilities in
the operating system where this package is being installed. So far, no
prior implementation provides as many useful features (such as locale
alias or message inheritance). It is also not possible to offer this
additional functionality on top of a `catgets' implementation. Future
versions of GNU `gettext' will very likely convey even more
functionality. So it might be a good idea to change to GNU `gettext'
as soon as possible.
INSTALL Matters
===============
Some GNU packages are "localizable" when properly installed; the
programs they contain can be made to speak your own native language.
Most such packages use GNU `gettext'. Other packages have their own
ways to internationalization, predating GNU `gettext'.
By default, this package will be installed to allow translation of
messages. It will automatically detect whether the system provides
usable `catgets' (if using this is selected by the installer) or
`gettext' functions. If neither is available, the GNU `gettext' own
library will be used. This library is wholly contained within this
package, usually in the `intl/' subdirectory, so prior installation of
the GNU `gettext' package is *not* required. Installers may use
special options at configuration time for changing the default
behaviour. The commands:
./configure --with-included-gettext
./configure --with-catgets
./configure --disable-nls
will respectively bypass any pre-existing `catgets' or `gettext' to use
the internationalizing routines provided within this package, enable
the use of the `catgets' functions (if found on the locale system), or
else, *totally* disable translation of messages.
When you already have GNU `gettext' installed on your system and run
configure without an option for your new package, `configure' will
probably detect the previously built and installed `libintl.a' file and
will decide to use this. This might be not what is desirable. You
should use the more recent version of the GNU `gettext' library. I.e.
if the file `intl/VERSION' shows that the library which comes with this
package is more recent, you should use
./configure --with-included-gettext
to prevent auto-detection.
By default the configuration process will not test for the `catgets'
function and therefore they will not be used. The reasons are already
given above: the emulation on top of `catgets' cannot provide all the
extensions provided by the GNU `gettext' library. If you nevertheless
want to use the `catgets' functions use
./configure --with-catgets
to enable the test for `catgets' (this causes no harm if `catgets' is
not available on your system). If you really select this option we
would like to hear about the reasons because we cannot think of any
good one ourself.
Internationalized packages have usually many `po/LL.po' files, where
LL gives an ISO 639 two-letter code identifying the language. Unless
translations have been forbidden at `configure' time by using the
`--disable-nls' switch, all available translations are installed
together with the package. However, the environment variable `LINGUAS'
may be set, prior to configuration, to limit the installed set.
`LINGUAS' should then contain a space separated list of two-letter
codes, stating which languages are allowed.
Using This Package
==================
As a user, if your language has been installed for this package, you
only have to set the `LANG' environment variable to the appropriate
ISO 639 `LL' two-letter code prior to using the programs in the
package. For example, let's suppose that you speak German. At the
shell prompt, merely execute `setenv LANG de' (in `csh'),
`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This
can be done from your `.login' or `.profile' file, once and for all.
An operating system might already offer message localization for
many of its programs, while other programs (whether GNU or not) have
been installed locally with the full capabilities of GNU `gettext'.
Just using `gettext' extended syntax for `LANG' would break proper
localization of already available operating system programs. In this
case, users should set both `LANGUAGE' and `LANG' variables in their
environment, as programs using GNU `gettext' give preference to
`LANGUAGE'. For example, some Swedish users would rather read
translations in German than English for when Swedish is not available.
This is easily accomplished by setting `LANGUAGE' to `sv:de' while
leaving `LANG' to `sv'.
Translating Teams
=================
For the GNU Translation Project to be a success, we need interested
people who like their own language and write it well, and who are also
able to synergize with other translators speaking the same language.
Each translation team has its own mailing list, courtesy of Linux
International. You may reach your translation team at the address
`LL@li.org', replacing LL by the two-letter ISO 639 code for your
language. Language codes are *not* the same as the country codes given
in ISO 3166. The following translation teams exist, as of October 1996:
Arabic `ar', Chinese `zh', Czech `cs', Danish `da', Dutch `nl',
English `en', Esperanto `eo', Finnish `fi', French `fr', German
`de', Greek `el', Hebrew `he', Hungarian `hu', Irish `ga', Italian
`it', Indonesian `id', Japanese `ja', Korean `ko', Latin `la',
Norwegian `no', Persian `fa', Polish `pl', Portuguese `pt',
Russian `ru', Slovenian `sl', Spanish `es', Swedish `sv', Telugu
`te', Turkish `tr' and Ukrainian `uk'.
For example, you may reach the Chinese translation team by writing to
`zh@li.org'.
If you'd like to volunteer to *work* at translating messages, you
should become a member of the translating team for your own language.
The subscribing address is *not* the same as the list itself, it has
`-request' appended. For example, speakers of Swedish can send a
message to `sv-request@li.org', having this message body:
subscribe
Keep in mind that team members are expected to participate
*actively* in translations, or at solving translational difficulties,
rather than merely lurking around. If your team does not exist yet and
you want to start one, or if you are unsure about what to do or how to
get started, please write to `gnu-translation@gnu.ai.mit.edu' to reach
the GNU coordinator for all translator teams.
The English team is special. It works at improving and uniformizing
the terminology used in GNU. Proven linguistic skill are praised more
than programming skill, here. For the time being, please avoid
subscribing to the English team unless explicitly invited to do so.
Available Packages
==================
Languages are not equally supported in all GNU packages. The
following matrix shows the current state of GNU internationalization,
as of October 1996. The matrix shows, in regard of each package, for
which languages PO files have been submitted to translation
coordination.
cs de en es fi fr ja ko nl no pl pt sl sv
.-------------------------------------------.
bash | [] [] | 2
bison | [] [] [] | 3
clisp | [] [] [] | 3
cpio | [] [] [] [] | 4
diffutils | [] [] [] [] | 4
enscript | [] [] [] [] [] | 5
fileutils | [] [] [] [] [] [] [] [] | 8
findutils | [] [] [] [] [] [] | 6
flex | [] | 1
gcal | [] [] [] | 3
gettext | [] [] [] [] [] [] [] [] [] [] | 11
grep | [] [] [] [] [] [] [] [] | 8
hello | [] [] [] [] [] [] [] [] [] [] | 10
id-utils | [] [] | 2
libc | [] [] [] [] [] [] | 6
m4 | [] [] [] [] [] | 5
make | [] [] [] [] | 4
music | [] | 1
ptx | [] [] [] [] [] [] [] | 7
recode | [] [] [] [] [] [] [] | 7
sh-utils | [] [] [] [] [] | 5
sharutils | [] [] [] [] | 4
tar | [] [] [] [] [] [] [] [] [] | 9
texinfo | | 0
textutils | [] [] [] [] [] [] | 6
wdiff | [] [] [] [] [] [] [] [] | 8
`-------------------------------------------'
cs de en es fi fr ja ko nl no pl pt sl sv
1 20 1 9 1 24 1 8 20 7 14 6 7 13 132
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
used for implementing regional variants of languages, or language
dialects.
For a PO file in the matrix above to be effective, the package to
which it applies should also have been internationalized and
distributed as such by its maintainer. There might be an observable
lag between the mere existence a PO file and its wide availability in a
GNU distribution.
If October 1996 seems to be old, you may fetch a more recent copy of
this `ABOUT-NLS' file on most GNU archive sites.

View File

@@ -2,7 +2,7 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -304,8 +304,8 @@ the "copyright" line and a pointer to where the full notice is found.
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., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Also add information on how to contact you by electronic and paper mail.

250
INSTALL
View File

@@ -1,111 +1,181 @@
This is a generic INSTALL file for utilities distributions.
If this package does not come with, e.g., installable documentation or
data files, please ignore the references to them below.
Basic Installation
==================
To compile this package:
These are generic installation instructions.
1. Configure the package for your system. In the directory that this
file is in, type `./configure'. If you're using `csh' on an old
version of System V, you might need to type `sh configure' instead to
prevent `csh' from trying to execute `configure' itself.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation, and
creates the Makefile(s) (one in each subdirectory of the source
directory). In some packages it creates a C header file containing
system-dependent definitions. It also creates a file `config.status'
that you can run in the future to recreate the current configuration.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
Running `configure' takes a minute or two. While it is running, it
prints some messages that tell what it is doing. If you don't want to
see the messages, run `configure' with its standard output redirected
to `/dev/null'; for example, `./configure >/dev/null'.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
To compile the package in a different directory from the one
containing the source code, you must use a version of make that
supports the VPATH variable, such as GNU make. `cd' to the directory
where you want the object files and executables to go and run
`configure'. `configure' automatically checks for the source code in
the directory that `configure' is in and in `..'. If for some reason
`configure' is not in the source code directory that you are
configuring, then it will report that it can't find the source code.
In that case, run `configure' with the option `--srcdir=DIR', where
DIR is the directory that contains the source code.
The simplest way to compile this package is:
By default, `make install' will install the package's files in
/usr/local/bin, /usr/local/lib, /usr/local/man, etc. You can specify
an installation prefix other than /usr/local by giving `configure' the
option `--prefix=PATH'. Alternately, you can do so by giving a value
for the `prefix' variable when you run `make', e.g.,
make prefix=/usr/gnu
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If
you give `configure' the option `--exec_prefix=PATH' or set the
`make' variable `exec_prefix' to PATH, the package will use PATH as
the prefix for installing programs and libraries. Data files and
documentation will still use the regular prefix. Normally, all files
are installed using the regular prefix.
Running `configure' takes a while. While running, it prints some
messages telling which features it is checking for.
You can tell `configure' to figure out the configuration for your
system, and record it in `config.status', without actually configuring
the package (creating `Makefile's and perhaps a configuration header
file). To do this, give `configure' the `--no-create' option. Later,
you can run `./config.status' to actually configure the package. This
option is useful mainly in `Makefile' rules for updating `config.status'
and `Makefile'. You can also give `config.status' the `--recheck'
option, which makes it re-run `configure' with the same arguments you
used before. This is useful if you change `configure'.
2. Type `make' to compile the package.
`configure' ignores any other arguments that you give it.
3. Optionally, type `make check' to run any self-tests that come with
the package.
If your system requires unusual options for compilation or linking
that `configure' doesn't know about, you can give `configure' initial
values for some variables by setting them in the environment. In
Bourne-compatible shells, you can do that on the command line like
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC='gcc -traditional' DEFS=-D_POSIX_SOURCE ./configure
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
The `make' variables that you might want to override with environment
variables when running `configure' are:
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
(For these variables, any value given in the environment overrides the
value that `configure' would choose:)
CC C compiler program.
Default is `cc', or `gcc' if `gcc' is in your PATH.
INSTALL Program to use to install files.
Default is `install' if you have it, `cp' otherwise.
Compiling For Multiple Architectures
====================================
(For these variables, any value given in the environment is added to
the value that `configure' chooses:)
DEFS Configuration options, in the form `-Dfoo -Dbar ...'
LIBS Libraries to link with, in the form `-lfoo -lbar ...'
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you need to do unusual things to compile the package, we encourage
you to figure out how `configure' could check whether to do them, and
mail diffs or instructions to the address given in the README so we
can include them in the next release.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
2. Type `make' to compile the package. If you want, you can override
the `make' variables CFLAGS and LDFLAGS like this:
Installation Names
==================
make CFLAGS=-O2 LDFLAGS=-s
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
3. If the package comes with self-tests and you want to run them,
type `make check'. If you're not sure whether there are any, try it;
if `make' responds with something like
make: *** No way to make target `check'. Stop.
then the package does not come with self-tests.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
4. Type `make install' to install programs, data files, and
documentation.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
5. You can remove the program binaries and object files from the
source directory by typing `make clean'. To also remove the
Makefile(s), the header file containing system-dependent definitions
(if the package uses one), and `config.status' (all the files that
`configure' created), type `make distclean'.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made.
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.
The file `configure.in' is used as a template to create `configure' by
a program called `autoconf'. You will only need it if you want to
regenerate `configure' using a newer version of `autoconf'.

13
THANKS Normal file
View File

@@ -0,0 +1,13 @@
This is just a start at listing e-mail addresses of contributors.
The rest of the addresses are still in the ChangeLog.
Bauke Jan Douma: bjdouma@xs4all.nl
Charles Karney: karney@pppl.gov
Emile LeBlanc: leblanc@math.toronto.edu
Marcus Daniels: marcus@sysc.pdx.edu
Mark A. Thomas: thommark@access.digex.net
Miles Bader: miles@gnu.ai.mit.edu
Peter Eriksson: peter@ifm.liu.se
Santiago Vila Doncel: sanvila@ctv.es
Thomas Bushnell, n/BSG: thomas@gnu.ai.mit.edu
Tony Leneis: tony@plaza.ds.adp.com

View File

@@ -1,6 +1,7 @@
Makefile
fileutils.info
version.texi
fileutils.info*
fileutils.log
fileutils.dvi
fileutils.aux
@@ -15,3 +16,5 @@ fileutils.cm
fileutils.fl
fileutils.op
fileutils.cps
stamp-vti
version.texi

12
doc/Makefile.am Normal file
View File

@@ -0,0 +1,12 @@
## Process this file with automake to produce Makefile.in
info_TEXINFOS = fileutils.texi
# FIXME: remove texinfo.tex when automake has been fixed to include it
# automatically
EXTRA_DIST = perm.texi getdate.texi texinfo.tex
# Tell makeinfo to put everything in a single info file: sh-utils.info.
# Otherwise, it would also generate files with names like sh-utils.info-[123],
# and those names all map to one 14-byte name (sh-utils.info-) on some crufty
# old systems.
MAKEINFO = makeinfo --no-split

View File

@@ -1,103 +1,260 @@
# Makefile for GNU file utilities documentation.
# Copyright (C) 1994, 1995 Free Software Foundation, Inc.
# Makefile.in generated automatically by automake 1.1l from Makefile.am
# 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.
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
SHELL = /bin/sh
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
YACC = @YACC@
GENCAT = @GENCAT@
PERL = @PERL@
MV = @MV@
GMSGFMT = @GMSGFMT@
CC = @CC@
RANLIB = @RANLIB@
LN = @LN@
RM = @RM@
prefix = @prefix@
infodir = $(prefix)/info
info_TEXINFOS = fileutils.texi
# FIXME: remove texinfo.tex when automake has been fixed to include it
# automatically
EXTRA_DIST = perm.texi getdate.texi texinfo.tex
# Tell makeinfo to put everything in a single info file: sh-utils.info.
# Otherwise, it would also generate files with names like sh-utils.info-[123],
# and those names all map to one 14-byte name (sh-utils.info-) on some crufty
# old systems.
MAKEINFO = makeinfo --no-split
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
TEXI2DVI = texi2dvi
INFO_DEPS = fileutils.info
DVIS = fileutils.dvi
TEXINFOS = fileutils.texi
DIST_COMMON = Makefile.am Makefile.in mdate-sh stamp-vti texinfo.tex \
version.texi
PACKAGE = @PACKAGE@
VERSION = @VERSION@
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) \
$(TEXINFOS) $(MANS) $(EXTRA_DIST)
TAR = tar
default: all
.SUFFIXES:
.SUFFIXES: .texi .texinfo .info .dvi .ps
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL)
cd $(top_srcdir) && automake --gnu doc/Makefile
DISTFILES = Makefile.in texinfo.tex fileutils.texi fileutils.info \
version.texi perm.texi getdate.texi
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
all: fileutils.info
info: fileutils.info
version.texi: @MAINT@stamp-vti
version.texi: ../src/version.c
sed -e '/version_string/!d' \
-e 's/[^0-9.]*\([0-9.a-z]*\).*/@set VERSION \1/' \
-e q $(srcdir)/../src/version.c \
> $@-t
echo '@set RELEASEDATE '`date '+%B %Y'` >> $@-t
mv $@-t $@
stamp-vti: fileutils.texi $(top_srcdir)/configure.in
echo "@set UPDATED `cd $(srcdir) \
&& $(SHELL) ./mdate-sh fileutils.texi`" > vti.tmp
echo "@set EDITION $(VERSION)" >> vti.tmp
echo "@set VERSION $(VERSION)" >> vti.tmp
cmp -s vti.tmp $(srcdir)/version.texi || cp vti.tmp $(srcdir)/version.texi
rm vti.tmp
echo timestamp > $(srcdir)/stamp-vti
mostlyclean-vti:
rm -f vti.tmp
clean-vti:
distclean-vti:
maintainer-clean-vti:
@MAINT@rm -f stamp-vti version.texi
fileutils.info: fileutils.texi version.texi
$(MAKEINFO) -I$(srcdir) --no-split fileutils.texi --output=$@
fileutils.dvi: fileutils.texi version.texi
dvi: fileutils.dvi
fileutils.dvi: fileutils.texi version.texi texinfo.tex
$(TEXI2DVI) $(srcdir)/fileutils.texi
DVIPS = dvips
installdirs:
$(srcdir)/../mkinstalldirs $(infodir)
.texi.info:
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
install: install-exec install-data
install-exec:
install-data: all installdirs
cd $(srcdir) && for file in fileutils.info; do \
$(INSTALL_DATA) $$file $(infodir)/$$file; \
.texi.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.texinfo.info:
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) $<
.dvi.ps:
$(DVIPS) $< -o $@
install-info-am: $(INFO_DEPS)
$(NORMAL_INSTALL)
$(mkinstalldirs) $(infodir)
@for file in $(INFO_DEPS); do \
for ifile in `cd $(srcdir) && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
if test -f $(srcdir)/$$ifile; then \
echo "$(INSTALL_DATA) $(srcdir)/$$ifile $(infodir)/$$ifile"; \
$(INSTALL_DATA) $(srcdir)/$$ifile $(infodir)/$$ifile; \
else : ; fi; \
done; \
done
$(POST_INSTALL)
@if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
for file in $(INFO_DEPS); do \
echo "install-info --info-dir=$(infodir) $(infodir)/$$file";\
install-info --info-dir=$(infodir) $(infodir)/$$file; :;\
done; \
else : ; fi
uninstall-info:
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
ii=yes; \
else ii=; fi; \
for file in $(INFO_DEPS); do \
(cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
test -z $ii || install-info --info-dir=$(infodir) --remove $$file; \
done
uninstall:
rm -f $(infodir)/fileutils.info
check:
texclean:
rm -f *.aux *.cp *.dvi *.fn *.ky *.log *.pg *.toc *.tp *.vr \
*.fl *.cm *.op *.cps
mostlyclean: texclean
clean: mostlyclean
distclean: clean
rm -f Makefile
maintainer-clean: distclean
@echo "This command is intended for use by maintainers;"
@echo "it deletes files that may require special tools to rebuild."
rm -f fileutils.info version.texi
distdir = ../`cat ../distname`/$(subdir)
dist: $(DISTFILES)
for file in $(DISTFILES); do \
ln $$file $(distdir) \
|| { echo copying $$file instead; cp -p $$file $(distdir);}; \
dist-info: $(INFO_DEPS)
for base in $(INFO_DEPS); do \
d=$(srcdir); \
for file in `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
mostlyclean-info:
rm -f fileutils.aux fileutils.cp fileutils.cps fileutils.dvi \
fileutils.fn fileutils.fns fileutils.ky fileutils.log \
fileutils.pg fileutils.toc fileutils.tp fileutils.vr \
fileutils.op
clean-info:
distclean-info:
maintainer-clean-info:
for i in $(INFO_DEPS); do rm `eval echo $$i*`; done
tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = doc
Makefile: ../config.status Makefile.in
cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
$(MAKE) distdir="$(distdir)" dist-info
info: $(INFO_DEPS)
dvi: $(DVIS)
check: all
$(MAKE)
installcheck:
install-exec:
$(NORMAL_INSTALL)
.PHONY: all check clean dist distclean dvi info install install-data \
install-exec installdirs maintainer-clean mostlyclean texclean uninstall
install-data: install-info-am
$(NORMAL_INSTALL)
# Tell versions [3.59,3.63) of GNU make not to export all variables.
install: install-exec install-data all
@:
uninstall: uninstall-info
all: $(INFO_DEPS) Makefile
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
installdirs:
$(mkinstalldirs) $(infodir)
mostlyclean-generic:
test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
rm -f Makefile $(DISTCLEANFILES)
rm -f config.cache config.log stamp-h
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-vti mostlyclean-info mostlyclean-generic
clean: clean-vti clean-info clean-generic mostlyclean
distclean: distclean-vti distclean-info distclean-generic clean
rm -f config.status
maintainer-clean: maintainer-clean-vti maintainer-clean-info \
maintainer-clean-generic distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
.PHONY: default mostlyclean-vti distclean-vti clean-vti \
maintainer-clean-vti install-info-am uninstall-info mostlyclean-info \
distclean-info clean-info maintainer-clean-info tags distdir info dvi \
installcheck install-exec install-data install uninstall all \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -1,16 +1,33 @@
@ifinfo
@set Francois Franc,ois
@end ifinfo
@tex
@set Francois Fran\noexpand\ptexc cois
@end tex
@node Date input formats
@chapter Date input formats
@cindex date input formats
@findex getdate
@quotation
Our units of temporal measurement, from seconds on up to months, are so
complicated, asymmetrical and disjunctive so as to make coherent mental
reckoning in time all but impossible. Indeed, had some tyrannical god
contrived to enslave our minds to time, to make it all but impossible
for us to escape subjection to sodden routines and unpleasant surprises,
he could hardly have done better than handing down our present system.
It is like a set of trapezoidal building blocks, with no vertical or
horizontal surfaces, like a language in which the simplest thought
demands ornate constructions, useless particles and lengthy
circumlocutions. Unlike the more successful patterns of language and
science, which enable us to face experience boldly or at least
level-headedly, our system of temporal calculation silently and
persistently encourages our terror of time.
@dots{} It is as though architects had to measure length in feet, width
in meters and height in ells; as though basic instruction manuals
demanded a knowledge of five different languages. It is no wonder then
that we often look into our own immediate past or future, last Tuesday
or a week from Sunday, with feelings of helpless confusion. @dots{}
--- Robert Grudin, @cite{Time and the Art of Living}.
@end quotation
This section describes the textual date representations that GNU
programs accept. These are the strings you, as a user, can supply as
arguments to the various programs. The C interface (via the
@@ -53,7 +70,7 @@ many flavors of items:
@item time zone items
@item day of the week items
@item relative items
@item pure numbers.
@item pure numbers.
@end itemize
@noindent We describe each of these item types in turn, below.
@@ -89,12 +106,12 @@ zeros on numbers are ignored.
@cindex calendar date item
A @dfn{calendar date item} specifies a day of the year. It is
A @dfn{calendar date item} specifies a day of the year. It is
specified differently, depending on whether the month is specified
numerically or literally. All these strings specify the same calendar date:
@example
1970-9-17 # ISO 8601.
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.
@@ -120,9 +137,10 @@ Here are the rules.
@cindex date format, ISO 8601
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 1 and 12, and
@var{day} is a number between 1 and 31. If @var{year} is less than 100,
then 1900 is added to it to force a date in this century. The construct
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
@samp{@var{month}/@var{day}/@var{year}}, popular in the United States,
is accepted. Also @samp{@var{month}/@var{day}}, omitting the year.
@@ -478,6 +496,6 @@ and others.
@cindex Pinard, F.
@cindex Berry, K.
This chapter was originally produced by @value{Francois} Pinard
This chapter was originally produced by Fran@,{c}ois Pinard
(@samp{pinard@@iro.umontreal.ca}) from the @file{getdate.y} source code,
and then edited by K.@: Berry (@samp{kb@@cs.umb.edu}).

91
doc/mdate-sh Executable file
View File

@@ -0,0 +1,91 @@
#!/bin/sh
# mdate-sh - get modification time of a file and pretty-print it.
# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
# Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
#
# 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.
# Prevent date giving response in another language.
LANG=C
export LANG
LC_ALL=C
export LC_ALL
LC_TIME=C
export LC_TIME
# Get the extended ls output of the file.
if ls -L /dev/null 1>/dev/null 2>&1; then
set - `ls -L -l $1`
else
set - `ls -l $1`
fi
# The month is at least the fourth argument.
# (3 shifts here, the next inside the loop)
shift
shift
shift
# Find the month. Next argument is day, followed by the year or time.
month=
until test $month
do
shift
case $1 in
Jan) month=January; nummonth=1;;
Feb) month=February; nummonth=2;;
Mar) month=March; nummonth=3;;
Apr) month=April; nummonth=4;;
May) month=May; nummonth=5;;
Jun) month=June; nummonth=6;;
Jul) month=July; nummonth=7;;
Aug) month=August; nummonth=8;;
Sep) month=September; nummonth=9;;
Oct) month=October; nummonth=10;;
Nov) month=November; nummonth=11;;
Dec) month=December; nummonth=12;;
esac
done
day=$2
# Here we have to deal with the problem that the ls output gives either
# the time of day or the year.
case $3 in
*:*) set `date`; eval year=\$$#
case $2 in
Jan) nummonthtod=1;;
Feb) nummonthtod=2;;
Mar) nummonthtod=3;;
Apr) nummonthtod=4;;
May) nummonthtod=5;;
Jun) nummonthtod=6;;
Jul) nummonthtod=7;;
Aug) nummonthtod=8;;
Sep) nummonthtod=9;;
Oct) nummonthtod=10;;
Nov) nummonthtod=11;;
Dec) nummonthtod=12;;
esac
# For the first six month of the year the time notation can also
# be used for files modified in the last year.
if (expr $nummonth \> $nummonthtod) > /dev/null;
then
year=`expr $year - 1`
fi;;
*) year=$3;;
esac
# The result.
echo $day $month $year

View File

@@ -217,17 +217,14 @@ og-rxw
@cindex copying existing permissions
@cindex permissions, copying existing
You can base part of a file's permissions on part of its existing
permissions. To do this, instead of using @samp{r}, @samp{w}, or
@samp{x} after the operator, you use the letter @samp{u}, @samp{g}, or
@samp{o}. For example, the mode
You can base a file's permissions on its existing permissions. To do
this, instead of using @samp{r}, @samp{w}, or @samp{x} after the
operator, you use the letter @samp{u}, @samp{g}, or @samp{o}. For
example, the mode
@example
o+g
@end example
@noindent
@c FIXME describe the ls -l notation for showing permissions.
adds the permissions for users who are in a file's group to the
permissions that other users have for the file. Thus, if the file
started out as mode 664 (@samp{rw-rw-r--}), the above mode would change

View File

@@ -18,46 +18,44 @@
@syncodeindex pg cp
@syncodeindex vr cp
@ifinfo
@set Francois Franc,ois
@end ifinfo
@tex
@set Francois Fran\noexpand\ptexc cois
@end tex
@set Francois Fran@,{c}ois
@ifinfo
@format
START-INFO-DIR-ENTRY
* Shell utilities: (sh-utils). GNU shell utilities.
* basename: (sh-utils)basename invocation. Strip directory and suffix.
* date: (sh-utils)date invocation. Print/set system date and time.
* dirname: (sh-utils)dirname invocation. Strip non-directory suffix.
* echo: (sh-utils)echo invocation. Print a line of text.
* env: (sh-utils)env invocation. Modify the environment.
* expr: (sh-utils)expr invocation. Evaluate expressions.
* false: (sh-utils)false invocation. Do nothing, unsuccessfully.
* groups: (sh-utils)groups invocation. Print group names a user is in.
* 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.
* nice: (sh-utils)nice invocation. Modify scheduling priority.
* nohup: (sh-utils)nohup invocation. Immunize to hangups.
* pathchk: (sh-utils)pathchk invocation. Check file name portability.
* printenv: (sh-utils)printenv invocation. Print environment variables.
* printf: (sh-utils)printf invocation. Format and print data.
* pwd: (sh-utils)pwd invocation. Print working directory.
* sleep: (sh-utils)sleep invocation. Delay for a specified time.
* stty: (sh-utils)stty invocation. Print/change terminal settings.
* su: (sh-utils)su invocation. Modify user and group id.
* tee: (sh-utils)tee invocation. Redirect to multiple files.
* test: (sh-utils)test invocation. File/string tests.
* true: (sh-utils)true invocation. Do nothing, successfully.
* tty: (sh-utils)tty invocation. Print terminal name.
* uname: (sh-utils)uname invocation. Print system information.
* users: (sh-utils)users invocation. Print current user names.
* who: (sh-utils)who invocation. Print who is logged in.
* whoami: (sh-utils)whoami invocation. Print effective user id.
* yes: (sh-utils)yes invocation. Print a string indefinitely.
* Shell utilities: (sh-utils). GNU shell utilities.
* basename: (sh-utils)basename invocation. Strip directory and suffix.
* chroot: (sh-utils)chroot invocation. Specify the root directory.
* date: (sh-utils)date invocation. Print/set system date and time.
* dirname: (sh-utils)dirname invocation. Strip non-directory suffix.
* echo: (sh-utils)echo invocation. Print a line of text.
* env: (sh-utils)env invocation. Modify the environment.
* expr: (sh-utils)expr invocation. Evaluate expressions.
* 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.
* 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.
* nice: (sh-utils)nice invocation. Modify scheduling priority.
* nohup: (sh-utils)nohup invocation. Immunize to hangups.
* pathchk: (sh-utils)pathchk invocation. Check file name portability.
* printenv: (sh-utils)printenv invocation. Print environment variables.
* printf: (sh-utils)printf invocation. Format and print data.
* pwd: (sh-utils)pwd invocation. Print working directory.
* seq: (sh-utils)seq invocation. Print numeric sequences
* sleep: (sh-utils)sleep invocation. Delay for a specified time.
* stty: (sh-utils)stty invocation. Print/change terminal settings.
* su: (sh-utils)su invocation. Modify user and group id.
* tee: (sh-utils)tee invocation. Redirect to multiple files.
* test: (sh-utils)test invocation. File/string tests.
* true: (sh-utils)true invocation. Do nothing, successfully.
* tty: (sh-utils)tty invocation. Print terminal name.
* uname: (sh-utils)uname invocation. Print system information.
* users: (sh-utils)users invocation. Print current user names.
* who: (sh-utils)who invocation. Print who is logged in.
* whoami: (sh-utils)whoami invocation. Print effective user id.
* yes: (sh-utils)yes invocation. Print a string indefinitely.
END-INFO-DIR-ENTRY
@end format
@end ifinfo
@@ -65,7 +63,7 @@ END-INFO-DIR-ENTRY
@ifinfo
This file documents the GNU shell utilities.
Copyright (C) 1994 Free Software Foundation, Inc.
Copyright (C) 1994, 95, 96 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -92,12 +90,12 @@ by the Foundation.
@titlepage
@title GNU @code{sh-utils}
@subtitle A set of shell utilities
@subtitle for version @value{VERSION}, @value{RELEASEDATE}
@subtitle for version @value{VERSION}, @value{UPDATED}
@author David MacKenzie et al.
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1994 Free Software Foundation, Inc.
Copyright @copyright{} 1994, 95, 96 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -126,18 +124,21 @@ This manual minimally documents version @value{VERSION} of the GNU shell
utilities.
@menu
* Introduction:: Caveats, overview, and authors.
* Introduction:: Caveats, overview, and authors.
* Common options:: Common options.
* Date input formats:: Specifying date strings.
* Date input formats:: Specifying date strings.
* Printing text:: echo printf yes
* Conditions:: false true test expr
* Redirection:: tee
* File name manipulation:: dirname basename pathchk
* Working context:: pwd stty printenv tty
* Working context:: pwd stty printenv tty
* User information:: id logname whoami groups users who
* System context:: date uname hostname
* Modified command invocation:: env nice nohup su
* Modified command invocation:: chroot env nice nohup su
* Delaying:: sleep
* Numeric operations:: factor seq
* Index:: General index.
@end menu
@end ifinfo
@@ -166,7 +167,7 @@ The GNU shell utilities are mostly compatible with the POSIX.2 standard.
@c This paragraph appears in all of fileutils.texi, textutils.texi, and
@c sh-utils.texi too -- so be sure to keep them consistent.
@cindex bugs, reporting
Please report bugs to @samp{bug-gnu-utils@@prep.ai.mit.edu}. Remember
Please report bugs to @samp{sh-utils-bugs@@gnu.ai.mit.edu}. Remember
to include the version number, machine architecture, input files, and
any other information needed to reproduce the bug: your input, what you
expected, what you got, and why it is wrong. Diffs are welcome, but
@@ -178,7 +179,7 @@ sometimes difficult to infer. @xref{Bugs, , , gcc, GNU CC}.
@cindex Meyering, Jim
@c Sorry, but the @value trick doesn't work with TeX in indexing
@c commands, and I don't want to fix it right now. --karl.
@cindex Pinard, Francois
@cindex Pinard, @value{Francois}
@cindex Berry, Karl
@cindex Stallman, Richard
This manual is based on the Unix man pages in the distribution, which
@@ -245,15 +246,13 @@ This section describes commands that display text strings.
@cindex text, displaying
@cindex arbitrary text, displaying
Synopsis:
@code{echo} writes each given @var{string} to standard output, with a
space between each and a newline after the last one. Synopsis:
@example
echo [@var{option}]@dots{} [@var{string}]@dots{}
@end example
@code{echo} writes each given @var{string} to standard output, with a
space between each and a newline after the last one.
The program accepts the following options. Also see @ref{Common options}.
@table @samp
@@ -298,7 +297,7 @@ a valid octal number, it is printed literally.
@section @code{printf}: Format and print data
@pindex printf
Synopsis:
@code{printf} does formatted printing of text. Synopsis:
@example
printf @var{format} [@var{argument}]@dots{}
@@ -423,7 +422,7 @@ is also allowed: @code{test} returns true if the argument is not null.
@menu
* File type tests:: -[bcdfhLpSt]
* Access permission tests:: -[gkruwxOG]
* File characteristics tests:: -e -s -nt -ot -ef
* File characteristics tests:: -e -s -nt -ot -ef
* String tests:: -z -n = !=
* Numeric tests:: -eq -ne -lt -le -gt -ge
* Connectives for test:: ! -a -o
@@ -599,7 +598,7 @@ True if the length of @var{string} is zero.
@itemx @var{string}
@opindex -n
@cindex nonzero-length string check
True if the length of @var{string} is non-zero.
True if the length of @var{string} is nonzero.
@item @var{string1} = @var{string2}
@opindex =
@@ -699,9 +698,9 @@ Operands are either numbers or strings. @code{expr} coerces
anything appearing in an operand position to an integer or a string
depending on the operation being applied to it.
Strings are not quoted for @code{expr}, though you may need to quote
them to protect characters with special meaning to the shell, e.g.,
spaces.
Strings are not quoted for @code{expr} itself, though you may need to
quote them to protect characters with special meaning to the shell,
e.g., spaces.
@cindex parentheses for grouping
Operators may given as infix symbols or prefix keywords. Parentheses
@@ -720,7 +719,7 @@ Exit status:
@menu
* Relations for expr:: | & < <= = == != >= >
* Numeric expressions:: + - * / %
* String expressions:: : match substr index length
* String expressions:: <colon> match substr index length
* Examples of expr:: Examples.
@end menu
@@ -869,7 +868,7 @@ To add 1 to the shell variable @code{foo}, in Bourne-compatible shells:
foo=`expr $foo + 1`
@end example
To print the non-directory part of the file name stored in
To print the non-directory part of the file name stored in
@code{$fname}, which need not contain a @code{/}.
@example
expr $fname : '.*/\(^.*\)' '^|' $fname
@@ -897,11 +896,11 @@ to change the input source or output destination of a command. But one
useful redirection is performed by a separate command, not by the shell;
it's described here.
@menu
* tee invocation:: Redirect output to multiple files.
@end menu
@node tee invocation
@section @code{tee}: Redirect output to multiple files
@@ -912,9 +911,7 @@ it's described here.
The @code{tee} command copies standard input to standard output and also
to any files given as arguments. This is useful when you want not only
to send some data down a pipe, but also to save a copy.
Synopsis:
to send some data down a pipe, but also to save a copy. Synopsis:
@example
tee [@var{option}]@dots{} [@var{file}]@dots{}
@@ -969,16 +966,16 @@ This section describes commands that manipulate file names.
@cindex file names, stripping directory and suffix
@cindex leading directory components, stripping
Synopsis:
@code{basename} removes any leading directory components from
@var{name}. Synopsis:
@example
basename @var{name} [@var{suffix}]
@end example
The @code{basename} command removes any leading directory components
from @var{name}. If @var{suffix} is specified and is identical
to the end of @var{name}, it is removed from @var{name} as well.
@code{basename} prints the result on standard output.
If @var{suffix} is specified and is identical to the end of @var{name},
it is removed from @var{name} as well. @code{basename} prints the
result on standard output.
The only options are @samp{--help} and @samp{--version}. @xref{Common
options}.
@@ -992,15 +989,15 @@ options}.
@cindex stripping non-directory suffix
@cindex non-directory suffix, stripping
Synopsis:
@code{dirname} prints all but the final slash-delimited component of
a string (presumably a filename). Synopsis:
@example
dirname @var{name}
@end example
@code{dirname} prints all but the final slash-delimited component
of @var{name}. If @var{name} is a single component,
@code{dirname} prints @samp{.} (meaning the current directory).
If @var{name} is a single component, @code{dirname} prints @samp{.}
(meaning the current directory).
The only options are @samp{--help} and @samp{--version}. @xref{Common
options}.
@@ -1014,7 +1011,7 @@ options}.
@cindex valid file names, checking for
@cindex portable file names, checking for
Synopsis:
@code{pathchk} checks portability of filenames. Synopsis:
@example
pathchk [@var{option}]@dots{} @var{name}@dots{}
@@ -1108,6 +1105,14 @@ The only options are a lone @samp{--help} or
@cindex terminal settings
@cindex line settings of terminal
@code{stty} prints or changes terminal characteristics, such as baud rate.
Synopses:
@example
stty [@var{setting}]@dots{}
stty [@var{option}]
@end example
If given no arguments, @code{stty} prints the baud rate, line
discipline number (on systems that support it), and line settings
that have been changed from the values set by @samp{stty sane}.
@@ -1117,13 +1122,6 @@ standard input.
@code{stty} accepts many non-option arguments that change aspects of
the terminal line operation, as described below.
Synopses:
@example
stty [@var{setting}]@dots{}
stty [@var{option}]
@end example
The program accepts the following options. Also see @ref{Common options}.
@table @samp
@@ -1232,7 +1230,7 @@ Enable RTS/CTS flow control. Non-POSIX. May be negated.
@item ignbrk
@opindex ignbrk
@cindex breaks, ignoring
Ignore breaks. May be negated.
Ignore break characters. May be negated.
@item brkint
@opindex brkint
@@ -1242,7 +1240,7 @@ Make breaks cause an interrupt signal. May be negated.
@item ignpar
@opindex ignpar
@cindex parity, ignoring
Ignore parity errors. May be negated.
Ignore characters with parity errors. May be negated.
@item parmrk
@opindex parmrk
@@ -1277,7 +1275,7 @@ Translate carriage return to newline. May be negated.
@opindex ixon
@kindex C-s/C-q flow control
@cindex XON/XOFF flow control
Enable XON/XOFF flow control (that is, @key{CTRL-s}/@key{CTRL-Q}). May
Enable XON/XOFF flow control (that is, @kbd{CTRL-S}/@kbd{CTRL-Q}). May
be negated.
@item ixoff
@@ -1591,7 +1589,7 @@ They are set with the syntax @samp{name value}, where the names are
listed below and the value can be given either literally, in hat
notation (@samp{^@var{c}}), or as an integer which may start with
@samp{0x} to indicate hexadecimal, @samp{0} to indicate octal, or
any other digit to indicate decimal.
any other digit to indicate decimal.
@cindex disabling special characters
@kindex u@r{, and disabling special characters}
@@ -1599,7 +1597,7 @@ For GNU stty, giving a value of @code{^-} or @code{undef} disables that
special character. (This is incompatible with Ultrix @code{stty},
which uses a value of @samp{u} to disable a special character. GNU
@code{stty} treats a value @samp{u} like any other, namely to set that
special character to @key{u}.)
special character to @key{U}.)
@table @samp
@@ -1735,7 +1733,7 @@ of: 0 50 75 110 134 134.5 150 200 300 600 1200 1800 2400 4800 9600
@cindex printing all or some environment variables
@cindex environment variables, printing
Synopsis:
@code{printenv} prints environment variable values. Synopsis:
@example
printenv [@var{option}] [@var{variable}]@dots{}
@@ -1765,9 +1763,8 @@ Exit status:
@cindex print terminal file name
@cindex terminal file name, printing
@code{tty} prints the file name of the tty connected to its standard
input. It prints @samp{not a tty} if standard input is not a tty.
@code{tty} prints the file name of the terminal connected to its standard
input. It prints @samp{not a tty} if standard input is not a terminal.
Synopsis:
@example
@@ -1792,8 +1789,8 @@ Print nothing; only return an exit status.
Exit status:
@display
0 if standard input is a tty
1 if standard input is not a tty
0 if standard input is a terminal
1 if standard input is not a terminal
2 if given incorrect arguments
3 if a write error occurs
@end display
@@ -1826,10 +1823,8 @@ logins, groups, and so forth.
@cindex effective uid and gid, printing
@cindex printing real and effective uid and gid
@noindent @code{id} prints information about the given user, or the process
running it if no user is specified.
Synopsis:
@code{id} prints information about the given user, or the process
running it if no user is specified. Synopsis:
@example
id [@var{option}]@dots{} [@var{username}]
@@ -1923,11 +1918,9 @@ options}.
@cindex supplementary groups, printing
@code{groups} prints the names of the primary and any supplementary
groups that each given @var{username}, or the current process if none
are given, is in. If user names are given, the name of each user is
printed before the list of that user's groups.
Synopsis:
groups for each given @var{username}, or the current process if no names
are given. If names are given, the name of each user is printed before
the list of that user's groups. Synopsis:
@example
groups [@var{username}]@dots{}
@@ -1951,9 +1944,7 @@ options}.
names of users currently logged in to the current host. Each user name
corresponds to a login session, so if a user has more than one login
session, that user's name will appear the same number of times in the
output.
Synopsis:
output. Synopsis:
@example
users [@var{file}]
@@ -1976,6 +1967,7 @@ options}.
@cindex printing current user information
@cindex information, about current users
@code{who} prints information about users who are currently logged on.
Synopsis:
@example
@@ -2085,10 +2077,8 @@ information.
@cindex time, printing or setting
@cindex printing the current time
@code{date} with no arguments prints the current time and date, in
the format of the @samp{%c} directive (described below).
Synopses:
@code{date} with no arguments prints the current time and date, in the
format of the @samp{%c} directive (described below). Synopses:
@example
date [@var{option}]@dots{} [+@var{format}]
@@ -2107,10 +2097,10 @@ directives, which start with @samp{%}, characters in the format string
are printed unchanged. The directives are described below.
@menu
* Time directives:: %[HIklMprsSTXZ]
* Time directives:: %[HIklMprsSTXzZ]
* Date directives:: %[aAbBcdDhjmUwWxyY]
* Literal directives:: %[%nt]
* Padding:: Pad with zeroes, spaces (%_), or nothing (%-).
* Padding:: Pad with zeroes, spaces (%_), or nothing (%-).
* Setting the time:: Changing the system clock.
* Options for date:: Instead of the current time.
* Examples of date:: Examples.
@@ -2144,16 +2134,25 @@ time, 12-hour (hh:mm:ss [AP]M)
@cindex seconds since the epoch
@cindex beginning of time
seconds since the epoch, i.e., 1 January 1970 00:00:00 UTC (a
GNU extension)
GNU extension).
Note that this value is the number of seconds between the epoch
and the current date as defined by the localtime system call.
It isn't changed by the @samp{--date} option.
@item %S
second (00@dots{}61)
@item %T
time, 24-hour (hh:mm:ss)
@item %X
locale's time representation (%H:%M:%S)
@item %z
RFC-822 style numeric time zone (e.g., -0600 or +0100), or nothing if no
time zone is determinable. This value reflects the @emph{current} time
zone. It isn't changed by the @samp{--date} option.
@item %Z
timezone (e.g., EDT), or nothing if no timezone is
determinable
time zone (e.g., EDT), or nothing if no timezone is
determinable.
Note that this value reflects the @emph{current} time zone.
It isn't changed by the @samp{--date} option.
@end table
@@ -2187,11 +2186,19 @@ day of year (001@dots{}366)
@item %m
month (01@dots{}12)
@item %U
week number of year with Sunday as first day of week (00@dots{}53)
week number of year with Sunday as first day of week (00@dots{}53).
Days in a new year preceding the first Sunday are in week zero.
@item %V
week number of year with Monday as first day of the week as a decimal
(01@dots{}53). If the week containing January 1 has four or more days in
the new year, then it is considered week 1; otherwise, it is week 53 of
the previous year, and the next week is week 1. (See the ISO 8601: 1988
standard.)
@item %w
day of week (0@dots{}6) with 0 corresponding to Sunday
@item %W
week number of year with Monday as first day of week (00@dots{}53)
week number of year with Monday as first day of week (00@dots{}53).
Days in a new year preceding the first Monday are in week zero.
@item %x
locale's date representation (mm/dd/yy)
@item %y
@@ -2330,6 +2337,20 @@ input. This is useful when you have many dates to process, because the
system overhead of starting up the @code{date} executable many times can
be considerable.
@itemx --rfc-822
@opindex -R
@opindex --rfc-822
Display the time and date using the RFC-822-specified
format, @samp{%a, %_d %b %Y %H:%M:%S %z}.
If @samp{--utc} is also specified, use @samp{GMT} in place of @samp{%z}.
@item -r @var{file}
@itemx --reference=@var{file}
@opindex -r
@opindex --reference
Display the time and date reference according to the last modification
time of @var{file}, instead of the current time and date.
@item -s @var{datestr}
@itemx --set=@var{datestr}
@opindex -s
@@ -2410,6 +2431,14 @@ To set the system clock forward by two minutes:
date --set='+2 minutes'
@end example
@item
To print the date in the format specified by RFC-822,
use @samp{date --rfc}. I just did and saw this:
@example
Mon, 25 Mar 1996 23:34:17 -0600
@end example
@end itemize
@@ -2422,9 +2451,7 @@ date --set='+2 minutes'
@code{uname} prints information about the machine and operating system
it is run on. If no options are given, @code{uname} acts as if the
@code{-s} option were given.
Synopsis:
@code{-s} option were given. Synopsis:
@example
uname [@var{option}]@dots{}
@@ -2472,6 +2499,13 @@ Print the machine (hardware) type.
@cindex network node name
Print the machine's network node hostname.
@item -p
@itemx --processor
@opindex -p
@opindex --processor
@cindex host processor type
Print the machine's processor type
@item -r
@itemx --release
@opindex -r
@@ -2509,9 +2543,7 @@ Print the operating system version.
With no arguments, @code{hostname} prints the name of the current host
system. With one argument, it sets the current host name to the
specified string. You must have appropriate privileges to set the host
name.
Synopsis:
name. Synopsis:
@example
hostname [@var{name}]
@@ -2533,6 +2565,7 @@ different than the current one: a modified environment, as a different
user, etc.
@menu
* chroot invocation:: Modify the root directory.
* env invocation:: Modify environment variables.
* nice invocation:: Modify scheduling priority.
* nohup invocation:: Immunize to hangups.
@@ -2540,17 +2573,42 @@ user, etc.
@end menu
@node chroot invocation
@section @code{chroot}: Run a command with a different root directory
@pindex chroot
@cindex running a program in a specified root directory
@cindex root directory, running a program in a specified
@code{chroot} runs a command with a specified root directory.
On many systems, only the super-user can do this.
Synopses:
@example
chroot @var{newroot} [@var{command} [@var{args}]@dots{}]
chroot @var{option}
@end example
Ordinarily, filenames are looked up starting at the root of the
directory structure, i.e., @file{/}. @code{chroot} changes the root to
the directory @var{newroot} (which must exist) and then runs
@var{command} with optional @var{args}. If @var{command} is not
specified, the default is the value of the @code{SHELL} environment
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}.
@node env invocation
@section @code{env}: Run a command in a modified environment
@pindex env
@cindex environment, running a program in a modified
@cindex modified environment, running a program in
@cindex modified environment, running a program in a
@cindex running a program in a modified environment
@code{env} runs a command with an environment modified as specified
by the command line arguments.
Synopses:
@code{env} runs a command with a modified environment. Synopses:
@example
env [@var{option}]@dots{} [@var{name}=@var{value}]@dots{} @c
@@ -2605,6 +2663,13 @@ Start with an empty environment, ignoring the inherited environment.
@cindex priority, modifying
@cindex appropriate privileges
@code{nice} prints or modifies the scheduling priority of a job.
Synopsis:
@example
nice [@var{option}]@dots{} [@var{command} [@var{arg}]@dots{}]
@end example
If no arguments are given, @code{nice} prints the current scheduling
priority, which it inherited. Otherwise, @code{nice} runs the given
@var{command} with its scheduling priority adjusted. If no
@@ -2613,12 +2678,6 @@ priority, which it inherited. Otherwise, @code{nice} runs the given
adjustment. The priority can be adjusted by @code{nice} over the range
of -20 (the highest priority) to 19 (the lowest).
Synopsis:
@example
nice [@var{option}]@dots{} [@var{command} [@var{arg}]@dots{}]
@end example
@cindex conflicts with shell built-ins
@cindex built-in shell commands, conflicts with
Because most shells have a built-in command by the same name, using the
@@ -2644,24 +2703,24 @@ Add @var{adjustment} instead of 10 to the command's priority.
@pindex nohup
@cindex hangups, immunity to
@cindex immunity to hangups
@cindex logging out and continuing to run
@flindex nohup.out
@code{nohup} runs the given @var{command} with hangup signals ignored,
so that the command can continue running in the background after you log
out.
Synopsis:
out. Synopsis:
@example
nohup @var{command} [@var{arg}]@dots{}
@end example
@flindex nohup.out
Also, the scheduling priority is increased by 5. If standard output is a
tty, it and standard error are redirected so that they are appended to
the file @file{nohup.out}; if that cannot be written to, they are
appended to the file @file{$HOME/nohup.out}. If that cannot be written
to, the command is not run.
@code{nohup} increases the scheduling priority of @var{command} by 5, so
it has a slightly smaller change to run. If standard output is a terminal,
it and standard error are redirected so that they are appended to the
file @file{nohup.out}; if that cannot be written to, they are appended
to the file @file{$HOME/nohup.out}. If that cannot be written to, the
command is not run.
If @code{nohup} creates either @file{nohup.out} or
@file{$HOME/nohup.out}, it creates it with no ``group'' or ``other''
@@ -2687,9 +2746,7 @@ options}.
@code{su} allows one user to temporarily become another user. It runs a
command (often an interactive shell) with the real and effective user
id, group id, and supplemental groups of a given @var{user}.
Synopsis:
id, group id, and supplemental groups of a given @var{user}. Synopsis:
@example
su [@var{option}]@dots{} [@var{user} [@var{arg}]@dots{}]
@@ -2831,7 +2888,7 @@ might find this idea strange at first.
@cindex delaying commands
@cindex commands for delaying
Perhaps @code{wait} or other commands should be described here also?
@c Perhaps @code{wait} or other commands should be described here also?
@menu
* sleep invocation:: Delay for a specified time.
@@ -2846,7 +2903,6 @@ Perhaps @code{wait} or other commands should be described here also?
@code{sleep} pauses for an amount of time specified by the sum of
the values of the command line arguments.
Synopsis:
@example
@@ -2872,6 +2928,82 @@ The only options are @samp{--help} and @samp{--version}. @xref{Common
options}.
@node Numeric operations
@chapter Numeric operations
@cindex numeric operations
These programs do numerically-related operations.
@menu
* factor invocation:: Show factors of numbers.
* seq invocation:: Print sequences of numbers.
@end menu
@node factor invocation
@section @code{factor}: Print prime factors
@pindex factor
@cindex prime factors
@code{factor} prints prime factors. Synopses:
@example
factor [@var{number}]@dots{}
factor @var{option}
@end example
If no @var{number} is specified on the command line, @code{factor} reads
numbers from standard input, delimited by newlines, tabs, or spaces.
The only options are @samp{--help} and @samp{--version}. @xref{Common
options}.
@node seq invocation
@section @code{seq}: Print numeric sequences
@pindex seq
@cindex numeric sequences
@cindex sequence of numbers
@code{seq} prints a sequence of numbers to standard output. Synopses:
@example
seq [@var{option}]@dots{} [@var{first} [@var{step}]] @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.
The program accepts the following options. Also see @ref{Common options}.
@table @samp
@item -f @var{format}
@itemx --format=@var{format}
@opindex -f @var{format}
@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}.
@item -s @var{string}
@itemx --separator=@var{string}
@cindex separator for numbers in @code{seq}
Separate numbers with @var{string}; default is a newline.
The output always terminates with a newline.
@item -w
@itemx --equal-width
Print all numbers with the same width, by padding with leading zeroes.
(To have other kinds of padding, use @samp{--format}).
@end table
@node Index
@unnumbered Index

File diff suppressed because it is too large Load Diff

View File

@@ -16,41 +16,34 @@
@syncodeindex pg cp
@syncodeindex vr cp
@ifinfo
@set Francois Franc,ois
@end ifinfo
@tex
@set Francois Fran\noexpand\ptexc cois
@end tex
@ifinfo
@format
START-INFO-DIR-ENTRY
* Text utilities: (textutils). GNU text utilities.
* cat: (textutils)cat invocation. Concatenate and write files.
* cksum: (textutils)cksum invocation. Print POSIX CRC checksum.
* comm: (textutils)comm invocation. Compare sorted files by line.
* csplit: (textutils)csplit invocation. Split by context.
* cut: (textutils)cut invocation. Print selected parts of lines.
* expand: (textutils)expand invocation. Convert tabs to spaces.
* fmt: (textutils)fmt invocation. Reformat paragraph text.
* fold: (textutils)fold invocation. Wrap long input lines.
* head: (textutils)head invocation. Output the first part of files.
* join: (textutils)join invocation. Join lines on a common field.
* md5sum: (textutils)md5sum invocation. Print or check message-digests.
* nl: (textutils)nl invocation. Number lines and write files.
* od: (textutils)od invocation. Dump files in octal, etc.
* paste: (textutils)paste invocation. Merge lines of files.
* pr: (textutils)pr invocation. Paginate or columnate files.
* sort: (textutils)sort invocation. Sort text files.
* split: (textutils)split invocation. Split into fixed-size pieces.
* sum: (textutils)sum invocation. Print traditional checksum.
* tac: (textutils)tac invocation. Reverse files.
* tail: (textutils)tail invocation. Output the last part of files.
* tr: (textutils)tr invocation. Translate characters.
* unexpand: (textutils)unexpand invocation. Convert spaces to tabs.
* uniq: (textutils)uniq invocation. Uniqify files.
* wc: (textutils)wc invocation. Byte, word, and line counts.
* Text utilities: (textutils). GNU text utilities.
* cat: (textutils)cat invocation. Concatenate and write files.
* cksum: (textutils)cksum invocation. Print @sc{POSIX} CRC checksum.
* comm: (textutils)comm invocation. Compare sorted files by line.
* csplit: (textutils)csplit invocation. Split by context.
* cut: (textutils)cut invocation. Print selected parts of lines.
* expand: (textutils)expand invocation. Convert tabs to spaces.
* fmt: (textutils)fmt invocation. Reformat paragraph text.
* fold: (textutils)fold invocation. Wrap long input lines.
* head: (textutils)head invocation. Output the first part of files.
* join: (textutils)join invocation. Join lines on a common field.
* md5sum: (textutils)md5sum invocation. Print or check message-digests.
* nl: (textutils)nl invocation. Number lines and write files.
* od: (textutils)od invocation. Dump files in octal, etc.
* paste: (textutils)paste invocation. Merge lines of files.
* pr: (textutils)pr invocation. Paginate or columnate files.
* sort: (textutils)sort invocation. Sort text files.
* split: (textutils)split invocation. Split into fixed-size pieces.
* sum: (textutils)sum invocation. Print traditional checksum.
* tac: (textutils)tac invocation. Reverse files.
* tail: (textutils)tail invocation. Output the last part of files.
* tr: (textutils)tr invocation. Translate characters.
* unexpand: (textutils)unexpand invocation. Convert spaces to tabs.
* uniq: (textutils)uniq invocation. Uniqify files.
* wc: (textutils)wc invocation. Byte, word, and line counts.
END-INFO-DIR-ENTRY
@end format
@end ifinfo
@@ -58,7 +51,7 @@ END-INFO-DIR-ENTRY
@ifinfo
This file documents the GNU text utilities.
Copyright (C) 1994, 95 Free Software Foundation, Inc.
Copyright (C) 1994, 95, 96 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -85,12 +78,12 @@ by the Foundation.
@titlepage
@title GNU @code{textutils}
@subtitle A set of text utilities
@subtitle for version @value{VERSION}, @value{RELEASEDATE}
@subtitle for version @value{VERSION}, @value{UPDATED}
@author David MacKenzie et al.
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1994, 95 Free Software Foundation, Inc.
Copyright @copyright{} 1994, 95, 96 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -145,12 +138,12 @@ involved in improving this manual. The entire GNU community will
benefit.
@cindex POSIX.2
The GNU text utilities are mostly compatible with the POSIX.2 standard.
The GNU text utilities are mostly compatible with the @sc{POSIX.2} standard.
@c This paragraph appears in all of fileutils.texi, textutils.texi, and
@c sh-utils.texi too -- so be sure to keep them consistent.
@cindex bugs, reporting
Please report bugs to @samp{bug-gnu-utils@@prep.ai.mit.edu}. Remember
Please report bugs to @samp{textutils-bugs@@gnu.ai.mit.edu}. Remember
to include the version number, machine architecture, input files, and
any other information needed to reproduce the bug: your input, what you
expected, what you got, and why it is wrong. Diffs are welcome, but
@@ -160,7 +153,7 @@ sometimes difficult to infer. @xref{Bugs, , , gcc, GNU CC}.
This manual is based on the Unix man pages in the distribution, which
were originally written by David MacKenzie and updated by Jim Meyering.
The original @code{fmt} man page was written by Ross Paterson.
@value{Francois} Pinard did the initial conversion to Texinfo format.
Fran@,{c}ois Pinard did the initial conversion to Texinfo format.
Karl Berry did the indexing, some reorganization, and editing of the results.
Richard Stallman contributed his usual invaluable insights to the
overall process.
@@ -478,9 +471,9 @@ Separate the line number from the text line in the output with
@var{string} (default is @key{TAB}).
@item -v @var{number}
@itemx --first-page=@var{number}
@itemx --starting-line-number=@var{number}
@opindex -v
@opindex --first-page
@opindex --starting-line-number
Set the initial line number on each logical page to @var{number} (default 1).
@item -w @var{number}
@@ -650,8 +643,8 @@ is not given at all, the default is 16.
@end table
The next several options map the old, pre-POSIX format specification
options to the corresponding POSIX format specs. GNU @code{od} accepts
The next several options map the old, pre-@sc{POSIX} format specification
options to the corresponding @sc{POSIX} format specs. GNU @code{od} accepts
any combination of old- and new-style options. Format specification
options accumulate.
@@ -733,7 +726,7 @@ address.
These commands reformat the contents of files.
@menu
* fmt invocation:: Reformat paragraph text.
* fmt invocation:: Reformat paragraph text.
* pr invocation:: Paginate or columnate files for printing.
* fold invocation:: Wrap input lines to fit in specified width.
@end menu
@@ -827,7 +820,7 @@ room to balance line lengths.
@item -p @var{prefix}
@itemx --prefix=@var{prefix}
Only lines beginning with @var{prefix} (possibly preceded by whitespace)
are subject to formatting. The prefix and any preceding whitespace is
are subject to formatting. The prefix and any preceding whitespace are
stripped for the formatting and then re-attached to each formatted output
line. One use is to format certain kinds of program comments, while
leaving the code unchanged.
@@ -841,10 +834,12 @@ leaving the code unchanged.
@pindex pr
@cindex printing, preparing files for
@cindex multicolumn output, generating
@cindex merging files in parallel
@code{pr} writes each @var{file} (@samp{-} means standard input), or
standard input if none are given, to standard output, paginating and
optionally outputting in multicolumn format. Synopsis:
optionally outputting in multicolumn format; optionally merges all
@var{file}s, printing all in parallel, one per column. Synopsis:
@example
pr [@var{option}]@dots{} [@var{file}]@dots{}
@@ -852,33 +847,50 @@ pr [@var{option}]@dots{} [@var{file}]@dots{}
By default, a 5-line header is printed: two blank lines; a line with the
date, the file name, and the page count; and two more blank lines. A
five line footer (entirely) is also printed.
footer of five blank lines is also printed. With the @samp{-f} option, a
3-line header is printed: the leading two blank lines are omitted; no
footer used. The default @var{page_length} in both cases is 66 lines.
The text line of the header takes up the full @var{page_width} in the
form @samp{yy-mm-dd HH:MM string Page nnnn}. String is a centered
string.
Form feeds in the input cause page breaks in the output.
Form feeds in the input cause page breaks in the output. Multiple form
feeds produce empty pages.
Columns have equal width, separated by an optional string (default
space). Lines will always be truncated to line width (default 72),
unless you use the @samp{-j} option. For single column output no line
truncation occurs by default. Use @samp{-w} option to truncate lines
in that case.
The program accepts the following options. Also see @ref{Common options}.
@table @samp
@item +@var{page}
Begin printing with page @var{page}.
@item +@var{first_page}[@var{:last_page}]
@opindex +@var{first_page}[@var{:last_page}]
Begin printing with page @var{first_page} and stop with
@var{last_page}. Missing @samp{:LAST_PAGE} implies end of file. While
estimating the number of skipped pages each form feed in the input file
results in a new page. Page counting with and without
@samp{+@var{first_page}} is identical. By default, it starts with the
first page of input file (not first page printed). Page numbering may be
altered by @samp{-N} option.
@item -@var{column}
@opindex -@var{column}
Produce @var{column}-column output and print columns down. The column
width is automatically decreased as @var{column} increases; unless you
use the @samp{-w} option to increase the page width as well, this option
might well cause some input to be truncated.
@cindex down columns
With each single @var{file}, produce @var{column}-column output and
print columns down. The column width is automatically estimated from
@var{page_width}. This option might well cause some columns to be
truncated. The number of lines in the columns on each page will be
balanced. @samp{-@var{column}} may not be used with @samp{-m} option.
@item -a
@opindex -a
@cindex across columns
Print columns across rather than down.
@item -b
@opindex -b
@cindex balancing columns
Balance columns on the last page.
With each single @var{file}, print columns across rather than down.
@var{column} must be greater than one.
@item -c
@opindex -c
@@ -903,11 +915,19 @@ is 8).
@itemx -F
@opindex -F
@opindex -f
Use a formfeed instead of newlines to separate output pages.
Use a form feed instead of newlines to separate output pages. Default
page length of 66 lines is not altered. But the number of lines of text
per page changes from 56 to 63 lines.
@item -h @var{header}
@item -h @var{HEADER}
@opindex -h
Replace the file name in the header with the string @var{header}.
Replace the file name in the header with the centered string
@var{header}. Left-hand-side truncation (marked by a @samp{*}) may occur
if the total header line @samp{yy-mm-dd HH:MM HEADER Page nnnn}
becomes larger than @var{page_width}. @samp{-h ""} prints a blank line
header. Don't use @samp{-h""}. A space between the -h option and the
argument is always peremptory.
@item -i[@var{out-tabchar}[@var{out-tabwidth}]]
@opindex -i
@@ -917,30 +937,54 @@ is the output tab character (default is @key{TAB}). Second optional
argument @var{out-tabwidth} is the output tab character's width (default
is 8).
@item -l @var{n}
@item -j
@opindex -j
Merge lines of full length. Used together with the column options
@samp{-@var{column}}, @samp{-a -@var{column}} or @samp{-m}. Turns off
@samp{-w} line truncation; no column alignment used; may be used with
@samp{-s[@var{separator}]}.
@item -l @var{page_length}
@opindex -l
Set the page length to @var{n} (default 66) lines. If @var{n} is less
than 10, the headers and footers are omitted, as if the @samp{-t} option
had been given.
Set the page length to @var{page_length} (default 66) lines. If
@var{page_length} is less than or equal 10 (and <= 3 with @samp{-f}),
the headers and footers are omitted, and all form feeds set in input
files are eliminated, as if the @samp{-T} option had been given.
@item -m
@opindex -m
Print all files in parallel, one in each column.
Merge and print all @var{file}s in parallel, one in each column. If a
line is too long to fit in a column, it is truncated (but see
@samp{-j}). @samp{-s[@var{separator}]} may be used. Empty pages in some
@var{file}s (form feeds set) produce empty columns, still marked by
@var{separator}. Completely empty common pages show no separators or
line numbers. The default header becomes
@samp{yy-mm-dd HH:MM <blanks> Page nnnn}; may be used with
@samp{-h @var{header}} to fill up the middle part.
@item -n[@var{number-separator}[@var{digits}]]
@opindex -n
Precede each column with a line number; with parallel files (@samp{-m}),
precede each line with a line number. Optional argument
Precede each column with a line number; with parallel @var{file}s
(@samp{-m}), precede only each line with a line number. Optional argument
@var{number-separator} is the character to print after each number
(default is @key{TAB}). Optional argument @var{digits} is the number of
digits per line number (default is 5).
digits per line number (default is 5). Default line counting starts with
first line of the input file (not with the first line printed, see
@samp{-N}).
@item -N @var{line_number}
@opindex -N
Start line counting with no. @var{line_number} at first line of first
page printed.
@item -o @var{n}
@opindex -o
@cindex indenting lines
@cindex left margin
Indent each line with @var{n} (default is zero) spaces wide, i.e., set
the left margin. The total page width is @samp{n} plus the width set
the left margin. The total page width is @var{n} plus the width set
with the @samp{-w} option.
@item -r
@@ -948,25 +992,44 @@ with the @samp{-w} option.
Do not print a warning message when an argument @var{file} cannot be
opened. (The exit status will still be nonzero, however.)
@item -s[@var{c}]
@item -s[@var{separator}]
@opindex -s
Separate columns by the single character @var{c}. If @var{c} is
omitted, the default is space; if this option is omitted altogether, the
default is @key{TAB}.
Separate columns by a string @var{separator}. Don't use
@samp{-s @var{separator}}, no space between flag and argument. If this
option is omitted altogether, the default is a space, same as
@samp{-s" "}. With @samp{-s} only, no separator is used, same as
@samp{-s""}. @samp{-s} does not affect line truncation or column
alignment.
@item -t
@opindex -t
Do not print the usual 5-line header and the 5-line footer on each page,
and do not fill out the bottoms of pages (with blank lines or
formfeeds).
Do not print the usual header [and footer] on each page, and do not fill
out the bottoms of pages (with blank lines or a form feed). No page
structure is produced, but retain form feeds set in the input files. The
predefined page layout is not changed. @samp{-t} or @samp{-T} may be
useful together with other options; e.g.: @samp{-t -e4}, expand
@key{TAB} in the input file to 4 spaces but do not do any other changes.
Use of @samp{-t} overrides @samp{-h}.
@item -T
@opindex -T
Do not print header [and footer]. In addition eliminate all form feeds
set in the input files.
@item -v
@opindex -v
Print unprintable characters in octal backslash notation.
@item -w @var{n}
@item -w @var{page_width}
@opindex -w
Set the page width to @var{n} (default is 72) columns.
Set the page width to @var{page_width} (default 72) characters.
With/without @samp{-w}, header lines are always truncated to
@var{page_width} characters. With @samp{-w}, text lines are truncated,
unless @samp{-j} is used. Without @samp{-w} together with one of the
column options @samp{-@var{column}}, @samp{-a -@var{column}} or
@samp{-m}, default truncation of text lines to 72 characters is used.
Without @samp{-w} and without any of the column options, no line
truncation is used. That's equivalent to @samp{-w 72 -j}.
@end table
@@ -1054,7 +1117,7 @@ head [@var{option}]@dots{} [@var{file}]@dots{}
head -@var{number} [@var{option}]@dots{} [@var{file}]@dots{}
@end example
If more than one @var{file} is specicified, @code{head} prints a
If more than one @var{file} is specified, @code{head} prints a
one-line header consisting of
@example
==> @var{file name} <==
@@ -1259,6 +1322,10 @@ less than @var{bytes} bytes of the line are left, then continue
normally. @var{bytes} has the same format as for the @samp{--bytes}
option.
@itemx --verbose=@var{bytes}
@opindex --verbose
Write a diagnostic to standard error just before each output file is opened.
@end table
@@ -1312,7 +1379,7 @@ file, so that section of the input file is effectively ignored.
Repeat the previous pattern @var{repeat-count} additional
times. @var{repeat-count} can either be a positive integer or an
asterisk, meaning repeat as many times as necessary until the input is
exausted.
exhausted.
@end table
@@ -1403,7 +1470,7 @@ contents of files.
* wc invocation:: Print byte, word, and line counts.
* sum invocation:: Print checksum and block counts.
* cksum invocation:: Print CRC checksum and byte counts.
* md5sum invocation:: Print or check message-digests.
* md5sum invocation:: Print or check message-digests.
@end menu
@@ -1535,13 +1602,13 @@ cksum [@var{option}]@dots{} [@var{file}]@dots{}
@code{cksum} prints the CRC checksum for each file along with the number
of bytes in the file, and the filename unless no arguments were given.
@code{cksum} is typically used to ensure that files have been
@code{cksum} is typically used to ensure that files
transferred by unreliable means (e.g., netnews) have not been corrupted,
by comparing the @code{cksum} output for the received files with the
@code{cksum} output for the original files (typically given in the
distribution).
The CRC algorithm is specified by the POSIX.2 standard. It is not
The CRC algorithm is specified by the @sc{POSIX.2} standard. It is not
compatible with the BSD or System V @code{sum} algorithms (see the
previous section); it is more robust.
@@ -1568,7 +1635,6 @@ consistent. Synopsis:
@example
md5sum [@var{option}]@dots{} [@var{file}]@dots{}
md5sum [@var{option}]@dots{} --check [@var{file}]
md5sum [@var{option}]@dots{} --string=@var{string} @dots{}
@end example
For each @var{file}, @samp{md5sum} outputs the MD5 checksum, a flag
@@ -1603,13 +1669,27 @@ For each such line, @code{md5sum} reads the named file and computes its
MD5 checksum. Then, if the computed message digest does not match the
one on the line with the filename, the file is noted as having
failed the test. Otherwise, the file passes the test.
By default, for each valid line, one line is written to standard
output indicating whether the named file passed the test.
After all checks have been performed, if there were any failures,
a warning is issued to standard error.
Use the @samp{--status} option to inhibit that output.
If any listed file cannot be opened or read, if any valid line has
an MD5 checksum inconsistent with the associated file, or if no valid
line is found, @code{md5sum} exits with nonzero status. Otherwise,
it exits successfully.
@item -s
@itemx --string=@var{string}
@opindex -s
@opindex --string
Compute the message digest for @var{string}, instead of for a file. The
result is the same as for a file that contains exactly @var{string}.
@itemx --status
@opindex --status
@cindex verifying MD5 checksums
This option is useful only when verifying checksums.
When verifying checksums, don't generate the default one-line-per-file
diagnostic and don't output the warning summarizing any failures.
Failures to open or read a file still evoke individual diagnostics to
standard error.
If all listed files are readable and are consistent with the associated
MD5 checksums, exit successfully. Otherwise exit with a status code
indicating there was a failure.
@item -t
@itemx --text
@@ -1619,11 +1699,14 @@ result is the same as for a file that contains exactly @var{string}.
Treat all input files as text files. This is the reverse of
@samp{--binary}.
@item -v
@itemx --verbose
@opindex -v
@opindex --verbose
Print progress information.
@item -w
@itemx --warn
@opindex -w
@opindex --warn
@cindex verifying MD5 checksums
When verifying checksums, warn about improperly formated MD5 checksum lines.
This option is useful only if all but a few lines in the checked input
are valid.
@end table
@@ -1669,6 +1752,7 @@ mode:
@cindex checking for sortedness
Check whether the given files are already sorted: if they are not all
sorted, print an error message and exit with a status of 1.
Otherwise, exit successfully.
@item -m
@opindex -m
@@ -1702,6 +1786,8 @@ input line length or restrictions on bytes allowed within lines. In
addition, if the final byte of an input file is not a newline, GNU
@code{sort} silently supplies one.
Upon any error, @code{sort} exits with a status of @samp{2}.
@vindex TMPDIR
If the environment variable @code{TMPDIR} is set, @code{sort} uses its
value as the directory for temporary files instead of @file{/tmp}. The
@@ -1734,6 +1820,18 @@ letters, digits and blanks when sorting.
Fold lowercase characters into the equivalent uppercase characters when
sorting so that, for example, @samp{b} and @samp{B} sort as equal.
@item -g
@opindex -g
@cindex general numeric sort
Sort numerically, but use strtod(3) to arrive at the numeric values.
This allows floating point numbers to be specified in scientific notation,
like @code{1.0e-34} and @code{10e100}. Use this option only if there
is no alternative; it is much slower than @samp{-n} and numbers with
too many significant digits will be compared as if they had been
truncated. In addition, numbers outside the range of representable
double precision floating point numbers are treated as if they were
zeroes; overflow and underflow are not reported.
@item -i
@opindex -i
@cindex unprintable characters, ignoring
@@ -1755,6 +1853,21 @@ Sort numerically: the number begins each line; specifically, it consists
of optional whitespace, an optional @samp{-} sign, and zero or more
digits, optionally followed by a decimal point and zero or more digits.
@code{sort -n} uses what might be considered an unconventional method
to compare strings representing floating point numbers. Rather than
first converting each string to the C @code{double} type and then
comparing those values, sort aligns the decimal points in the two
strings and compares the strings a character at a time. One benefit
of using this approach is its speed. In practice this is much more
efficient than performing the two corresponding string-to-double (or even
string-to-integer) conversions and then comparing doubles. In addition,
there is no corresponding loss of precision. Converting each string to
@code{double} before comparison would limit precision to about 16 digits
on most systems.
Neither a leading @samp{+} nor exponential notation is recognized.
To compare such strings numerically, use the @samp{-g} option.
@item -r
@opindex -r
@cindex reverse sorting
@@ -1796,11 +1909,21 @@ check that no pair of consecutive lines compares equal.
@item -k @var{pos1}[,@var{pos2}]
@opindex -k
@cindex sort field
The recommended, POSIX, option for specifying a sort field. The field
The recommended, @sc{POSIX}, option for specifying a sort field. The field
consists of the line between @var{pos1} and @var{pos2} (or the end of
the line, if @var{pos2} is omitted), inclusive. Fields and character
positions are numbered starting with 1. See below.
@item -z
@opindex -z
@cindex sort zero-terminated lines
Treat the input as a set of lines, each terminated by a zero byte (@sc{ASCII}
@sc{NUL} (Null) character) instead of a @sc{ASCII} @sc{LF} (Line Feed.)
This option can be useful in conjunction with @samp{perl -0} or
@samp{find -print0} and @samp{xargs -0} which do the same in order to
reliably handle arbitrary pathnames (even those which contain Line Feed
characters.)
@item +@var{pos1}[-@var{pos2}]
The obsolete, traditional option for specifying a sort field. The field
consists of the line between @var{pos1} and up to but @emph{not including}
@@ -1815,9 +1938,9 @@ options}.
Historical (BSD and System V) implementations of @code{sort} have
differed in their interpretation of some options, particularly
@samp{-b}, @samp{-f}, and @samp{-n}. GNU sort follows the POSIX
@samp{-b}, @samp{-f}, and @samp{-n}. GNU sort follows the @sc{POSIX}
behavior, which is usually (but not always!) like the System V behavior.
According to POSIX, @samp{-n} no longer implies @samp{-b}. For
According to @sc{POSIX}, @samp{-n} no longer implies @samp{-b}. For
consistency, @samp{-M} has been changed in the same way. This may
affect the meaning of character positions in field specifications in
obscure cases. The only fix is to add an explicit @samp{-b}.
@@ -1838,14 +1961,11 @@ appended to it, in which case the global ordering options are not used
for that particular field. The @samp{-b} option may be independently
attached to either or both of the @samp{+@var{pos}} and
@samp{-@var{pos}} parts of a field specification, and if it is inherited
from the global options it will be attached to both. If a @samp{-n} or
@samp{-M} option is used, thus implying a @samp{-b} option, the
@samp{-b} option is taken to apply to both the @samp{+@var{pos}} and the
@samp{-@var{pos}} parts of a key specification. Keys may span multiple
fields.
from the global options it will be attached to both.
Keys may span multiple fields.
Here are some examples to illustrate various combinations of options.
In them, the POSIX @samp{-k} option is used to specify sort keys rather
In them, the @sc{POSIX} @samp{-k} option is used to specify sort keys rather
than the obsolete @samp{+@var{pos1}-@var{pos2}} syntax.
@itemize @bullet
@@ -1902,6 +2022,16 @@ An alternative is to use the global numeric modifier @samp{-n}.
sort -t : -n -k 5b,5 -k 3,3 /etc/passwd
@end example
@item
Generate a tags file in case insensitive sorted order.
@example
find src -type f -print0 | sort -t / -z -f | xargs -0 etags --append
@end example
The use of @samp{-print0}, @samp{-z}, and @samp{-0} in this case mean
that pathnames that contain Line Feed characters will not get broken up
by the sort operation.
Finally, to ignore both leading and trailing white space, you
could have applied the @samp{b} modifier to the field-end specifier
for the first key,
@@ -1974,6 +2104,12 @@ the field and character skipping options, fields are skipped over first.
@opindex --count
Print the number of times each line occurred along with the line.
@item -i
@itemx --ignore-case
@opindex -i
@opindex --ignore-case
Ignore differences in case when comparing lines.
@item -d
@itemx --repeated
@opindex -d
@@ -2021,6 +2157,9 @@ The input files must be sorted before @code{comm} can be used.
With no options, @code{comm} produces three column output. Column one
contains lines unique to @var{file1}, column two contains lines unique
to @var{file2}, and column three contains lines common to both files.
Columns are separated by @key{TAB}.
@c FIXME: when there's an option to supply an alternative separator
@c string, append `by default' to the above sentence.
@opindex -1
@opindex -2
@@ -2095,7 +2234,7 @@ For @samp{-f}, fields are separated by the first character in @var{delim}
@item -n
@opindex -n
Do not split multibyte characters (no-op for now).
Do not split multi-byte characters (no-op for now).
@item -s
@itemx --only-delimited
@@ -2163,7 +2302,9 @@ Either @var{file1} or @var{file2} (but not both) can be @samp{-},
meaning standard input. @var{file1} and @var{file2} should be already
sorted in increasing order (not numerically) on the join fields; unless
the @samp{-t} option is given, they should be sorted ignoring blanks at
the start of the line, as in @code{sort -b}.
the start of the join field, as in @code{sort -b}. If the
@samp{--ignore-case} option is given, lines should be sorted without
regard to the case of characters in the join field, as in @code{sort -f}.
The defaults are: the join field is the first field in each line;
fields in the input are separated by one or more blanks, with leading
@@ -2185,6 +2326,14 @@ Print a line for each unpairable line in file @var{file-number} (either
Replace those output fields that are missing in the input with
@var{string}.
@item -i
@itemx --ignore-case
@opindex -i
@opindex --ignore-case
Ignore differences in case when comparing keys.
With this option, the lines of the input files must be ordered in the same way.
Use @samp{sort -f} to produce this ordering.
@item -1 @var{field}
@itemx -j1 @var{field}
@opindex -1
@@ -2202,18 +2351,33 @@ Equivalent to @samp{-1 @var{field} -2 @var{field}}.
@item -o @var{field-list}@dots{}
Construct each output line according to the format in @var{field-list}.
Each element in @var{field-list} consists of a file number (either 1 or
2), a period, and a field number (a positive integer). The elements in
the list are separated by commas or blanks. Multiple @var{field-list}
Each element in @var{field-list} is either the single character @samp{0} or
has the form @var{m.n} where the file number, @var{m}, is @samp{1} or
@samp{2} and @var{n} is a positive field number.
A field specification of @samp{0} denotes the join field.
In most cases, the functionality of the @samp{0} field spec
may be reproduced using the explicit @var{m.n} that corresponds
to the join field. However, when printing unpairable lines
(using either of the @samp{-a} or @samp{-v} options), there is no way
to specify the join field using @var{m.n} in @var{field-list}
if there are unpairable lines in both files.
To give @code{join} that functionality, @sc{POSIX} invented the @samp{0}
field specification notation.
The elements in @var{field-list}
are separated by commas or blanks. Multiple @var{field-list}
arguments can be given after a single @samp{-o} option; the values
of all lists given with @samp{-o} are concatenated together.
All output lines -- including those printed because of any -a or -v
option -- are subject to the specified @var{field-list}.
@item -t @var{char}
Use character @var{char} as the input and output field separator.
@item -v @var{file-number}
Print a line for each unpairable line in file @var{file-number}
(either 1 or 2), instead of the normal output.
(either @samp{1} or @samp{2}), instead of the normal output.
@end table
@@ -2441,7 +2605,7 @@ typically have the same length. If @var{set1} is shorter than
@var{set2}, the extra characters at the end of @var{set2} are ignored.
On the other hand, making @var{set1} longer than @var{set2} is not
portable; POSIX.2 says that the result is undefined. In this situation,
portable; @sc{POSIX.2} says that the result is undefined. In this situation,
BSD @code{tr} pads @var{set2} to the length of @var{set1} by repeating
the last character of @var{set2} as many times as necessary. System V
@code{tr} truncates @var{set1} to the length of @var{set2}.
@@ -2521,7 +2685,7 @@ tr -s '\n'
@vindex POSIXLY_CORRECT
Setting the environment variable @code{POSIXLY_CORRECT} turns off the
following warning and error messages, for strict compliance with
POSIX.2. Otherwise, the following diagnostics are issued:
@sc{POSIX.2}. Otherwise, the following diagnostics are issued:
@enumerate
@@ -2529,7 +2693,7 @@ POSIX.2. Otherwise, the following diagnostics are issued:
When the @samp{--delete} option is given but @samp{--squeeze-repeats}
is not, and @var{set2} is given, GNU @code{tr} by default prints
a usage message and exits, because @var{set2} would not be used.
The POSIX specification says that @var{set2} must be ignored in
The @sc{POSIX} specification says that @var{set2} must be ignored in
this case. Silently ignoring arguments is a bad idea.
@item
@@ -2540,7 +2704,7 @@ value 400 octal does not fit into a single byte.
@end enumerate
GNU @code{tr} does not provide complete BSD or System V compatibility.
For example, it is impossible to disable interpretation of the POSIX
For example, it is impossible to disable interpretation of the @sc{POSIX}
constructs @samp{[:alpha:]}, @samp{[=c=]}, and @samp{[c*10]}. Also, GNU
@code{tr} does not delete zero bytes automatically, unlike traditional
Unix versions, which provide no way to preserve zero bytes.
@@ -2644,8 +2808,8 @@ ones, to tabs.
@end table
@c What's GNU?
@c Arnold Robbins
@c What's GNU?
@c Arnold Robbins
@node Opening the software toolbox
@chapter Opening the software toolbox
@@ -3199,7 +3363,7 @@ much more efficient and do more than these programs do. Nevertheless, as
exposition of good programming style, and evangelism for a still-valuable
philosophy, these books are unparalleled, and I recommend them highly.
Acknowledgement: I would like to express my gratitude to Brian Kernighan
Acknowledgment: I would like to express my gratitude to Brian Kernighan
of Bell Labs, the original Software Toolsmith, for reviewing this column.

View File

@@ -5,3 +5,5 @@ safe-stat.h
safe-stat.c
safe-lstat.c
safe-lstat.h
getdate.tab.c
.deps

25
lib/Makefile.am Normal file
View File

@@ -0,0 +1,25 @@
## Process this file with automake to produce Makefile.in
noinst_LIBRARIES = libfu.a
## FIXME: Remove mvdir.c, and rmdir.c when
## automake is fixed -- probably for 1.1g
EXTRA_DIST = mkdir.c rmdir.c getline.c mktime.c strftime.c
INCLUDES = -I.. -I$(srcdir) -I../intl
libfu_a_SOURCES = getdate.y posixtm.y getopt.c getopt1.c \
argmatch.c backupfile.c dirname.c filemode.c \
full-write.c getversion.c idcache.c \
isdir.c long-options.c makepath.c modechange.c path-concat.c \
safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
xmalloc.c xstrdup.c xstrtol.c xstrtoul.c yesno.c
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
noinst_HEADERS = argmatch.h backupfile.h error.h fnmatch.h fsusage.h \
getline.h getopt.h group-member.h long-options.h makepath.h modechange.h \
mountlist.h path-concat.h pathmax.h \
save-cwd.h xstrtol.h xstrtoul.h
BUILT_SOURCES = getdate.c posixtm.c

View File

@@ -1,142 +1,296 @@
# Makefile for library files used by GNU file utilities.
# Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
# Makefile.in generated automatically by automake 1.1l from Makefile.am
# 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.
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
SHELL = /bin/sh
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
CC = @CC@
AR = ar
RANLIB = @RANLIB@
DEFS = @DEFS@
CFLAGS = @CFLAGS@
YACC = @YACC@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = $(exec_prefix)/lib
SOURCES = getdate.y posixtm.y \
argmatch.c backupfile.c basename.c dirname.c euidaccess.c \
error.c filemode.c fsusage.c full-write.c getopt.c getopt1.c \
getversion.c group-member.c idcache.c isdir.c makepath.c \
modechange.c mountlist.c obstack.c safe-read.c savedir.c \
stripslash.c xgetcwd.c xmalloc.c xstrdup.c userspec.c yesno.c \
fileblocks.c fnmatch.c ftruncate.c mkdir.c mktime.c rename.c rmdir.c \
save-cwd.c stpcpy.c \
strdup.c strstr.c strtol.c alloca.c long-options.c \
memcmp.c memcpy.c memset.c xstrtol.c xstrtoul.c
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
OBJECTS = getdate.o posixtm.o \
argmatch.o backupfile.o basename.o dirname.o \
error.o filemode.o full-write.o getopt.o getopt1.o \
getversion.o group-member.o idcache.o isdir.o long-options.o makepath.o \
modechange.o obstack.o safe-read.o save-cwd.o savedir.o \
stripslash.o xgetcwd.o xmalloc.o xstrdup.o userspec.o yesno.o \
xstrtol.o xstrtoul.o @LIBOBJS@ @ALLOCA@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
DISTFILES = Makefile.in backupfile.h getopt.h long-options.h modechange.h \
fnmatch.h fsusage.h group-member.h makepath.h mountlist.h obstack.h pathmax.h \
save-cwd.h getdate.c posixtm.c error.h xstrtol.h xstrtoul.h $(SOURCES)
top_builddir = ..
all: libfu.a
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
YACC = @YACC@
GENCAT = @GENCAT@
PERL = @PERL@
MV = @MV@
GMSGFMT = @GMSGFMT@
CC = @CC@
RANLIB = @RANLIB@
LN = @LN@
RM = @RM@
noinst_LIBRARIES = libfu.a
EXTRA_DIST = mkdir.c rmdir.c getline.c mktime.c strftime.c
INCLUDES = -I.. -I$(srcdir) -I../intl
libfu_a_SOURCES = getdate.y posixtm.y getopt.c getopt1.c \
argmatch.c backupfile.c dirname.c filemode.c \
full-write.c getversion.c idcache.c \
isdir.c long-options.c makepath.c modechange.c path-concat.c \
safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
xmalloc.c xstrdup.c xstrtol.c xstrtoul.c yesno.c
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
noinst_HEADERS = argmatch.h backupfile.h error.h fnmatch.h fsusage.h \
getline.h getopt.h group-member.h long-options.h makepath.h modechange.h \
mountlist.h path-concat.h pathmax.h \
save-cwd.h xstrtol.h xstrtoul.h
BUILT_SOURCES = getdate.c posixtm.c
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@
libfu_a_OBJECTS = getdate.o posixtm.o getopt.o getopt1.o argmatch.o \
backupfile.o dirname.o filemode.o full-write.o getversion.o idcache.o \
isdir.o long-options.o makepath.o modechange.o path-concat.o \
safe-read.o save-cwd.o savedir.o stripslash.o userspec.o xgetcwd.o \
xmalloc.o xstrdup.o xstrtol.o xstrtoul.o yesno.o
AR = ar
INTERLOCK = ./interlock
YLWRAP = ./ylwrap
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(CC) $(LDFLAGS) -o $@
HEADERS = $(noinst_HEADERS)
DIST_COMMON = Makefile.am Makefile.in alloca.c basename.c error.c \
error.h euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c \
getdate.c getline.c getloadavg.c group-member.c interlock memcmp.c \
memcpy.c memset.c mkdir.c mktime.c mountlist.c obstack.c obstack.h \
posixtm.c regex.c regex.h rename.c rmdir.c rpmatch.c rx.c rx.h stpcpy.c \
strcasecmp.c strdup.c strftime.c strndup.c strstr.c strtol.c strtoul.c \
ylwrap
PACKAGE = @PACKAGE@
VERSION = @VERSION@
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) \
$(TEXINFOS) $(MANS) $(EXTRA_DIST)
TAR = tar
DEP_FILES = .deps/alloca.P .deps/argmatch.P .deps/backupfile.P \
.deps/basename.P .deps/dirname.P .deps/error.P .deps/euidaccess.P \
.deps/fileblocks.P .deps/filemode.P .deps/fnmatch.P .deps/fsusage.P \
.deps/ftruncate.P .deps/full-write.P .deps/getdate.P .deps/getline.P \
.deps/getloadavg.P .deps/getopt.P .deps/getopt1.P .deps/getversion.P \
.deps/group-member.P .deps/idcache.P .deps/isdir.P .deps/long-options.P \
.deps/makepath.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/regex.P \
.deps/rename.P .deps/rmdir.P .deps/rpmatch.P .deps/rx.P \
.deps/safe-read.P .deps/save-cwd.P .deps/savedir.P .deps/stpcpy.P \
.deps/strcasecmp.P .deps/strdup.P .deps/strftime.P .deps/stripslash.P \
.deps/strndup.P .deps/strstr.P .deps/strtol.P .deps/strtoul.P \
.deps/userspec.P .deps/xgetcwd.P .deps/xmalloc.P .deps/xstrdup.P \
.deps/xstrtol.P .deps/xstrtoul.P .deps/yesno.P
SOURCES = $(libfu_a_SOURCES)
OBJECTS = $(libfu_a_OBJECTS)
default: all
.SUFFIXES:
.SUFFIXES: .c .o
.SUFFIXES: .c .o .y
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL)
cd $(top_srcdir) && automake --gnu lib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
mostlyclean-noinstLIBRARIES:
clean-noinstLIBRARIES:
test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
distclean-noinstLIBRARIES:
maintainer-clean-noinstLIBRARIES:
.c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) -I.. -I$(srcdir) $(CFLAGS) $<
$(COMPILE) -c $<
mostlyclean-compile:
rm -f *.o core
clean-compile:
distclean-compile:
rm -f *.tab.c
maintainer-clean-compile:
$(libfu_a_OBJECTS): ../config.h
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
.y.c:
$(SHELL) $(INTERLOCK) =yacclockdir $(YLWRAP) "$(YACC)" y.tab.c $*.c y.tab.h $*.h -- $(YFLAGS) $<
tags: TAGS
ID: $(HEADERS) $(SOURCES)
here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES)
tags=; \
here=`pwd`; \
list="$(SUBDIRS)"; for subdir in $$list; do \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
done; \
test -z "$(ETAGS_ARGS)$(SOURCES)$(HEADERS)$$tags" \
|| cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $(SOURCES) $(HEADERS) -o $$here/TAGS
mostlyclean-tags:
clean-tags:
distclean-tags:
rm -f TAGS ID
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = lib
Makefile: ../config.status Makefile.in
cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
installdirs:
install install-exec install-data: all
uninstall:
TAGS: $(SOURCES)
etags $(SOURCES)
check:
clean:
rm -f *.a *.o
mostlyclean: clean
distclean: clean
rm -f Makefile *.tab.c tposixtm.c
maintainer-clean: distclean
rm -f TAGS getdate.c posixtm.c
distdir = ../`cat ../distname`/$(subdir)
dist: $(DISTFILES)
for file in $(DISTFILES); do \
ln $$file $(distdir) \
|| { echo copying $$file instead; cp -p $$file $(distdir);}; \
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
libfu.a: $(OBJECTS)
rm -f $@
$(AR) cr $@ $(OBJECTS)
-$(RANLIB) $@
MKDEP = gcc -M $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
# Since this directory contains two parsers, we have to be careful to avoid
# running two $(YACC)s during parallel makes. See below.
getdate.c: getdate.y
@echo expect 10 shift/reduce conflicts
$(YACC) $(srcdir)/getdate.y
mv y.tab.c getdate.c
-include .deps/.P
.deps/.P:
test -d .deps || mkdir .deps
echo > $@
# Make the rename atomic, in case sed is interrupted and later rerun.
# The artificial dependency on getdate.c keeps the two parsers from being
# built in parallel. Enforcing this little bit of sequentiality lets
# everyone (even those without bison) still run mostly parallel builds.
posixtm.c: posixtm.y getdate.c
$(YACC) $(srcdir)/posixtm.y
mv y.tab.c posixtm.tab.c
sed -e 's/yy/zz/g' posixtm.tab.c > tposixtm.c
mv tposixtm.c posixtm.c
rm -f posixtm.tab.c
-include $(DEP_FILES)
$(DEP_FILES): .deps/.P
rename.o: rename.c
$(CC) -c $(CPPFLAGS) -DMVDIR="\"$(libdir)/mvdir\"" $(DEFS) \
-I.. -I$(srcdir) $(CFLAGS) $(srcdir)/rename.c
mostlyclean-depend:
$(OBJECTS): ../config.h
clean-depend:
backupfile.o getversion.o: backupfile.h
fnmatch.o: fnmatch.h
fsusage.o: fsusage.h
getopt1.o: getopt.h
modechange.o: modechange.h
mountlist.o: mountlist.h
xgetcwd.o: pathmax.h
makepath.o: makepath.h
obstack.o: obstack.h
group-member.o: group-member.h
distclean-depend:
.PHONY: all check clean dist distclean install install-data install-exec \
installdirs maintainer-clean mostlyclean uninstall
maintainer-clean-depend:
rm -rf .deps
# Tell versions [3.59,3.63) of GNU make not to export all variables.
.deps/%.P: $(srcdir)/%.c
@echo "Computing dependencies for $<..."
@o='o'; \
test -n "$o" && o='$$o'; \
$(MKDEP) $< | sed "s/^\(.*\)\.o:/\1.$$o \1.l$$o:/" > $@
info:
dvi:
check: all
$(MAKE)
installcheck:
install-exec:
$(NORMAL_INSTALL)
install-data:
$(NORMAL_INSTALL)
install: install-exec install-data all
@:
uninstall:
all: $(LIBRARIES) $(BUILT_SOURCES) $(HEADERS) Makefile
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
installdirs:
mostlyclean-generic:
test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
rm -f Makefile $(DISTCLEANFILES)
rm -f config.cache config.log stamp-h
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
clean: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
clean-generic mostlyclean
distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \
distclean-depend distclean-generic clean
rm -f config.status
maintainer-clean: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-tags \
maintainer-clean-depend maintainer-clean-generic \
distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
.PHONY: default mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile tags mostlyclean-tags distclean-tags \
clean-tags maintainer-clean-tags distdir mostlyclean-depend \
distclean-depend clean-depend maintainer-clean-depend info dvi \
installcheck install-exec install-data install uninstall all \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@@ -1,37 +1,42 @@
/*
alloca -- (mostly) portable public-domain implementation -- D A Gwyn
/* alloca.c -- allocate automatically reclaimed memory
(Mostly) portable public-domain implementation -- D A Gwyn
last edit: 86/05/30 rms
include config.h, since on VMS it renames some symbols.
Use xmalloc instead of malloc.
This implementation of the PWB library alloca function,
which is used to allocate space off the run-time stack so
that it is automatically reclaimed upon procedure exit,
was inspired by discussions with J. Q. Johnson of Cornell.
J.Otto Tennant <jot@cray.com> contributed the Cray support.
This implementation of the PWB library alloca() function,
which is used to allocate space off the run-time stack so
that it is automatically reclaimed upon procedure exit,
was inspired by discussions with J. Q. Johnson of Cornell.
There are some preprocessor constants that can
be defined when compiling for your specific system, for
improved efficiency; however, the defaults should be okay.
It should work under any C implementation that uses an
actual procedure stack (as opposed to a linked list of
frames). There are some preprocessor constants that can
be defined when compiling for your specific system, for
improved efficiency; however, the defaults should be okay.
The general concept of this implementation is to keep
track of all alloca-allocated blocks, and reclaim any
that are found to be deeper in the stack than the current
invocation. This heuristic does not reclaim storage as
soon as it becomes invalid, but it will do so eventually.
The general concept of this implementation is to keep
track of all alloca()-allocated blocks, and reclaim any
that are found to be deeper in the stack than the current
invocation. This heuristic does not reclaim storage as
soon as it becomes invalid, but it will do so eventually.
As a special case, alloca(0) reclaims storage without
allocating any. It is a good idea to use alloca(0) in
your main control loop, etc. to force garbage collection. */
As a special case, alloca(0) reclaims storage without
allocating any. It is a good idea to use alloca(0) in
your main control loop, etc. to force garbage collection.
*/
#ifndef lint
static char SCCSid[] = "@(#)alloca.c 1.1"; /* for the "what" utility */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef emacs
#include "config.h"
#include "blockinput.h"
#endif
/* If compiling with GCC 2, this file's not needed. */
#if !defined (__GNUC__) || __GNUC__ < 2
/* If someone has defined alloca as a macro,
there must be some other way alloca is supposed to work. */
#ifndef alloca
#ifdef emacs
#ifdef static
/* actually, only want this if static is defined as ""
-- this is for usg, in which emacs must undefine static
@@ -45,72 +50,90 @@ lose
#endif /* static */
#endif /* emacs */
#ifndef alloca /* If compiling with GCC, this file's not needed. */
/* If your stack is a linked list of frames, you have to
provide an "address metric" ADDRESS_FUNCTION macro. */
#ifdef __STDC__
typedef void *pointer; /* generic pointer type */
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
long i00afunc ();
#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
#else
typedef char *pointer; /* generic pointer type */
#define ADDRESS_FUNCTION(arg) &(arg)
#endif
#define NULL 0 /* null pointer constant */
#if __STDC__
typedef void *pointer;
#else
typedef char *pointer;
#endif
extern void free();
extern pointer xmalloc();
#define NULL 0
/*
Define STACK_DIRECTION if you know the direction of stack
growth for your system; otherwise it will be automatically
deduced at run-time.
/* Different portions of Emacs need to call different versions of
malloc. The Emacs executable needs alloca to call xmalloc, because
ordinary malloc isn't protected from input signals. On the other
hand, the utilities in lib-src need alloca to call malloc; some of
them are very simple, and don't have an xmalloc routine.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
Non-Emacs programs expect this to call xmalloc.
Callers below should use malloc. */
#ifndef emacs
#define malloc xmalloc
#endif
extern pointer malloc ();
/* Define STACK_DIRECTION if you know the direction of stack
growth for your system; otherwise it will be automatically
deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
#ifndef STACK_DIRECTION
#define STACK_DIRECTION 0 /* direction unknown */
#define STACK_DIRECTION 0 /* Direction unknown. */
#endif
#if STACK_DIRECTION != 0
#define STACK_DIR STACK_DIRECTION /* known at compile-time */
#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
#else /* STACK_DIRECTION == 0; need run-time code */
#else /* STACK_DIRECTION == 0; need run-time code. */
static int stack_dir; /* 1 or -1 once known */
static int stack_dir; /* 1 or -1 once known. */
#define STACK_DIR stack_dir
static void
find_stack_direction (/* void */)
find_stack_direction ()
{
static char *addr = NULL; /* address of first
`dummy', once known */
auto char dummy; /* to get stack address */
static char *addr = NULL; /* Address of first `dummy', once known. */
auto char dummy; /* To get stack address. */
if (addr == NULL)
{ /* initial entry */
addr = &dummy;
{ /* Initial entry. */
addr = ADDRESS_FUNCTION (dummy);
find_stack_direction (); /* recurse once */
find_stack_direction (); /* Recurse once. */
}
else
{
/* Second entry. */
if (ADDRESS_FUNCTION (dummy) > addr)
stack_dir = 1; /* Stack grew upward. */
else
stack_dir = -1; /* Stack grew downward. */
}
else /* second entry */
if (&dummy > addr)
stack_dir = 1; /* stack grew upward */
else
stack_dir = -1; /* stack grew downward */
}
#endif /* STACK_DIRECTION == 0 */
#endif /* STACK_DIRECTION == 0 */
/*
An "alloca header" is used to:
(a) chain together all alloca()ed blocks;
(b) keep track of stack depth.
/* An "alloca header" is used to:
(a) chain together all alloca'ed blocks;
(b) keep track of stack depth.
It is very important that sizeof(header) agree with malloc()
alignment chunk size. The following default should work okay.
*/
It is very important that sizeof(header) agree with malloc
alignment chunk size. The following default should work okay. */
#ifndef ALIGN_SIZE
#define ALIGN_SIZE sizeof(double)
@@ -118,77 +141,352 @@ find_stack_direction (/* void */)
typedef union hdr
{
char align[ALIGN_SIZE]; /* to force sizeof(header) */
char align[ALIGN_SIZE]; /* To force sizeof(header). */
struct
{
union hdr *next; /* for chaining headers */
char *deep; /* for stack depth measure */
union hdr *next; /* For chaining headers. */
char *deep; /* For stack depth measure. */
} h;
} header;
/*
alloca( size ) returns a pointer to at least `size' bytes of
storage which will be automatically reclaimed upon exit from
the procedure that called alloca(). Originally, this space
was supposed to be taken from the current stack frame of the
caller, but that method cannot be made to work for some
implementations of C, for example under Gould's UTX/32.
*/
static header *last_alloca_header = NULL; /* -> last alloca header. */
static header *last_alloca_header = NULL; /* -> last alloca header */
/* Return a pointer to at least SIZE bytes of storage,
which will be automatically reclaimed upon exit from
the procedure that called alloca. Originally, this space
was supposed to be taken from the current stack frame of the
caller, but that method cannot be made to work for some
implementations of C, for example under Gould's UTX/32. */
pointer
alloca (size) /* returns pointer to storage */
unsigned size; /* # bytes to allocate */
alloca (size)
unsigned size;
{
auto char probe; /* probes stack depth: */
register char *depth = &probe;
auto char probe; /* Probes stack depth: */
register char *depth = ADDRESS_FUNCTION (probe);
#if STACK_DIRECTION == 0
if (STACK_DIR == 0) /* unknown growth direction */
if (STACK_DIR == 0) /* Unknown growth direction. */
find_stack_direction ();
#endif
/* Reclaim garbage, defined as all alloca()ed storage that
was allocated from deeper in the stack than currently. */
/* Reclaim garbage, defined as all alloca'd storage that
was allocated from deeper in the stack than currently. */
{
register header *hp; /* traverses linked list */
register header *hp; /* Traverses linked list. */
#ifdef emacs
BLOCK_INPUT;
#endif
for (hp = last_alloca_header; hp != NULL;)
if ((STACK_DIR > 0 && hp->h.deep > depth)
|| (STACK_DIR < 0 && hp->h.deep < depth))
{
register header *np = hp->h.next;
register header *np = hp->h.next;
free ((pointer) hp); /* collect garbage */
free ((pointer) hp); /* Collect garbage. */
hp = np; /* -> next header */
hp = np; /* -> next header. */
}
else
break; /* rest are not deeper */
break; /* Rest are not deeper. */
last_alloca_header = hp; /* -> last valid storage */
last_alloca_header = hp; /* -> last valid storage. */
#ifdef emacs
UNBLOCK_INPUT;
#endif
}
if (size == 0)
return NULL; /* no allocation required */
return NULL; /* No allocation required. */
/* Allocate combined header + user data storage. */
/* Allocate combined header + user data storage. */
{
register pointer new = xmalloc (sizeof (header) + size);
/* address of header */
register pointer new = malloc (sizeof (header) + size);
/* Address of header. */
((header *)new)->h.next = last_alloca_header;
((header *)new)->h.deep = depth;
((header *) new)->h.next = last_alloca_header;
((header *) new)->h.deep = depth;
last_alloca_header = (header *)new;
last_alloca_header = (header *) new;
/* User storage begins just after header. */
/* User storage begins just after header. */
return (pointer)((char *)new + sizeof(header));
return (pointer) ((char *) new + sizeof (header));
}
}
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
#ifdef DEBUG_I00AFUNC
#include <stdio.h>
#endif
#ifndef CRAY_STACK
#define CRAY_STACK
#ifndef CRAY2
/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
struct stack_control_header
{
long shgrow:32; /* Number of times stack has grown. */
long shaseg:32; /* Size of increments to stack. */
long shhwm:32; /* High water mark of stack. */
long shsize:32; /* Current size of stack (all segments). */
};
/* The stack segment linkage control information occurs at
the high-address end of a stack segment. (The stack
grows from low addresses to high addresses.) The initial
part of the stack segment linkage control information is
0200 (octal) words. This provides for register storage
for the routine which overflows the stack. */
struct stack_segment_linkage
{
long ss[0200]; /* 0200 overflow words. */
long sssize:32; /* Number of words in this segment. */
long ssbase:32; /* Offset to stack base. */
long:32;
long sspseg:32; /* Offset to linkage control of previous
segment of stack. */
long:32;
long sstcpt:32; /* Pointer to task common address block. */
long sscsnm; /* Private control structure number for
microtasking. */
long ssusr1; /* Reserved for user. */
long ssusr2; /* Reserved for user. */
long sstpid; /* Process ID for pid based multi-tasking. */
long ssgvup; /* Pointer to multitasking thread giveup. */
long sscray[7]; /* Reserved for Cray Research. */
long ssa0;
long ssa1;
long ssa2;
long ssa3;
long ssa4;
long ssa5;
long ssa6;
long ssa7;
long sss0;
long sss1;
long sss2;
long sss3;
long sss4;
long sss5;
long sss6;
long sss7;
};
#else /* CRAY2 */
/* The following structure defines the vector of words
returned by the STKSTAT library routine. */
struct stk_stat
{
long now; /* Current total stack size. */
long maxc; /* Amount of contiguous space which would
be required to satisfy the maximum
stack demand to date. */
long high_water; /* Stack high-water mark. */
long overflows; /* Number of stack overflow ($STKOFEN) calls. */
long hits; /* Number of internal buffer hits. */
long extends; /* Number of block extensions. */
long stko_mallocs; /* Block allocations by $STKOFEN. */
long underflows; /* Number of stack underflow calls ($STKRETN). */
long stko_free; /* Number of deallocations by $STKRETN. */
long stkm_free; /* Number of deallocations by $STKMRET. */
long segments; /* Current number of stack segments. */
long maxs; /* Maximum number of stack segments so far. */
long pad_size; /* Stack pad size. */
long current_address; /* Current stack segment address. */
long current_size; /* Current stack segment size. This
number is actually corrupted by STKSTAT to
include the fifteen word trailer area. */
long initial_address; /* Address of initial segment. */
long initial_size; /* Size of initial segment. */
};
/* The following structure describes the data structure which trails
any stack segment. I think that the description in 'asdef' is
out of date. I only describe the parts that I am sure about. */
struct stk_trailer
{
long this_address; /* Address of this block. */
long this_size; /* Size of this block (does not include
this trailer). */
long unknown2;
long unknown3;
long link; /* Address of trailer block of previous
segment. */
long unknown5;
long unknown6;
long unknown7;
long unknown8;
long unknown9;
long unknown10;
long unknown11;
long unknown12;
long unknown13;
long unknown14;
};
#endif /* CRAY2 */
#endif /* not CRAY_STACK */
#ifdef CRAY2
/* Determine a "stack measure" for an arbitrary ADDRESS.
I doubt that "lint" will like this much. */
static long
i00afunc (long *address)
{
struct stk_stat status;
struct stk_trailer *trailer;
long *block, size;
long result = 0;
/* We want to iterate through all of the segments. The first
step is to get the stack status structure. We could do this
more quickly and more directly, perhaps, by referencing the
$LM00 common block, but I know that this works. */
STKSTAT (&status);
/* Set up the iteration. */
trailer = (struct stk_trailer *) (status.current_address
+ status.current_size
- 15);
/* There must be at least one stack segment. Therefore it is
a fatal error if "trailer" is null. */
if (trailer == 0)
abort ();
/* Discard segments that do not contain our argument address. */
while (trailer != 0)
{
block = (long *) trailer->this_address;
size = trailer->this_size;
if (block == 0 || size == 0)
abort ();
trailer = (struct stk_trailer *) trailer->link;
if ((block <= address) && (address < (block + size)))
break;
}
/* Set the result to the offset in this segment and add the sizes
of all predecessor segments. */
result = address - block;
if (trailer == 0)
{
return result;
}
do
{
if (trailer->this_size <= 0)
abort ();
result += trailer->this_size;
trailer = (struct stk_trailer *) trailer->link;
}
while (trailer != 0);
/* We are done. Note that if you present a bogus address (one
not in any segment), you will get a different number back, formed
from subtracting the address of the first block. This is probably
not what you want. */
return (result);
}
#else /* not CRAY2 */
/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
Determine the number of the cell within the stack,
given the address of the cell. The purpose of this
routine is to linearize, in some sense, stack addresses
for alloca. */
static long
i00afunc (long address)
{
long stkl = 0;
long size, pseg, this_segment, stack;
long result = 0;
struct stack_segment_linkage *ssptr;
/* Register B67 contains the address of the end of the
current stack segment. If you (as a subprogram) store
your registers on the stack and find that you are past
the contents of B67, you have overflowed the segment.
B67 also points to the stack segment linkage control
area, which is what we are really interested in. */
stkl = CRAY_STACKSEG_END ();
ssptr = (struct stack_segment_linkage *) stkl;
/* If one subtracts 'size' from the end of the segment,
one has the address of the first word of the segment.
If this is not the first segment, 'pseg' will be
nonzero. */
pseg = ssptr->sspseg;
size = ssptr->sssize;
this_segment = stkl - size;
/* It is possible that calling this routine itself caused
a stack overflow. Discard stack segments which do not
contain the target address. */
while (!(this_segment <= address && address <= stkl))
{
#ifdef DEBUG_I00AFUNC
fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
#endif
if (pseg == 0)
break;
stkl = stkl - pseg;
ssptr = (struct stack_segment_linkage *) stkl;
size = ssptr->sssize;
pseg = ssptr->sspseg;
this_segment = stkl - size;
}
result = address - this_segment;
/* If you subtract pseg from the current end of the stack,
you get the address of the previous stack segment's end.
This seems a little convoluted to me, but I'll bet you save
a cycle somewhere. */
while (pseg != 0)
{
#ifdef DEBUG_I00AFUNC
fprintf (stderr, "%011o %011o\n", pseg, size);
#endif
stkl = stkl - pseg;
ssptr = (struct stack_segment_linkage *) stkl;
size = ssptr->sssize;
pseg = ssptr->sspseg;
result += size;
}
return (result);
}
#endif /* not CRAY2 */
#endif /* CRAY */
#endif /* no alloca */
#endif /* not GCC version 2 */

View File

@@ -12,20 +12,20 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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 David MacKenzie <djm@ai.mit.edu> */
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif
#include <sys/types.h>
#include <stdio.h>
#ifdef STDC_HEADERS
#include <string.h>
# include <string.h>
#endif
extern char *program_name;
@@ -37,8 +37,8 @@ extern char *program_name;
int
argmatch (arg, optlist)
char *arg;
char **optlist;
const char *arg;
const char *const *optlist;
{
int i; /* Temporary index in OPTLIST. */
size_t arglen; /* Length of ARG. */
@@ -76,8 +76,8 @@ argmatch (arg, optlist)
void
invalid_arg (kind, value, problem)
char *kind;
char *value;
const char *kind;
const char *value;
int problem;
{
fprintf (stderr, "%s: ", program_name);

18
lib/argmatch.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef ARGMATCH_H
#define ARGMATCH_H 1
#ifndef __P
# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
# define __P(args) args
# else
# define __P(args) ()
# endif /* GCC. */
#endif /* Not __P. */
int
argmatch __P ((const char *arg, const char *const *optlist));
void
invalid_arg __P ((const char *kind, const char *value, int problem));
#endif /* ARGMATCH_H */

View File

@@ -12,8 +12,8 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* David MacKenzie <djm@gnu.ai.mit.edu>.
Some algorithms adapted from GNU Emacs. */
@@ -63,12 +63,12 @@ char *malloc ();
#endif
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
# define ISASCII(c) 1
# define IN_CTYPE_DOMAIN(c) 1
#else
# define ISASCII(c) isascii(c)
# define IN_CTYPE_DOMAIN(c) isascii(c)
#endif
#define ISDIGIT(c) (ISASCII ((unsigned char) (c)) \
#define ISDIGIT(c) (IN_CTYPE_DOMAIN ((unsigned char) (c)) \
&& isdigit ((unsigned char) (c)))
#if defined (HAVE_UNISTD_H)
@@ -105,7 +105,7 @@ static int version_number ();
char *
find_backup_file_name (file)
char *file;
const char *file;
{
char *dir;
char *base_versions;
@@ -137,13 +137,14 @@ find_backup_file_name (file)
static int
max_backup_version (file, dir)
char *file, *dir;
const char *file;
const char *dir;
{
DIR *dirp;
struct dirent *dp;
int highest_version;
int this_version;
int file_name_length;
size_t file_name_length;
dirp = opendir (dir);
if (!dirp)
@@ -171,7 +172,7 @@ max_backup_version (file, dir)
static char *
make_version_name (file, version)
char *file;
const char *file;
int version;
{
char *backup_name;
@@ -189,12 +190,12 @@ make_version_name (file, version)
static int
version_number (base, backup, base_length)
char *base;
char *backup;
const char *base;
const char *backup;
int base_length;
{
int version;
char *p;
const char *p;
version = 0;
if (!strncmp (base, backup, base_length) && ISDIGIT (backup[base_length]))
@@ -212,7 +213,8 @@ version_number (base, backup, base_length)
static char *
concat (str1, str2)
char *str1, *str2;
const char *str1;
const char *str2;
{
char *newstr;
int str1_length = strlen (str1);

View File

@@ -12,8 +12,8 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* When to make backup files. */
enum backup_type
@@ -36,7 +36,7 @@ extern enum backup_type backup_type;
extern char *simple_backup_suffix;
#ifdef __STDC__
char *find_backup_file_name (char *file);
char *find_backup_file_name (const char *file);
#else
char *find_backup_file_name ();
#endif

View File

@@ -12,30 +12,27 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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>
# include <config.h>
#endif
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
#include <string.h>
#else
#include <strings.h>
#ifndef strrchr
#define strrchr rindex
#endif
#endif
/* Return NAME with any leading path stripped off. */
/* Return NAME with any leading path stripped off.
Don't use strrchr/rindex. */
char *
basename (name)
const char *name;
{
char *base;
const char *base = name;
base = strrchr (name, '/');
return base ? base + 1 : (char *) name;
while (*name)
{
if (*name == '/')
base = name + 1;
++name;
}
return (char *) base;
}

81
lib/canon-host.c Normal file
View File

@@ -0,0 +1,81 @@
/* Host name canonicalization
Copyright (C) 1995 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
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. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#endif
#ifdef HAVE_NETDB_H
# include <netdb.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
/* Returns the canonical hostname associated with HOST (allocated in a static
buffer), or 0 if it can't be determined. */
char *
canon_host (host)
char *host;
{
#ifdef HAVE_GETHOSTBYNAME
struct hostent *he = gethostbyname (host);
if (he)
{
# ifdef HAVE_GETHOSTBYADDR
char *addr = 0;
/* Try and get an ascii version of the numeric host address. */
switch (he->h_addrtype)
{
# ifdef HAVE_INET_NTOA
case AF_INET:
addr = inet_ntoa (*(struct in_addr *) he->h_addr);
break;
# endif /* HAVE_INET_NTOA */
}
if (addr && strcmp (he->h_name, addr) == 0)
/* gethostbyname() cheated! Lookup the host name via the address
this time to get the actual host name. */
he = gethostbyaddr (he->h_addr, he->h_length, he->h_addrtype);
# endif /* HAVE_GETHOSTBYADDR */
if (he)
return (char *) (he->h_name);
}
#endif /* HAVE_GETHOSTBYNAME */
return 0;
}

View File

@@ -12,8 +12,8 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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>

View File

@@ -1,5 +1,5 @@
/* error.c -- error handler for noninteractive utilities
Copyright (C) 1990, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
Copyright (C) 1990, 91, 92, 93, 94, 95, 96 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
@@ -12,18 +12,18 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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 David MacKenzie <djm@gnu.ai.mit.edu>. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#if HAVE_VPRINTF || HAVE_DOPRNT
#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
# if __STDC__
# include <stdarg.h>
# define VA_START(args, lastarg) va_start(args, lastarg)
@@ -36,30 +36,49 @@
# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
#endif
#if STDC_HEADERS
#if STDC_HEADERS || _LIBC
# include <stdlib.h>
# include <string.h>
#else
void exit ();
#endif
/* This variable is incremented each time `error' is called. */
unsigned int error_message_count;
#ifndef _
# define _(String) String
#endif
/* Get prototypes for the functions defined here. */
#include <error.h>
/* If NULL, error will flush stdout, then print on stderr the program
name, a colon and a space. Otherwise, error will call this
function without parameters instead. */
void (*error_print_progname) () = NULL;
void (*error_print_progname) (
#if __STDC__ - 0
void
#endif
);
/* This variable is incremented each time `error' is called. */
unsigned int error_message_count;
#ifdef _LIBC
/* In the GNU C library, there is a predefined variable for this. */
# define program_name program_invocation_name
# include <errno.h>
#else /* not _LIBC */
/* The calling program should define program_name and set it to the
name of the executing program. */
extern char *program_name;
#if HAVE_STRERROR
# ifndef strerror /* On some systems, sterror is a macro */
# if HAVE_STRERROR
# ifndef strerror /* On some systems, strerror is a macro */
char *strerror ();
# endif
#else
# endif
# else
static char *
private_strerror (errnum)
int errnum;
@@ -69,10 +88,11 @@ private_strerror (errnum)
if (errnum > 0 && errnum <= sys_nerr)
return sys_errlist[errnum];
return "Unknown system error";
return _("Unknown system error");
}
#define strerror private_strerror
#endif
# define strerror private_strerror
# endif /* HAVE_STRERROR */
#endif /* not _LIBC */
/* Print the program name and error message MESSAGE, which is a printf-style
format string with optional args.
@@ -105,7 +125,75 @@ error (status, errnum, message, va_alist)
#ifdef VA_START
VA_START (args, message);
# if HAVE_VPRINTF
# if HAVE_VPRINTF || _LIBC
vfprintf (stderr, message, args);
# else
_doprnt (message, args, stderr);
# endif
va_end (args);
#else
fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8);
#endif
++error_message_count;
if (errnum)
fprintf (stderr, ": %s", strerror (errnum));
putc ('\n', stderr);
fflush (stderr);
if (status)
exit (status);
}
/* Sometimes we want to have at most one error per line. This
variable controls whether this mode is selected or not. */
int error_one_per_line;
void
#if defined(VA_START) && __STDC__
error_at_line (int status, int errnum, const char *file_name,
unsigned int line_number, const char *message, ...)
#else
error_at_line (status, errnum, file_name, line_number, message, va_alist)
int status;
int errnum;
const char *file_name;
unsigned int line_number;
char *message;
va_dcl
#endif
{
#ifdef VA_START
va_list args;
#endif
if (error_one_per_line)
{
static const char *old_file_name;
static unsigned int old_line_number;
if (old_line_number == line_number &&
(file_name == old_file_name || !strcmp (old_file_name, file_name)))
/* Simply return and print nothing. */
return;
old_file_name = file_name;
old_line_number = line_number;
}
if (error_print_progname)
(*error_print_progname) ();
else
{
fflush (stdout);
fprintf (stderr, "%s:", program_name);
}
if (file_name != NULL)
fprintf (stderr, "%s:%d: ", file_name, line_number);
#ifdef VA_START
VA_START (args, message);
# if HAVE_VPRINTF || _LIBC
vfprintf (stderr, message, args);
# else
_doprnt (message, args, stderr);
@@ -116,7 +204,6 @@ error (status, errnum, message, va_alist)
#endif
++error_message_count;
if (errnum)
fprintf (stderr, ": %s", strerror (errnum));
putc ('\n', stderr);

View File

@@ -1,5 +1,5 @@
/* error.h -- declaration for error-reporting function
Copyright (C) 1995 Software Foundation, Inc.
Copyright (C) 1995, 1996 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
@@ -12,33 +12,54 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _error_h_
#define _error_h_
#ifndef ERROR_H_
# define ERROR_H_
#ifndef __attribute__
# ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
# define __attribute__(Spec) /* empty */
# endif
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
# define __attribute__(Spec) /* empty */
# endif
/* The __-protected variants of `format' and `printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __format__ format
# define __printf__ printf
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __format__ format
# define __printf__ printf
# endif
# endif
#endif
#if __STDC__
void error (int, int, const char *, ...) \
__attribute__ ((__format__ (__printf__, 3, 4)));
#else
# if defined (__STDC__) && __STDC__
/* Print a message with `fprintf (stderr, FORMAT, ...)';
if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
extern void error (int status, int errnum, const char *format, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
extern void error_at_line (int status, int errnum, const char *fname,
unsigned int lineno, const char *format, ...)
__attribute__ ((__format__ (__printf__, 5, 6)));
/* If NULL, error will flush stdout, then print on stderr the program
name, a colon and a space. Otherwise, error will call this
function without parameters instead. */
extern void (*error_print_progname) (void);
# else
void error ();
#endif
void error_at_line ();
extern void (*error_print_progname) ();
# endif
/* This variable is incremented each time `error' is called. */
extern unsigned int error_message_count;
#endif /* _error_h_ */
/* Sometimes we want to have at most one error per line. This
variable controls whether this mode is selected or not. */
extern int error_one_per_line;
#endif /* not ERROR_H_ */

View File

@@ -1,61 +1,65 @@
/* euidaccess -- check if effective user id can access file
Copyright (C) 1990, 1991 Free Software Foundation, Inc.
Copyright (C) 1990, 1991, 1995 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 file is part of the GNU C Library.
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.
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.
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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.
/* Written by David MacKenzie and Torbjorn Granlund. */
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. */
/* Written by David MacKenzie and Torbjorn Granlund.
Adapted for GNU C library by Roland McGrath. */
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#ifdef S_IEXEC
#ifndef S_IXUSR
#define S_IXUSR S_IEXEC
#endif
#ifndef S_IXGRP
#define S_IXGRP (S_IEXEC >> 3)
#endif
#ifndef S_IXOTH
#define S_IXOTH (S_IEXEC >> 6)
#endif
# ifndef S_IXUSR
# define S_IXUSR S_IEXEC
# endif
# ifndef S_IXGRP
# define S_IXGRP (S_IEXEC >> 3)
# endif
# ifndef S_IXOTH
# define S_IXOTH (S_IEXEC >> 6)
# endif
#endif /* S_IEXEC */
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#if defined (HAVE_UNISTD_H) || defined (_LIBC)
# include <unistd.h>
#endif
#ifdef _POSIX_VERSION
#include <limits.h>
#if !defined(NGROUPS_MAX) || NGROUPS_MAX < 1
#undef NGROUPS_MAX
#define NGROUPS_MAX sysconf (_SC_NGROUPS_MAX)
#endif /* NGROUPS_MAX */
# include <limits.h>
# if !defined(NGROUPS_MAX) || NGROUPS_MAX < 1
# undef NGROUPS_MAX
# define NGROUPS_MAX sysconf (_SC_NGROUPS_MAX)
# endif /* NGROUPS_MAX */
#else /* not _POSIX_VERSION */
uid_t getuid ();
gid_t getgid ();
uid_t geteuid ();
gid_t getegid ();
#include <sys/param.h>
#if !defined(NGROUPS_MAX) && defined(NGROUPS)
#define NGROUPS_MAX NGROUPS
#endif /* not NGROUPS_MAX and NGROUPS */
# include <sys/param.h>
# if !defined(NGROUPS_MAX) && defined(NGROUPS)
# define NGROUPS_MAX NGROUPS
# endif /* not NGROUPS_MAX and NGROUPS */
#endif /* not POSIX_VERSION */
#include <errno.h>
@@ -64,16 +68,34 @@ extern int errno;
#endif
#if defined(EACCES) && !defined(EACCESS)
#define EACCESS EACCES
# define EACCESS EACCES
#endif
#ifndef F_OK
#define F_OK 0
#define X_OK 1
#define W_OK 2
#define R_OK 4
# define F_OK 0
# define X_OK 1
# define W_OK 2
# define R_OK 4
#endif
#if !defined (S_IROTH) && defined (R_OK)
# define S_IROTH R_OK
#endif
#if !defined (S_IWOTH) && defined (W_OK)
# define S_IWOTH W_OK
#endif
#if !defined (S_IXOTH) && defined (X_OK)
# define S_IXOTH X_OK
#endif
#ifdef _LIBC
# define group_member __group_member
#else
/* The user's real user id. */
static uid_t uid;
@@ -86,67 +108,17 @@ static uid_t euid;
/* The user's effective group id. */
static gid_t egid;
int group_member ();
/* Nonzero if UID, GID, EUID, and EGID have valid values. */
static int have_ids = 0;
/* Like euidaccess, except that a pointer to a filled-in stat structure
describing the file is provided instead of a filename.
Because this function is almost guaranteed to fail on systems that
use ACLs, a third argument *PATH may be used. If it is non-NULL,
it is assumed to be the name of the file corresponding to STATP.
Then, if the user is not running set-uid or set-gid, use access
instead of attempting a manual and non-portable comparison. */
# ifdef HAVE_GETGROUPS
int group_member ();
# else
# define group_member(gid) 0
# endif
int
eaccess_stat (statp, mode, path)
const struct stat *statp;
int mode;
const char *path;
{
int granted;
mode &= (X_OK | W_OK | R_OK); /* Clear any bogus bits. */
if (mode == F_OK)
return 0; /* The file exists. */
if (have_ids == 0)
{
have_ids = 1;
uid = getuid ();
gid = getgid ();
euid = geteuid ();
egid = getegid ();
}
if (path && uid == euid && gid == egid)
{
return access (path, mode);
}
/* The super-user can read and write any file, and execute any file
that anyone can execute. */
if (euid == 0 && ((mode & X_OK) == 0
|| (statp->st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))))
return 0;
if (euid == statp->st_uid)
granted = (unsigned) (statp->st_mode & (mode << 6)) >> 6;
else if (egid == statp->st_gid
#ifdef HAVE_GETGROUPS
|| group_member (statp->st_gid)
#endif
)
granted = (unsigned) (statp->st_mode & (mode << 3)) >> 3;
else
granted = (statp->st_mode & mode);
if (granted == mode)
return 0;
errno = EACCESS;
return -1;
}
/* Return 0 if the user has permission of type MODE on file PATH;
otherwise, return -1 and set `errno' to EACCESS.
@@ -160,7 +132,12 @@ euidaccess (path, mode)
int mode;
{
struct stat stats;
int granted;
#ifdef _LIBC
uid_t uid = getuid (), euid = geteuid ();
gid_t gid = getgid (), egid = getegid ();
#else
if (have_ids == 0)
{
have_ids = 1;
@@ -169,45 +146,37 @@ euidaccess (path, mode)
euid = geteuid ();
egid = getegid ();
}
#endif
if (uid == euid && gid == egid)
{
return access (path, mode);
}
/* If we are not set-uid or set-gid, access does the same. */
return access (path, mode);
if (stat (path, &stats))
return -1;
return eaccess_stat (&stats, mode, path);
}
#ifdef TEST
#include <stdio.h>
#include <errno.h>
void error ();
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);
}
mode &= (X_OK | W_OK | R_OK); /* Clear any bogus bits. */
#if R_OK != S_IROTH || W_OK != S_IWOTH || X_OK != S_IXOTH
?error Oops, portability assumptions incorrect.
#endif
if (mode == F_OK)
return 0; /* The file exists. */
/* The super-user can read and write any file, and execute any file
that anyone can execute. */
if (euid == 0 && ((mode & X_OK) == 0
|| (stats.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))))
return 0;
if (euid == stats.st_uid)
granted = (unsigned) (stats.st_mode & (mode << 6)) >> 6;
else if (egid == stats.st_gid || group_member (stats.st_gid))
granted = (unsigned) (stats.st_mode & (mode << 3)) >> 3;
else
granted = (stats.st_mode & mode);
if (granted == mode)
return 0;
errno = EACCESS;
return -1;
}

View File

@@ -12,32 +12,32 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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 Brian L. Matthews, blm@6sceng.UUCP. */
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif
#if !defined (HAVE_ST_BLOCKS) && !defined(_POSIX_SOURCE)
#include <sys/types.h>
#include <sys/param.h>
#if !defined (HAVE_ST_BLOCKS) && !defined(_POSIX_VERSION)
# include <sys/types.h>
# include <sys/param.h>
#ifndef NINDIR
# ifndef NINDIR
/* Some SysV's, like Irix, seem to lack these. Hope they're correct. */
/* Size of a indirect block, in bytes. */
#ifndef BSIZE
#define BSIZE 1024
#endif
# ifndef BSIZE
# define BSIZE 1024
# endif
/* Number of inode pointers per indirect block. */
#define NINDIR (BSIZE/sizeof(daddr_t))
#endif /* !NINDIR */
# define NINDIR (BSIZE/sizeof(daddr_t))
# endif /* !NINDIR */
/* Number of direct block addresses in an inode. */
#define NDIR 10
# define NDIR 10
/* Return the number of 512-byte blocks in a file of SIZE bytes. */
@@ -63,4 +63,8 @@ st_blocks (size)
return datablks + indrblks;
}
#else
/* This declaration is solely to ensure that after preprocessing
this file is never empty. */
extern int textutils_fileblocks_unused;
#endif

View File

@@ -12,8 +12,8 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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>
@@ -198,6 +198,17 @@ ftypelet (bits)
if (S_ISNWK (bits))
return 'n';
#endif
#ifdef S_ISOFD
/* Cray migrated dmf file. */
if (S_ISOFD (bits))
return 'M';
#endif
#ifdef S_ISOFL
/* Cray migrated dmf file. */
if (S_ISOFL (bits))
return 'M';
#endif
return '?';
}

View File

@@ -1,30 +1,38 @@
/* Copyright (C) 1991, 1992, 1993 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.
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.
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 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.
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, 675 Mass Ave, Cambridge, MA 02139, 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>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <errno.h>
#include <fnmatch.h>
#include <ctype.h>
#if defined (STDC_HEADERS) || !defined (isascii)
# define ISASCII(c) 1
#else
# define ISASCII(c) isascii(c)
#endif
#define ISUPPER(c) (ISASCII (c) && isupper (c))
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
@@ -37,9 +45,9 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
#ifndef errno
# ifndef errno
extern int errno;
#endif
# endif
/* Match STRING against the filename pattern PATTERN, returning zero if
it matches, nonzero if not. */
@@ -53,7 +61,7 @@ fnmatch (pattern, string, flags)
register char c;
/* Note that this evalutes C many times. */
#define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c))
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
while ((c = *p++) != '\0')
{
@@ -197,6 +205,8 @@ fnmatch (pattern, string, flags)
return 0;
return FNM_NOMATCH;
# undef FOLD
}
#endif /* _LIBC or not __GNU_LIBRARY__. */

View File

@@ -1,48 +1,57 @@
/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
This 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.
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.
This library is distributed in the hope that it will be useful,
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
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 this library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, 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 _FNMATCH_H
#define _FNMATCH_H 1
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
#undef __P
#define __P(args) args
#define __P(protos) protos
#else /* Not C++ or ANSI C. */
#undef __P
#define __P(args) ()
#undef const
#define const
#define __P(protos) ()
/* We can get away without defining `const' here only because in this file
it is used only inside the prototype for `fnmatch', which is elided in
non-ANSI C where `const' is problematical. */
#endif /* C++ or ANSI C. */
/* Bits set in the FLAGS argument to `fnmatch'. */
#define FNM_PATHNAME (1 << 0)/* No wildcard can ever match `/'. */
#define FNM_NOESCAPE (1 << 1)/* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2)/* Leading `.' is matched only explicitly. */
#define FNM_TARPATH (1 << 4)/* Ignore `/...' after a match. */
#define __FNM_FLAGS (FNM_PATHNAME|FNM_NOESCAPE|FNM_PERIOD|FNM_TARPATH)
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_BSD_SOURCE)
#define FNM_FILE_NAME FNM_PATHNAME
/* We #undef these before defining them because some losing systems
(HP-UX A.08.07 for example) define these in <unistd.h>. */
#undef FNM_PATHNAME
#undef FNM_NOESCAPE
#undef FNM_PERIOD
/* Bits set in the FLAGS argument to `fnmatch'. */
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#endif
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
@@ -50,12 +59,11 @@ extern "C"
/* Match STRING against the filename pattern PATTERN,
returning zero if it matches, FNM_NOMATCH if not. */
extern int fnmatch __P ((const char *__pattern, const char *__string,
int __flags));
extern int fnmatch __P ((const char *__pattern, const char *__string,
int __flags));
#ifdef __cplusplus
}
#endif
#endif /* fnmatch.h */

View File

@@ -1,5 +1,5 @@
/* fsusage.c -- return space usage of mounted filesystems
Copyright (C) 1991, 1992 Free Software Foundation, Inc.
Copyright (C) 1991, 1992, 1996 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
@@ -12,11 +12,11 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
@@ -25,36 +25,40 @@
int statfs ();
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#if HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#if HAVE_SYS_MOUNT_H
# include <sys/mount.h>
#endif
#ifdef HAVE_SYS_VFS_H
#include <sys/vfs.h>
#if HAVE_SYS_VFS_H
# include <sys/vfs.h>
#endif
#ifdef HAVE_SYS_FILSYS_H
#include <sys/filsys.h> /* SVR2. */
#if HAVE_SYS_FS_S5PARAM_H /* Fujitsu UXP/V */
# include <sys/fs/s5param.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#if defined (HAVE_SYS_FILSYS_H) && !defined (_CRAY)
# include <sys/filsys.h> /* SVR2 */
#endif
#ifdef HAVE_SYS_STATFS_H
#include <sys/statfs.h>
#if HAVE_FCNTL_H
# include <fcntl.h>
#endif
#ifdef HAVE_DUSTAT_H /* AIX PS/2. */
#include <sys/dustat.h>
#if HAVE_SYS_STATFS_H
# include <sys/statfs.h>
#endif
#ifdef HAVE_SYS_STATVFS_H /* SVR4. */
#include <sys/statvfs.h>
#if HAVE_DUSTAT_H /* AIX PS/2 */
# include <sys/dustat.h>
#endif
#if HAVE_SYS_STATVFS_H /* SVR4 */
# include <sys/statvfs.h>
int statvfs ();
#endif
@@ -73,12 +77,12 @@ adjust_blocks (blocks, fromsize, tosize)
abort ();
if (fromsize <= 0)
return -1;
if (fromsize == tosize) /* E.g., from 512 to 512. */
if (fromsize == tosize) /* e.g., from 512 to 512 */
return blocks;
else if (fromsize > tosize) /* E.g., from 2048 to 512. */
else if (fromsize > tosize) /* e.g., from 2048 to 512 */
return blocks * (fromsize / tosize);
else /* E.g., from 256 to 512. */
else /* e.g., from 256 to 512 */
return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize);
}
@@ -86,41 +90,56 @@ adjust_blocks (blocks, fromsize, tosize)
the filesystem on which PATH resides.
DISK is the device on which PATH is mounted, for space-getting
methods that need to know it.
Return 0 if successful, -1 if not. */
Return 0 if successful, -1 if not. When returning -1, ensure that
ERRNO is either a system error value, or zero if DISK is NULL
on a system that requires a non-NULL value. */
int
get_fs_usage (path, disk, fsp)
char *path, *disk;
const char *path;
const char *disk;
struct fs_usage *fsp;
{
#if defined (STAT_STATFS3_OSF1)
#ifdef STAT_STATFS3_OSF1
# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_fsize, 512)
struct statfs fsd;
if (statfs (path, &fsd, sizeof (struct statfs)) != 0)
return -1;
#define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_fsize, 512)
#endif /* STAT_STATFS3_OSF1 */
#ifdef STAT_STATFS2_FS_DATA /* Ultrix. */
#ifdef STAT_STATFS2_FS_DATA /* Ultrix */
# define CONVERT_BLOCKS(B) adjust_blocks ((B), 1024, 512)
struct fs_data fsd;
if (statfs (path, &fsd) != 1)
return -1;
#define CONVERT_BLOCKS(b) adjust_blocks ((b), 1024, 512)
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.fd_req.btot);
fsp->fsu_bfree = CONVERT_BLOCKS (fsd.fd_req.bfree);
fsp->fsu_bavail = CONVERT_BLOCKS (fsd.fd_req.bfreen);
fsp->fsu_files = fsd.fd_req.gtot;
fsp->fsu_ffree = fsd.fd_req.gfree;
#endif
#ifdef STAT_READ_FILSYS /* SVR2. */
#ifndef SUPERBOFF
#define SUPERBOFF (SUPERB * 512)
#endif
#endif /* STAT_STATFS2_FS_DATA */
#ifdef STAT_READ_FILSYS /* SVR2 */
# ifndef SUPERBOFF
# define SUPERBOFF (SUPERB * 512)
# endif
# define CONVERT_BLOCKS(B) \
adjust_blocks ((B), (fsd.s_type == Fs2b ? 1024 : 512), 512)
struct filsys fsd;
int fd;
if (! disk)
{
errno = 0;
return -1;
}
fd = open (disk, O_RDONLY);
if (fd < 0)
return -1;
@@ -131,31 +150,64 @@ get_fs_usage (path, disk, fsp)
return -1;
}
close (fd);
#define CONVERT_BLOCKS(b) adjust_blocks ((b), (fsd.s_type == Fs2b ? 1024 : 512), 512)
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.s_fsize);
fsp->fsu_bfree = CONVERT_BLOCKS (fsd.s_tfree);
fsp->fsu_bavail = CONVERT_BLOCKS (fsd.s_tfree);
fsp->fsu_files = (fsd.s_isize - 2) * INOPB * (fsd.s_type == Fs2b ? 2 : 1);
fsp->fsu_ffree = fsd.s_tinode;
#endif
#ifdef STAT_STATFS2_BSIZE /* 4.3BSD, SunOS 4, HP-UX, AIX. */
#endif /* STAT_READ_FILSYS */
#ifdef STAT_STATFS2_BSIZE /* 4.3BSD, SunOS 4, HP-UX, AIX */
# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_bsize, 512)
struct statfs fsd;
if (statfs (path, &fsd) < 0)
return -1;
#define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_bsize, 512)
#endif
#ifdef STAT_STATFS2_FSIZE /* 4.4BSD. */
# ifdef STATFS_TRUNCATES_BLOCK_COUNTS
/* In SunOS 4.1.2, 4.1.3, and 4.1.3_U1, the block counts in the
struct statfs are truncated to 2GB. These conditions detect that
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)
{
fsd.f_blocks = fsd.f_spare[0];
fsd.f_bfree = fsd.f_spare[1];
fsd.f_bavail = fsd.f_spare[2];
}
# endif /* STATFS_TRUNCATES_BLOCK_COUNTS */
#endif /* STAT_STATFS2_BSIZE */
#ifdef STAT_STATFS2_FSIZE /* 4.4BSD */
# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_fsize, 512)
struct statfs fsd;
if (statfs (path, &fsd) < 0)
return -1;
#define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_fsize, 512)
#endif
#ifdef STAT_STATFS4 /* SVR3, Dynix, Irix, AIX. */
#endif /* STAT_STATFS2_FSIZE */
#ifdef STAT_STATFS4 /* SVR3, Dynix, Irix, AIX */
# if _AIX || defined(_CRAY)
# define CONVERT_BLOCKS(B) adjust_blocks ((B), fsd.f_bsize, 512)
# ifdef _CRAY
# define f_bavail f_bfree
# endif
# else
# define CONVERT_BLOCKS(B) (B)
# ifndef _SEQUENT_ /* _SEQUENT_ is DYNIX/ptx */
# ifndef DOLPHIN /* DOLPHIN 3.8.alfa/7.18 has f_bavail */
# define f_bavail f_bfree
# endif
# endif
# endif
struct statfs fsd;
if (statfs (path, &fsd, sizeof fsd, 0) < 0)
@@ -163,35 +215,31 @@ get_fs_usage (path, disk, fsp)
/* Empirically, the block counts on most SVR3 and SVR3-derived
systems seem to always be in terms of 512-byte blocks,
no matter what value f_bsize has. */
# if _AIX
# define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_bsize, 512)
# else
# define CONVERT_BLOCKS(b) (b)
# ifndef _SEQUENT_ /* _SEQUENT_ is DYNIX/ptx. */
# ifndef DOLPHIN /* DOLPHIN 3.8.alfa/7.18 has f_bavail */
# define f_bavail f_bfree
# endif
# endif
# endif
#endif
#ifdef STAT_STATVFS /* SVR4. */
#endif /* STAT_STATFS4 */
#ifdef STAT_STATVFS /* SVR4 */
# define CONVERT_BLOCKS(B) \
adjust_blocks ((B), fsd.f_frsize ? fsd.f_frsize : fsd.f_bsize, 512)
struct statvfs fsd;
if (statvfs (path, &fsd) < 0)
return -1;
/* f_frsize isn't guaranteed to be supported. */
#define CONVERT_BLOCKS(b) \
adjust_blocks ((b), fsd.f_frsize ? fsd.f_frsize : fsd.f_bsize, 512)
#endif
#if !defined(STAT_STATFS2_FS_DATA) && !defined(STAT_READ_FILSYS) /* !Ultrix && !SVR2. */
#endif /* STAT_STATVFS */
#if !defined(STAT_STATFS2_FS_DATA) && !defined(STAT_READ_FILSYS)
/* !Ultrix && !SVR2 */
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.f_blocks);
fsp->fsu_bfree = CONVERT_BLOCKS (fsd.f_bfree);
fsp->fsu_bavail = CONVERT_BLOCKS (fsd.f_bavail);
fsp->fsu_files = fsd.f_files;
fsp->fsu_ffree = fsd.f_ffree;
#endif
#endif /* not STAT_STATFS2_FS_DATA && not STAT_READ_FILSYS */
return 0;
}
@@ -222,4 +270,5 @@ statfs (path, fsb)
fsb->f_fsid.val[1] = fsd.du_pckno;
return 0;
}
#endif /* _AIX && _I386 */

View File

@@ -12,8 +12,8 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Space usage statistics for a filesystem. Blocks are 512-byte. */
struct fs_usage
@@ -25,8 +25,13 @@ struct fs_usage
long fsu_ffree; /* Free file nodes. */
};
#if __STDC__
int get_fs_usage (char *path, char *disk, struct fs_usage *fsp);
#ifndef __P
#if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
#define __P(args) args
#else
int get_fs_usage ();
#endif
#define __P(args) ()
#endif /* GCC. */
#endif /* Not __P. */
int get_fs_usage __P ((const char *path, const char *disk,
struct fs_usage *fsp));

View File

@@ -12,20 +12,20 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Copied largely from GNU C's cccp.c.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <errno.h>

View File

@@ -15,6 +15,10 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#ifdef FORCE_ALLOCA_H
#include <alloca.h>
#endif
#endif
/* Since the code of getdate.y is not included in the Emacs executable
@@ -30,6 +34,17 @@
#include <stdio.h>
#include <ctype.h>
#if defined (STDC_HEADERS) || !defined (isascii)
# define ISASCII(c) 1
#else
# define ISASCII(c) isascii(c)
#endif
#define ISSPACE(c) (ISASCII (c) && isspace (c))
#define ISALPHA(c) (ISASCII (c) && isalpha (c))
#define ISUPPER(c) (ISASCII (c) && isupper (c))
#define ISDIGIT(c) (ISASCII (c) && isdigit (c))
#if defined (vms)
#include <types.h>
#include <time.h>
@@ -82,14 +97,58 @@ struct timeb
extern struct tm *gmtime ();
extern struct tm *localtime ();
#define yyparse getdate_yyparse
#define yylex getdate_yylex
#define yyerror getdate_yyerror
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
as well as gratuitiously global symbol names, so we can have multiple
yacc generated parsers in the same program. Note that these are only
the variables produced by yacc. If other parser generators (bison,
byacc, etc) produce additional global names that conflict at link time,
then those parser generators need to be fixed instead of adding those
names to this list. */
#define yymaxdepth gd_maxdepth
#define yyparse gd_parse
#define yylex gd_lex
#define yyerror gd_error
#define yylval gd_lval
#define yychar gd_char
#define yydebug gd_debug
#define yypact gd_pact
#define yyr1 gd_r1
#define yyr2 gd_r2
#define yydef gd_def
#define yychk gd_chk
#define yypgo gd_pgo
#define yyact gd_act
#define yyexca gd_exca
#define yyerrflag gd_errflag
#define yynerrs gd_nerrs
#define yyps gd_ps
#define yypv gd_pv
#define yys gd_s
#define yy_yys gd_yys
#define yystate gd_state
#define yytmp gd_tmp
#define yyv gd_v
#define yy_yyv gd_yyv
#define yyval gd_val
#define yylloc gd_lloc
#define yyreds gd_reds /* With YYDEBUG defined */
#define yytoks gd_toks /* With YYDEBUG defined */
#define yylhs gd_yylhs
#define yylen gd_yylen
#define yydefred gd_yydefred
#define yydgoto gd_yydgoto
#define yysindex gd_yysindex
#define yyrindex gd_yyrindex
#define yygindex gd_yygindex
#define yytable gd_yytable
#define yycheck gd_yycheck
static int yylex ();
static int yyerror ();
#define EPOCH 1970
#define DOOMSDAY 2038
#define HOUR(x) ((time_t)(x) * 60)
#define SECSPERDAY (24L * 60L * 60L)
@@ -242,7 +301,7 @@ day : tDAY {
yyDayOrdinal = 1;
yyDayNumber = $1;
}
| tUNUMBER tDAY { /* FIXME */
| tUNUMBER tDAY {
yyDayOrdinal = $1;
yyDayNumber = $2;
}
@@ -253,9 +312,22 @@ date : tUNUMBER '/' tUNUMBER {
yyDay = $3;
}
| tUNUMBER '/' tUNUMBER '/' tUNUMBER {
yyMonth = $1;
yyDay = $3;
yyYear = $5;
/* Interpret as YYYY/MM/DD if $1 >= 1000, otherwise as MM/DD/YY.
The goal in recognizing YYYY/MM/DD is solely to support legacy
machine-generated dates like those in an RCS log listing. If
you want portability, use the ISO 8601 format. */
if ($1 >= 1000)
{
yyYear = $1;
yyMonth = $3;
yyDay = $5;
}
else
{
yyMonth = $1;
yyDay = $3;
yyYear = $5;
}
}
| tUNUMBER tSNUMBER tSNUMBER {
/* ISO 8601 format. yyyy-mm-dd. */
@@ -279,7 +351,6 @@ date : tUNUMBER '/' tUNUMBER {
yyYear = $4;
}
| tUNUMBER tMONTH {
/* FIXME: `date -d 'next october'' is interpreted as 2 october. */
yyMonth = $2;
yyDay = $1;
}
@@ -315,10 +386,10 @@ relunit : tUNUMBER tMINUTE_UNIT {
| tSEC_UNIT {
yyRelSeconds++;
}
| tSNUMBER tMONTH_UNIT { /* FIXME */
| tSNUMBER tMONTH_UNIT {
yyRelMonth += $1 * $2;
}
| tUNUMBER tMONTH_UNIT { /* FIXME */
| tUNUMBER tMONTH_UNIT {
yyRelMonth += $1 * $2;
}
| tMONTH_UNIT {
@@ -613,11 +684,13 @@ Convert (Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode)
if (Year < 0)
Year = -Year;
if (Year < 100)
if (Year < DOOMSDAY-2000)
Year += 2000;
else if (Year < 100)
Year += 1900;
DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)
? 29 : 28;
if (Year < EPOCH || Year > 2037
if (Year < EPOCH || Year > DOOMSDAY
|| Month < 1 || Month > 12
/* Lint fluff: "conversion from long may lose accuracy" */
|| Day < 1 || Day > DaysInMonth[(int)--Month])
@@ -682,7 +755,7 @@ RelativeMonth (Start, RelMonth)
if (RelMonth == 0)
return 0;
tm = localtime (&Start);
Month = 12 * tm->tm_year + tm->tm_mon + RelMonth;
Month = 12 * (1900 + tm->tm_year) + tm->tm_mon + RelMonth;
Year = Month / 12;
Month = Month % 12 + 1;
return DSTcorrect (Start,
@@ -704,7 +777,7 @@ LookupWord (buff)
/* Make it lowercase. */
for (p = buff; *p; p++)
if (isupper (*p))
if (ISUPPER (*p))
*p = tolower (*p);
if (strcmp (buff, "am") == 0 || strcmp (buff, "a.m.") == 0) {
@@ -745,7 +818,7 @@ LookupWord (buff)
return tp->type;
}
if (strcmp (buff, "dst") == 0)
if (strcmp (buff, "dst") == 0)
return tDST;
for (tp = UnitsTable; tp->name; tp++)
@@ -773,7 +846,7 @@ LookupWord (buff)
}
/* Military timezones. */
if (buff[1] == '\0' && isalpha (*buff)) {
if (buff[1] == '\0' && ISALPHA (*buff)) {
for (tp = MilitaryTable; tp->name; tp++)
if (strcmp (buff, tp->name) == 0) {
yylval.Number = tp->value;
@@ -809,27 +882,27 @@ yylex ()
int sign;
for ( ; ; ) {
while (isspace (*yyInput))
while (ISSPACE (*yyInput))
yyInput++;
if (isdigit (c = *yyInput) || c == '-' || c == '+') {
if (ISDIGIT (c = *yyInput) || c == '-' || c == '+') {
if (c == '-' || c == '+') {
sign = c == '-' ? -1 : 1;
if (!isdigit (*++yyInput))
if (!ISDIGIT (*++yyInput))
/* skip the '-' sign */
continue;
}
else
sign = 0;
for (yylval.Number = 0; isdigit (c = *yyInput++); )
for (yylval.Number = 0; ISDIGIT (c = *yyInput++); )
yylval.Number = 10 * yylval.Number + c - '0';
yyInput--;
if (sign < 0)
yylval.Number = -yylval.Number;
return sign ? tSNUMBER : tUNUMBER;
}
if (isalpha (c)) {
for (p = buff; isalpha (c = *yyInput++) || c == '.'; )
if (ISALPHA (c)) {
for (p = buff; ISALPHA (c = *yyInput++) || c == '.'; )
if (p < &buff[sizeof buff - 1])
*p++ = c;
*p = '\0';
@@ -896,7 +969,7 @@ get_date (p, now)
if (! (tm = localtime (&ftz.time)))
return -1;
ftz.timezone = difftm (&gmt, tm) / 60;
if (tm->tm_isdst)
ftz.timezone += 60;

View File

@@ -12,13 +12,17 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* David MacKenzie <djm@gnu.ai.mit.edu> */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_UNAME
#include <sys/utsname.h>
# include <sys/utsname.h>
#endif
/* Put up to LEN chars of the host name into NAME.

155
lib/getline.c Normal file
View File

@@ -0,0 +1,155 @@
/* getline.c -- Replacement for GNU C library function getline
Copyright (C) 1993, 1996 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
/* The `getdelim' function is only declared if the following symbol
is defined. */
#define _GNU_SOURCE 1
#include <stdio.h>
#include <sys/types.h>
#if defined __GNU_LIBRARY__ && HAVE_GETDELIM
int
getline (lineptr, n, stream)
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 (lineptr, n, stream, terminator, offset)
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;
}
int
getline (lineptr, n, stream)
char **lineptr;
size_t *n;
FILE *stream;
{
return getstr (lineptr, n, stream, '\n', 0);
}
int
getdelim (lineptr, n, delimiter, stream)
char **lineptr;
size_t *n;
int delimiter;
FILE *stream;
{
return getstr (lineptr, n, stream, delimiter, 0);
}
#endif

36
lib/getline.h Normal file
View File

@@ -0,0 +1,36 @@
/* Copyright (C) 1995 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 GETLINE_H_
# define GETLINE_H_ 1
# include <stdio.h>
# ifndef PARAMS
# if defined (__GNUC__) || __STDC__
# define PARAMS(args) args
# else
# define PARAMS(args) ()
# endif
# endif
int
getline PARAMS ((char **_lineptr, size_t *_n, FILE *_stream));
int
getdelim PARAMS ((char **_lineptr, size_t *_n, int _delimiter, FILE *_stream));
#endif /* not GETLINE_H_ */

1028
lib/getloadavg.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@
"Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
before changing it!
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 1996
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
@@ -18,7 +18,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, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 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>. */
@@ -53,18 +53,37 @@
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
#ifdef __GNU_LIBRARY__
/* Don't include stdlib.h for non-GNU C libraries because some of them
contain conflicting prototypes for getopt. */
#include <stdlib.h>
#if defined (_LIBC) || defined (HAVE_UNISTD_H)
#include <unistd.h>
#endif
#endif /* GNU C library. */
#ifdef VMS
#include <unixlib.h>
#if HAVE_STRING_H - 0
#include <string.h>
#endif
#endif
#ifdef WIN32
/* It's not Unix, really. See? Capital letters. */
#include <windows.h>
#define getpid() GetCurrentProcessId()
#endif
#ifndef _
/* This is for other GNU distributions with internationalized messages.
The GNU C Library itself does not yet support such messages. */
#if HAVE_LIBINTL_H
When compiling libc, the _ macro is predefined. */
#ifdef HAVE_LIBINTL_H
# include <libintl.h>
# define _(msgid) gettext (msgid)
#else
# define gettext(msgid) (msgid)
# define _(msgid) (msgid)
#endif
#endif
/* This version of `getopt' appears to the caller like standard Unix `getopt'
@@ -163,7 +182,7 @@ static enum
/* Value of POSIXLY_CORRECT environment variable. */
static char *posixly_correct;
#ifdef __GNU_LIBRARY__
#ifdef __GNU_LIBRARY__
/* We want to avoid inclusion of string.h with non-GNU libraries
because there are many ways it can cause trouble.
On some systems, it contains special magic macros that don't work
@@ -214,6 +233,12 @@ extern int strlen (const char *);
static int first_nonopt;
static int last_nonopt;
/* Bash 2.0 gives us an environment variable containing flags
indicating ARGV elements that should not be considered arguments. */
static const char *nonoption_flags;
static int nonoption_flags_len;
/* Exchange two adjacent subsequences of ARGV.
One subsequence is elements [first_nonopt,last_nonopt)
which contains all the non-options that have been skipped so far.
@@ -223,6 +248,10 @@ static int last_nonopt;
`first_nonopt' and `last_nonopt' are relocated so that they describe
the new indices of the non-options in ARGV after they are moved. */
#if defined (__STDC__) && __STDC__
static void exchange (char **);
#endif
static void
exchange (argv)
char **argv;
@@ -281,6 +310,9 @@ exchange (argv)
/* Initialize the internal data when the first call is made. */
#if defined (__STDC__) && __STDC__
static const char *_getopt_initialize (const char *);
#endif
static const char *
_getopt_initialize (optstring)
const char *optstring;
@@ -312,6 +344,21 @@ _getopt_initialize (optstring)
else
ordering = PERMUTE;
if (posixly_correct == NULL)
{
/* Bash 2.0 puts a special variable in the environment for each
command it runs, specifying which ARGV elements are the results of
file name wildcard expansion and therefore should not be
considered as options. */
char var[100];
sprintf (var, "_%d_GNU_nonoption_argv_flags_", getpid ());
nonoption_flags = getenv (var);
if (nonoption_flags == NULL)
nonoption_flags_len = 0;
else
nonoption_flags_len = strlen (nonoption_flags);
}
return optstring;
}
@@ -388,10 +435,24 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
optind = 1; /* Don't scan ARGV[0], the program name. */
}
/* Test whether ARGV[optind] points to a non-option argument.
Either it does not have option syntax, or there is an environment flag
from the shell indicating it is not an option. */
#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
|| (optind < nonoption_flags_len \
&& nonoption_flags[optind] == '1'))
if (nextchar == NULL || *nextchar == '\0')
{
/* Advance to the next ARGV-element. */
/* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
moved back by the user (who may also have changed the arguments). */
if (last_nonopt > optind)
last_nonopt = optind;
if (first_nonopt > optind)
first_nonopt = optind;
if (ordering == PERMUTE)
{
/* If we have just processed some options following some non-options,
@@ -405,8 +466,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
/* Skip any additional non-options
and extend the range of non-options previously skipped. */
while (optind < argc
&& (argv[optind][0] != '-' || argv[optind][1] == '\0'))
while (optind < argc && NONOPTION_P)
optind++;
last_nonopt = optind;
}
@@ -444,7 +504,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
/* If we have come to a non-option and did not permute it,
either stop the scan or describe it to the caller and pass it by. */
if ((argv[optind][0] != '-' || argv[optind][1] == '\0'))
if (NONOPTION_P)
{
if (ordering == REQUIRE_ORDER)
return EOF;
@@ -476,8 +536,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
if (longopts != NULL
&& (argv[optind][1] == '-'
|| (long_only && (argv[optind][2]
|| !my_index (optstring, argv[optind][1])))))
|| (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
{
char *nameend;
const struct option *p;
@@ -490,8 +549,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
/* Do nothing. */ ;
#ifdef lint
indfound = 0; /* Avoid spurious compiler warning. */
#ifdef lint /* Suppress `used before initialized' warning. */
indfound = 0;
#endif
/* Test all long options for either exact match
@@ -521,10 +580,11 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
if (ambig && !exact)
{
if (opterr)
fprintf (stderr, gettext ("%s: option `%s' is ambiguous\n"),
fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
argv[0], argv[optind]);
nextchar += strlen (nextchar);
optind++;
optopt = 0;
return '?';
}
@@ -541,18 +601,20 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
else
{
if (opterr)
if (argv[optind - 1][1] == '-')
/* --option */
fprintf (stderr,
gettext ("%s: option `--%s' doesn't allow an argument\n"),
argv[0], pfound->name);
else
/* +option or -option */
fprintf (stderr,
gettext ("%s: option `%c%s' doesn't allow an argument\n"),
argv[0], argv[optind - 1][0], pfound->name);
if (argv[optind - 1][1] == '-')
/* --option */
fprintf (stderr,
_("%s: option `--%s' doesn't allow an argument\n"),
argv[0], pfound->name);
else
/* +option or -option */
fprintf (stderr,
_("%s: option `%c%s' doesn't allow an argument\n"),
argv[0], argv[optind - 1][0], pfound->name);
nextchar += strlen (nextchar);
optopt = pfound->val;
return '?';
}
}
@@ -564,9 +626,10 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
if (opterr)
fprintf (stderr,
gettext ("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]);
_("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]);
nextchar += strlen (nextchar);
optopt = pfound->val;
return optstring[0] == ':' ? ':' : '?';
}
}
@@ -592,15 +655,16 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
if (argv[optind][1] == '-')
/* --option */
fprintf (stderr, gettext ("%s: unrecognized option `--%s'\n"),
fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
argv[0], nextchar);
else
/* +option or -option */
fprintf (stderr, gettext ("%s: unrecognized option `%c%s'\n"),
fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
argv[0], argv[optind][0], nextchar);
}
nextchar = (char *) "";
optind++;
optopt = 0;
return '?';
}
}
@@ -621,10 +685,10 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
if (posixly_correct)
/* 1003.2 specifies the format of this message. */
fprintf (stderr, gettext ("%s: illegal option -- %c\n"),
fprintf (stderr, _("%s: illegal option -- %c\n"),
argv[0], c);
else
fprintf (stderr, gettext ("%s: invalid option -- %c\n"),
fprintf (stderr, _("%s: invalid option -- %c\n"),
argv[0], c);
}
optopt = c;
@@ -660,8 +724,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
/* 1003.2 specifies the format of this message. */
fprintf (stderr,
gettext ("%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

@@ -12,8 +12,8 @@
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
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
#define _GETOPT_H 1

View File

@@ -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, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>

View File

@@ -12,44 +12,33 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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 David MacKenzie. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <stdio.h> /* grp.h on alpha OSF1 V2.0 uses "FILE *". */
#include <grp.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif
/* Even though SunOS 4, Ultrix 4, and 386BSD are mostly POSIX.1 compliant,
their getgroups system call (except in the `System V' environment, which
is troublesome in other ways) fills in an array of int, not gid_t
(which is `short' on those systems). We do the same, for consistency.
Kludge, kludge. */
#ifdef _POSIX_VERSION
#if !defined(sun) && !defined(ultrix) && !defined(__386BSD__)
#define GETGROUPS_T gid_t
#else /* sun or ultrix or 386BSD */
#define GETGROUPS_T int
#endif /* sun or ultrix or 386BSD */
#else /* not _POSIX_VERSION */
#define GETGROUPS_T int
#endif /* not _POSIX_VERSION */
/* setgrent, getgrent, and endgrent are not specified by POSIX.1,
so header files might not declare them.
If you don't have them at all, we can't implement this function.
You lose! */
struct group *getgrent ();
#if defined(USG) || defined(STDC_HEADERS)
#include <string.h>
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
# include <string.h>
#else
#include <strings.h>
# include <strings.h>
#endif
/* Like `getgroups', but for user USERNAME instead of for

View File

@@ -12,25 +12,25 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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 David MacKenzie <djm@gnu.ai.mit.edu> */
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif
#ifndef SHELLS_FILE
/* File containing a list of nonrestricted shells, one per line. */
#define SHELLS_FILE "/etc/shells"
# define SHELLS_FILE "/etc/shells"
#endif
#include <stdio.h>
#include <ctype.h>
#ifdef STDC_HEADERS
#include <stdlib.h>
# include <stdlib.h>
#else
char *malloc ();
char *realloc ();
@@ -177,7 +177,7 @@ readname (name, size, stream)
/* Skip blank space. */
while ((c = getc (stream)) != EOF && isspace (c))
/* Do nothing. */ ;
while (c != EOF && !isspace (c))
{
(*name)[name_index++] = c;

View File

@@ -12,15 +12,19 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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 David MacKenzie <djm@gnu.ai.mit.edu> */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include "backupfile.h"
#ifdef STDC_HEADERS
#include <stdlib.h>
#if STDC_HEADERS
# include <stdlib.h>
#endif
int argmatch ();
@@ -28,12 +32,12 @@ void invalid_arg ();
extern char *program_name;
static char *backup_args[] =
static const char *const backup_args[] =
{
"never", "simple", "nil", "existing", "t", "numbered", 0
};
static enum backup_type backup_types[] =
static const enum backup_type backup_types[] =
{
simple, simple, numbered_existing, numbered_existing, numbered, numbered
};

View File

@@ -12,22 +12,22 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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>
# include <config.h>
#endif
#include <stdio.h>
#include <sys/types.h>
#ifdef STDC_HEADERS
#include <stdlib.h>
# include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif
#include "group-member.h"
@@ -120,7 +120,7 @@ group_member (gid)
break;
}
}
free_group_info (gi);
return found;

View File

@@ -1,7 +1,7 @@
#ifndef _group_member_h_
#define _group_member_h_ 1
#ifndef GROUP_MEMBER_H_
# define GROUP_MEMBER_H_ 1
int
group_member ();
#endif /* _group_member_h_ */
#endif /* GROUP_MEMBER_H_ */

View File

@@ -12,15 +12,19 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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 <stdio.h>
#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#if defined(USG) || defined(STDC_HEADERS)
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
#include <string.h>
#else
#include <strings.h>
@@ -199,7 +203,7 @@ getgidbyname (group)
group_alist = tail;
return &tail->id.g;
}
tail->next = nogroup_alist;
nogroup_alist = tail;
return 0;

46
lib/interlock Executable file
View File

@@ -0,0 +1,46 @@
#! /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

@@ -12,8 +12,8 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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>

View File

@@ -12,8 +12,8 @@
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. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* A `struct linebuffer' holds a line of text. */
@@ -24,20 +24,21 @@ struct linebuffer
char *buffer;
};
#undef __P
#undef PARAMS
#if defined (__STDC__) && __STDC__
#define __P(x) x
# define PARAMS(Args) Args
#else
#define __P(x) ()
# define PARAMS(Args) ()
#endif
/* Initialize linebuffer LINEBUFFER for use. */
void initbuffer __P ((struct linebuffer *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.
Return LINEBUFFER, except at end of file return 0. */
struct linebuffer *readline __P ((struct linebuffer *linebuffer, FILE *stream));
struct linebuffer *readline PARAMS ((struct linebuffer *linebuffer,
FILE *stream));
/* Free linebuffer LINEBUFFER and its data, all allocated with malloc. */
void freebuffer __P ((struct linebuffer *));
void freebuffer PARAMS ((struct linebuffer *));

View File

@@ -12,10 +12,10 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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@comco.com) */
/* Written by Jim Meyering. */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -36,11 +36,12 @@ static struct option const long_options[] =
Be careful not to gobble up `--'. */
void
parse_long_options (argc, argv, command_name, version_string, usage)
parse_long_options (argc, argv, command_name, package, version, usage)
int argc;
char **argv;
const char *command_name;
const char *version_string;
const char *package;
const char *version;
void (*usage)();
{
int c;
@@ -62,7 +63,7 @@ parse_long_options (argc, argv, command_name, version_string, usage)
(*usage) (0);
case 'v':
printf ("%s - %s\n", command_name, version_string);
printf ("%s (%s) %s\n", command_name, package, version);
exit (0);
default:

View File

@@ -1,10 +1,31 @@
#undef __P
/* long-options.h -- declaration for --help- and --version-handling function.
Copyright (C) 1993, 1994 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. */
#undef PARAMS
#if defined (__STDC__) && __STDC__
#define __P(args) args
# define PARAMS(Args) Args
#else
#define __P(args) ()
# define PARAMS(Args) ()
#endif
void
parse_long_options __P ((int _argc, char **_argv, const char *_command_name,
const char *_version_string, void (*_usage) (int)));
parse_long_options PARAMS ((int _argc, char **_argv,
const char *_command_name,
const char *_package,
const char *_version, void (*_usage) (int)));

View File

@@ -12,58 +12,57 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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 David MacKenzie <djm@gnu.ai.mit.edu> and
Jim Meyering <meyering@cs.utexas.edu>. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu> and Jim Meyering. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef __GNUC__
#define alloca __builtin_alloca
#if __GNUC__
# define alloca __builtin_alloca
#else
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#else
#ifdef _AIX
# if HAVE_ALLOCA_H
# include <alloca.h>
# else
# ifdef _AIX
#pragma alloca
#else
# else
char *alloca ();
#endif
#endif
# endif
# endif
#endif
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef STAT_MACROS_BROKEN
#undef S_ISDIR
#endif /* STAT_MACROS_BROKEN. */
#if STAT_MACROS_BROKEN
# undef S_ISDIR
#endif
#if !defined(S_ISDIR) && defined(S_IFDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
#ifdef STDC_HEADERS
#include <stdlib.h>
#if STDC_HEADERS
# include <stdlib.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#if HAVE_ERRNO_H
# include <errno.h>
#endif
#ifndef errno
extern int errno;
#endif
#ifdef HAVE_STRING_H
#if HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>

View File

@@ -1,15 +1,15 @@
# undef __P
#if __STDC__
#undef __P
#define __P(args) args
# define __P(Args) Args
#else
#define __P(args) ()
# define __P(Args) ()
#endif
int
make_path __P ((const char *_argpath,
int _mode,
int _parent_mode,
uid_t _owner,
gid_t _group,
int _preserve_existing,
const char *_verbose_fmt_string));
make_path __P ((const char *_argpath,
int _mode,
int _parent_mode,
uid_t _owner,
gid_t _group,
int _preserve_existing,
const char *_verbose_fmt_string));

187
lib/md5.c
View File

@@ -1,11 +1,13 @@
/* md5.c - Functions to compute MD5 message digest of files or memory blocks
according to the definition of MD5 in RFC 1321 from April 1992.
Copyright (C) 1995 Software Foundation, Inc.
Copyright (C) 1995, 1996 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.
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 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
@@ -13,10 +15,10 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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 Ulrich Drepper <drepper@gnu.ai.mit.edu>. */
/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. */
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -24,7 +26,7 @@
#include <sys/types.h>
#if STDC_HEADERS
#if STDC_HEADERS || defined _LIBC
# include <stdlib.h>
# include <string.h>
#else
@@ -35,6 +37,13 @@
#include "md5.h"
#ifdef _LIBC
# include <endian.h>
# if __BYTE_ORDER == __BIG_ENDIAN
# define WORDS_BIGENDIAN 1
# endif
#endif
#ifdef WORDS_BIGENDIAN
# define SWAP(n) \
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
@@ -58,10 +67,16 @@ md5_init_ctx (ctx)
ctx->B = 0xefcdab89;
ctx->C = 0x98badcfe;
ctx->D = 0x10325476;
ctx->total[0] = ctx->total[1] = 0;
ctx->buflen = 0;
}
/* Put result from CTX in first 16 bytes following RESBUF. The result must
be in little endian byte order. */
/* Put result from CTX in first 16 bytes following RESBUF. The result
must be in little endian byte order.
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
void *
md5_read_ctx (ctx, resbuf)
const struct md5_ctx *ctx;
@@ -75,6 +90,39 @@ md5_read_ctx (ctx, resbuf)
return resbuf;
}
/* Process the remaining bytes in the internal buffer and the usual
prolog according to the standard and write the result to RESBUF.
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
void *
md5_finish_ctx (ctx, resbuf)
struct md5_ctx *ctx;
void *resbuf;
{
/* Take yet unprocessed bytes into account. */
md5_uint32 bytes = ctx->buflen;
size_t pad;
/* Now count remaining bytes. */
ctx->total[0] += bytes;
if (ctx->total[0] < bytes)
++ctx->total[1];
pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
memcpy (&ctx->buffer[bytes], fillbuf, pad);
/* Put the 64-bit file length in *bits* at the end of the buffer. */
*(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3);
*(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
(ctx->total[0] >> 29));
/* Process last bytes. */
md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
return md5_read_ctx (ctx, resbuf);
}
/* Compute MD5 message digest for bytes read from STREAM. The
resulting message digest number will be written into the 16 bytes
beginning at RESBLOCK. */
@@ -86,16 +134,12 @@ md5_stream (stream, resblock)
/* Important: BLOCKSIZE must be a multiple of 64. */
#define BLOCKSIZE 4096
struct md5_ctx ctx;
md5_uint32 len[2];
char buffer[BLOCKSIZE + 72];
size_t pad, sum;
size_t sum;
/* Initialize the computation context. */
md5_init_ctx (&ctx);
len[0] = 0;
len[1] = 0;
/* Iterate over full file contents. */
while (1)
{
@@ -108,7 +152,7 @@ md5_stream (stream, resblock)
/* Read block. Take care for partial reads. */
do
{
n = fread (buffer, 1, BLOCKSIZE - sum, stream);
n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
sum += n;
}
@@ -116,13 +160,6 @@ md5_stream (stream, resblock)
if (n == 0 && ferror (stream))
return 1;
/* RFC 1321 specifies the possible length of the file up to 2^64 bits.
Here we only compute the number of bytes. Do a double word
increment. */
len[0] += sum;
if (len[0] < sum)
++len[1];
/* If end of file is reached, end the loop. */
if (n == 0)
break;
@@ -133,27 +170,12 @@ md5_stream (stream, resblock)
md5_process_block (buffer, BLOCKSIZE, &ctx);
}
/* We can copy 64 byte because the buffer is always big enough. FILLBUF
contains the needed bits. */
memcpy (&buffer[sum], fillbuf, 64);
/* Compute amount of padding bytes needed. Alignment is done to
(N + PAD) % 64 == 56
There is always at least one byte padded. I.e. even the alignment
is correctly aligned 64 padding bytes are added. */
pad = sum & 63;
pad = pad >= 56 ? 64 + 56 - pad : 56 - pad;
/* Put the 64-bit file length in *bits* at the end of the buffer. */
*(md5_uint32 *) &buffer[sum + pad] = SWAP (len[0] << 3);
*(md5_uint32 *) &buffer[sum + pad + 4] = SWAP ((len[1] << 3)
| (len[0] >> 29));
/* Process last bytes. */
md5_process_block (buffer, sum + pad + 8, &ctx);
/* Add the last bytes if necessary. */
if (sum > 0)
md5_process_bytes (buffer, sum, &ctx);
/* Construct result in desired memory. */
md5_read_ctx (&ctx, resblock);
md5_finish_ctx (&ctx, resblock);
return 0;
}
@@ -168,37 +190,61 @@ md5_buffer (buffer, len, resblock)
void *resblock;
{
struct md5_ctx ctx;
char restbuf[64 + 72];
size_t blocks = len & ~63;
size_t pad, rest;
/* Initialize the computation context. */
md5_init_ctx (&ctx);
/* Process whole buffer but last len % 64 bytes. */
md5_process_block (buffer, blocks, &ctx);
/* REST bytes are not processed yet. */
rest = len - blocks;
/* Copy to own buffer. */
memcpy (restbuf, &buffer[blocks], rest);
/* Append needed fill bytes at end of buffer. We can copy 64 byte
because the buffer is always big enough. */
memcpy (&restbuf[rest], fillbuf, 64);
/* PAD bytes are used for padding to correct alignment. Note that
always at least one byte is padded. */
pad = rest >= 56 ? 64 + 56 - rest : 56 - rest;
/* Put length of buffer in *bits* in last eight bytes. */
*(md5_uint32 *) &restbuf[rest + pad] = (md5_uint32) SWAP (len << 3);
*(md5_uint32 *) &restbuf[rest + pad + 4] = (md5_uint32) SWAP (len >> 29);
/* Process last bytes. */
md5_process_block (restbuf, rest + pad + 8, &ctx);
md5_process_bytes (buffer, len, &ctx);
/* Put result in desired memory area. */
return md5_read_ctx (&ctx, resblock);
return md5_finish_ctx (&ctx, resblock);
}
void
md5_process_bytes (buffer, len, ctx)
const void *buffer;
size_t len;
struct md5_ctx *ctx;
{
/* When we already have some bits in our internal buffer concatenate
both inputs first. */
if (ctx->buflen != 0)
{
size_t left_over = ctx->buflen;
size_t add = 128 - left_over > len ? len : 128 - left_over;
memcpy (&ctx->buffer[left_over], buffer, add);
ctx->buflen += add;
if (left_over + add > 64)
{
md5_process_block (ctx->buffer, (left_over + add) & ~63, ctx);
/* The regions in the following copy operation cannot overlap. */
memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63],
(left_over + add) & 63);
ctx->buflen = (left_over + add) & 63;
}
buffer = (const char *) buffer + add;
len -= add;
}
/* Process available complete blocks. */
if (len > 64)
{
md5_process_block (buffer, len & ~63, ctx);
buffer = (const char *) buffer + (len & ~63);
len &= 63;
}
/* Move remaining bytes in internal buffer. */
if (len > 0)
{
memcpy (ctx->buffer, buffer, len);
ctx->buflen = len;
}
}
@@ -229,6 +275,13 @@ md5_process_block (buffer, len, ctx)
md5_uint32 C = ctx->C;
md5_uint32 D = ctx->D;
/* First increment the byte count. RFC 1321 specifies the possible
length of the file up to 2^64 bits. Here we only compute the
number of bytes. Do a double word increment. */
ctx->total[0] += len;
if (ctx->total[0] < len)
++ctx->total[1];
/* Process all bytes in the buffer with 64 bytes in each round of
the loop. */
while (words < endp)

107
lib/md5.h
View File

@@ -1,23 +1,25 @@
/* md5.h - Declaration of functions and data types used for MD5 sum
computing library functions.
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1996 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.
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 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.
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. */
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 _MD5_H
#define _MD5_H
#define _MD5_H 1
#include <stdio.h>
@@ -32,33 +34,38 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
the resulting executable. Locally running cross-compiled executables
is usually not possible. */
#if defined __STDC__ && __STDC__
# define UINT_MAX_32_BITS 4294967295U
#ifdef _LIBC
# include <sys/types.h>
typedef u_int32_t md5_uint32;
#else
# define UINT_MAX_32_BITS 0xFFFFFFFF
#endif
# if defined __STDC__ && __STDC__
# define UINT_MAX_32_BITS 4294967295U
# else
# define UINT_MAX_32_BITS 0xFFFFFFFF
# endif
/* If UINT_MAX isn't defined, assume it's a 32-bit type.
This should be valid for all systems GNU cares about because
that doesn't include 16-bit systems, and only modern systems
(that certainly have <limits.h>) have 64+-bit integral types. */
#ifndef UINT_MAX
# define UINT_MAX UINT_MAX_32_BITS
#endif
# ifndef UINT_MAX
# define UINT_MAX UINT_MAX_32_BITS
# endif
#if UINT_MAX == UINT_MAX_32_BITS
typedef unsigned int md5_uint32;
#else
# if USHRT_MAX == UINT_MAX_32_BITS
typedef unsigned short md5_uint32;
# if UINT_MAX == UINT_MAX_32_BITS
typedef unsigned int md5_uint32;
# else
# if ULONG_MAX == UINT_MAX_32_BITS
typedef unsigned long md5_uint32;
# if USHRT_MAX == UINT_MAX_32_BITS
typedef unsigned short md5_uint32;
# else
/* The following line is intended to evoke an error.
Using #error is not portable enough. */
"Cannot determine unsigned 32-bit data type."
# if ULONG_MAX == UINT_MAX_32_BITS
typedef unsigned long md5_uint32;
# else
/* The following line is intended to evoke an error.
Using #error is not portable enough. */
"Cannot determine unsigned 32-bit data type."
# endif
# endif
# endif
#endif
@@ -77,6 +84,10 @@ struct md5_ctx
md5_uint32 B;
md5_uint32 C;
md5_uint32 D;
md5_uint32 total[2];
md5_uint32 buflen;
char buffer[128];
};
/*
@@ -86,30 +97,50 @@ struct md5_ctx
/* Initialize structure containing state of computation.
(RFC 1321, 3.3: Step 3) */
void md5_init_ctx __P ((struct md5_ctx *ctx));
extern void md5_init_ctx __P ((struct md5_ctx *ctx));
/* Starting with the result of former calls of this function (or the
initialzation function update the context for the next LEN bytes
initialization function update the context for the next LEN bytes
starting at BUFFER.
It is necessary that LEN is a multiple of 64!!! */
void md5_process_block __P ((const void *buffer, size_t len,
struct md5_ctx *ctx));
extern void md5_process_block __P ((const void *buffer, size_t len,
struct md5_ctx *ctx));
/* Starting with the result of former calls of this function (or the
initialization function update the context for the next LEN bytes
starting at BUFFER.
It is NOT required that LEN is a multiple of 64. */
extern void md5_process_bytes __P ((const void *buffer, size_t len,
struct md5_ctx *ctx));
/* Process the remaining bytes in the buffer and put result from CTX
in first 16 bytes following RESBUF. The result is always in little
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
aligned for a 32 bits value. */
extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf));
/* Put result from CTX in first 16 bytes following RESBUF. The result is
always in little endian byte order, so that a byte-wise output yields
to the wanted ASCII representation of the message digest. */
void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf));
to the wanted ASCII representation of the message digest.
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
extern void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf));
/* Compute MD5 message digest for bytes read from STREAM. The
resulting message digest number will be written into the 16 bytes
beginning at RESBLOCK. */
int md5_stream __P ((FILE *stream, void *resblock));
extern int md5_stream __P ((FILE *stream, void *resblock));
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
result is always in little endian byte order, so that a byte-wise
output yields to the wanted ASCII representation of the message
digest. */
void *md5_buffer __P ((const char *buffer, size_t len, void *resblock));
extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock));
#endif

61
lib/memcasecmp.c Normal file
View File

@@ -0,0 +1,61 @@
/* Case-insensitive buffer comparator.
Copyright (C) 1996 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. */
/* Jim Meyering (meyering@na-net.ornl.gov) */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <ctype.h>
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
#define IN_CTYPE_DOMAIN(c) 1
#else
#define IN_CTYPE_DOMAIN(c) isascii(c)
#endif
#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
#if _LIBC || STDC_HEADERS
# define TOLOWER(c) tolower (c)
#else
# define TOLOWER(c) (ISUPPER (c) ? tolower (c) : (c))
#endif
#include "memcasecmp.h"
/* Like memcmp, but ignore differences in case. */
int
memcasecmp (vs1, vs2, n)
const void *vs1;
const void *vs2;
size_t n;
{
unsigned int i;
unsigned char *s1 = (unsigned char *) vs1;
unsigned char *s2 = (unsigned char *) vs2;
for (i = 0; i < n; i++)
{
unsigned char u1 = *s1++;
unsigned char u2 = *s2++;
if (TOLOWER (u1) != TOLOWER (u2))
return TOLOWER (u1) - TOLOWER (u2);
}
return 0;
}

9
lib/memcasecmp.h Normal file
View File

@@ -0,0 +1,9 @@
#undef PARAMS
#if defined (__STDC__) && __STDC__
# define PARAMS(Args) Args
#else
# define PARAMS(Args) ()
#endif
int
memcasecmp PARAMS ((const void *vs1, const void *vs2, size_t n));

View File

@@ -20,7 +20,8 @@ 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1993 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1993, 1995 Free Software Foundation, Inc.
Contributed by Torbjorn Granlund (tege@sics.se).
NOTE: The canonical source of this file is maintained with the GNU C Library.
@@ -15,8 +15,8 @@ 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
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"
@@ -364,3 +364,10 @@ memcmp (s1, s2, len)
return 0;
}
#ifdef weak_alias
#undef bcmp
weak_alias (memcmp, bcmp)
#endif

View File

@@ -2,6 +2,10 @@
if the source overlaps with the destination.
Return DESTADDR. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
char *
memcpy (destaddr, srcaddr, len)
char *destaddr;

View File

@@ -3,22 +3,26 @@
In the public domain.
By David MacKenzie <djm@gnu.ai.mit.edu>. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
void
void *
memmove (dest, source, length)
char *dest;
const char *source;
unsigned length;
{
char *d0 = dest;
if (source < dest)
/* Moving from low mem to hi mem; start at end. */
for (source += length, dest += length; length; --length)
*--dest = *--source;
else if (source != dest)
/* Moving from hi mem to low mem; start at beginning. */
for (; length; --length)
*dest++ = *source++;
{
/* Moving from hi mem to low mem; start at beginning. */
for (; length; --length)
*dest++ = *source++;
}
return (void *) d0;
}

View File

@@ -12,8 +12,8 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
char *
memset (str, c, len)

View File

@@ -1,4 +1,4 @@
/* mkdir.c -- BSD compatible make directory function for System V
/* BSD compatible make directory function for System V
Copyright (C) 1988, 1990 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -12,11 +12,11 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
@@ -26,12 +26,12 @@
extern int errno;
#endif
#ifdef STAT_MACROS_BROKEN
#undef S_ISDIR
#if STAT_MACROS_BROKEN
# undef S_ISDIR
#endif
#if !defined(S_ISDIR) && defined(S_IFDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
/* mkdir adapted from GNU tar. */

View File

@@ -1,45 +1,54 @@
/* Copyright (C) 1993, 1994 Free Software Foundation, Inc.
Contributed by Noel Cragg (noel@cs.oberlin.edu), with fixes by
Michael E. Calwas (calwas@ttd.teradyne.com) and
Wade Hampton (tasi029@tmn.com).
/* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
Contributed by Paul Eggert (eggert@twinsun.com).
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.
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.
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 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.
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, 675 Mass Ave, Cambridge, MA 02139, 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. */
/* Define this to have a standalone program to test this implementation of
mktime. */
/* #define DEBUG */
/* #define DEBUG 1 */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* Assume that leap seconds are possible, unless told otherwise.
If the host has a `zic' command with a `-L leapsecondfilename' option,
then it supports leap seconds; otherwise it probably doesn't. */
#ifndef LEAP_SECONDS_POSSIBLE
#define LEAP_SECONDS_POSSIBLE 1
#endif
#include <sys/types.h> /* Some systems define `time_t' here. */
#include <time.h>
#ifndef __isleap
/* Nonzero if YEAR is a leap year (every 4 years,
except every 100th isn't, and every 400th is). */
#define __isleap(year) \
((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
#if __STDC__ || __GNU_LIBRARY__ || STDC_HEADERS
#include <limits.h>
#endif
#if DEBUG
#include <stdio.h>
#if __STDC__ || __GNU_LIBRARY__ || STDC_HEADERS
#include <stdlib.h>
#endif
/* Make it work even if the system's libc has its own mktime routine. */
#define mktime my_mktime
#endif /* DEBUG */
#ifndef __P
#if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
#define __P(args) args
@@ -48,456 +57,352 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#endif /* GCC. */
#endif /* Not __P. */
/* How many days are in each month. */
const unsigned short int __mon_lengths[2][12] =
#ifndef CHAR_BIT
#define CHAR_BIT 8
#endif
#ifndef INT_MIN
#define INT_MIN (~0 << (sizeof (int) * CHAR_BIT - 1))
#endif
#ifndef INT_MAX
#define INT_MAX (~0 - INT_MIN)
#endif
#ifndef TIME_T_MIN
#define TIME_T_MIN (0 < (time_t) -1 ? (time_t) 0 \
: ~ (time_t) 0 << (sizeof (time_t) * CHAR_BIT - 1))
#endif
#ifndef TIME_T_MAX
#define TIME_T_MAX (~ (time_t) 0 - TIME_T_MIN)
#endif
#define TM_YEAR_BASE 1900
#define EPOCH_YEAR 1970
#ifndef __isleap
/* Nonzero if YEAR is a leap year (every 4 years,
except every 100th isn't, and every 400th is). */
#define __isleap(year) \
((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
#endif
/* How many days come before each month (0-12). */
const unsigned short int __mon_yday[2][13] =
{
/* Normal years. */
{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
/* Leap years. */
{ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
{ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
};
static int times_through_search; /* This library routine should never
hang -- make sure we always return
when we're searching for a value */
static time_t ydhms_tm_diff __P ((int, int, int, int, int, const struct tm *));
time_t __mktime_internal __P ((struct tm *,
struct tm *(*) (const time_t *, struct tm *),
time_t *));
#ifdef DEBUG
#include <stdio.h>
#include <ctype.h>
int debugging_enabled = 0;
/* Print the values in a `struct tm'. */
static void
printtm (it)
struct tm *it;
{
printf ("%02d/%02d/%04d %02d:%02d:%02d (%s) yday:%03d dst:%d gmtoffset:%ld",
it->tm_mon + 1,
it->tm_mday,
it->tm_year + 1900,
it->tm_hour,
it->tm_min,
it->tm_sec,
it->tm_zone,
it->tm_yday,
it->tm_isdst,
it->tm_gmtoff);
}
#endif
static time_t
dist_tm (t1, t2)
struct tm *t1;
struct tm *t2;
{
time_t distance = 0;
unsigned long int v1, v2;
int diff_flag = 0;
v1 = v2 = 0;
#define doit(x, secs) \
v1 += t1->x * secs; \
v2 += t2->x * secs; \
if (!diff_flag) \
{ \
if (t1->x < t2->x) \
diff_flag = -1; \
else if (t1->x > t2->x) \
diff_flag = 1; \
}
doit (tm_year, 31536000); /* Okay, not all years have 365 days. */
doit (tm_mon, 2592000); /* Okay, not all months have 30 days. */
doit (tm_mday, 86400);
doit (tm_hour, 3600);
doit (tm_min, 60);
doit (tm_sec, 1);
#undef doit
/* We should also make sure that the sign of DISTANCE is correct -- if
DIFF_FLAG is positive, the distance should be positive and vice versa. */
distance = (v1 > v2) ? (v1 - v2) : (v2 - v1);
if (diff_flag < 0)
distance = -distance;
if (times_through_search > 20) /* Arbitrary # of calls, but makes sure we
never hang if there's a problem with
this algorithm. */
{
distance = diff_flag;
}
/* We need this DIFF_FLAG business because it is forseeable that the
distance may be zero when, in actuality, the two structures are
different. This is usually the case when the dates are 366 days apart
and one of the years is a leap year. */
if (distance == 0 && diff_flag)
distance = 86400 * diff_flag;
return distance;
}
/* MKTIME converts the values in a struct tm to a time_t. The values
in tm_wday and tm_yday are ignored; other values can be put outside
of legal ranges since they will be normalized. This routine takes
care of that normalization. */
void
do_normalization (tmptr)
struct tm *tmptr;
{
#define normalize(foo,x,y,bar); \
while (tmptr->foo < x) \
{ \
tmptr->bar--; \
tmptr->foo = (y - (x - tmptr->foo) + 1); \
} \
while (tmptr->foo > y) \
{ \
tmptr->foo = (x + (tmptr->foo - y) - 1); \
tmptr->bar++; \
}
normalize (tm_sec, 0, 59, tm_min);
normalize (tm_min, 0, 59, tm_hour);
normalize (tm_hour, 0, 23, tm_mday);
/* Do the month first, so day range can be found. */
normalize (tm_mon, 0, 11, tm_year);
/* Since the day range modifies the month, we should be careful how
we reference the array of month lengths -- it is possible that
the month will go negative, hence the modulo...
Also, tm_year is the year - 1900, so we have to 1900 to have it
work correctly. */
normalize (tm_mday, 1,
__mon_lengths[__isleap (tmptr->tm_year + 1900)]
[((tmptr->tm_mon < 0)
? (12 + (tmptr->tm_mon % 12))
: (tmptr->tm_mon % 12)) ],
tm_mon);
/* Do the month again, because the day may have pushed it out of range. */
normalize (tm_mon, 0, 11, tm_year);
/* Do the day again, because the month may have changed the range. */
normalize (tm_mday, 1,
__mon_lengths[__isleap (tmptr->tm_year + 1900)]
[((tmptr->tm_mon < 0)
? (12 + (tmptr->tm_mon % 12))
: (tmptr->tm_mon % 12)) ],
tm_mon);
#ifdef DEBUG
if (debugging_enabled)
{
printf (" After normalizing:\n ");
printtm (tmptr);
putchar ('\n');
}
#endif
}
/* Here's where the work gets done. */
#define BAD_STRUCT_TM ((time_t) -1)
time_t
_mktime_internal (timeptr, producer)
struct tm *timeptr;
struct tm *(*producer) __P ((const time_t *));
{
struct tm our_tm; /* our working space */
struct tm *me = &our_tm; /* a pointer to the above */
time_t result; /* the value we return */
*me = *timeptr; /* copy the struct tm that was passed
in by the caller */
/***************************/
/* Normalize the structure */
/***************************/
/* This routine assumes that the value of TM_ISDST is -1, 0, or 1.
If the user didn't pass it in that way, fix it. */
if (me->tm_isdst > 0)
me->tm_isdst = 1;
else if (me->tm_isdst < 0)
me->tm_isdst = -1;
do_normalization (me);
/* Get out of here if it's not possible to represent this struct.
If any of the values in the normalized struct tm are negative,
our algorithms won't work. Luckily, we only need to check the
year at this point; normalization guarantees that all values will
be in correct ranges EXCEPT the year. */
if (me->tm_year < 0)
return BAD_STRUCT_TM;
/*************************************************/
/* Find the appropriate time_t for the structure */
/*************************************************/
/* Modified b-search -- make intelligent guesses as to where the
time might lie along the timeline, assuming that our target time
lies a linear distance (w/o considering time jumps of a
particular region).
Assume that time does not fluctuate at all along the timeline --
e.g., assume that a day will always take 86400 seconds, etc. --
and come up with a hypothetical value for the time_t
representation of the struct tm TARGET, in relation to the guess
variable -- it should be pretty close!
After testing this, the maximum number of iterations that I had
on any number that I tried was 3! Not bad.
The reason this is not a subroutine is that we will modify some
fields in the struct tm (yday and mday). I've never felt good
about side-effects when writing structured code... */
{
struct tm *guess_tm;
time_t guess = 0;
time_t distance = 0;
time_t last_distance = 0;
times_through_search = 0;
do
{
guess += distance;
times_through_search++;
guess_tm = (*producer) (&guess);
#ifdef DEBUG
if (debugging_enabled)
{
printf (" Guessing time_t == %d\n ", (int) guess);
printtm (guess_tm);
putchar ('\n');
}
#endif
/* How far is our guess from the desired struct tm? */
distance = dist_tm (me, guess_tm);
/* Handle periods of time where a period of time is skipped.
For example, 2:15 3 April 1994 does not exist, because DST
is in effect. The distance function will alternately
return values of 3600 and -3600, because it doesn't know
that the requested time doesn't exist. In these situations
(even if the skip is not exactly an hour) the distances
returned will be the same, but alternating in sign. We
want the later time, so check to see that the distance is
oscillating and we've chosen the correct of the two
possibilities.
Useful: 3 Apr 94 765356300, 30 Oct 94 783496000 */
if ((distance == -last_distance) && (distance < last_distance))
{
/* If the caller specified that the DST flag was off, it's
not possible to represent this time. */
if (me->tm_isdst == 0)
{
#ifdef DEBUG
printf (" Distance is oscillating -- dst flag nixes struct!\n");
#endif
return BAD_STRUCT_TM;
}
#ifdef DEBUG
printf (" Distance is oscillating -- chose the later time.\n");
#endif
distance = 0;
}
if ((distance == 0) && (me->tm_isdst != -1)
&& (me->tm_isdst != guess_tm->tm_isdst))
{
/* If we're in this code, we've got the right time but the
wrong daylight savings flag. We need to move away from
the time that we have and approach the other time from
the other direction. That is, if I've requested the
non-DST version of a time and I get the DST version
instead, I want to put us forward in time and search
backwards to get the other time. I checked all of the
configuration files for the tz package -- no entry
saves more than two hours, so I think we'll be safe by
moving 24 hours in one direction. IF THE AMOUNT OF
TIME SAVED IN THE CONFIGURATION FILES CHANGES, THIS
VALUE MAY NEED TO BE ADJUSTED. Luckily, we can never
have more than one level of overlaps, or this would
never work. */
#define SKIP_VALUE 86400
if (guess_tm->tm_isdst == 0)
/* we got the later one, but want the earlier one */
distance = -SKIP_VALUE;
else
distance = SKIP_VALUE;
#ifdef DEBUG
printf (" Got the right time, wrong DST value -- adjusting\n");
#endif
}
last_distance = distance;
} while (distance != 0);
/* Check to see that the dst flag matches */
if (me->tm_isdst != -1)
{
if (me->tm_isdst != guess_tm->tm_isdst)
{
#ifdef DEBUG
printf (" DST flag doesn't match! FIXME?\n");
#endif
return BAD_STRUCT_TM;
}
}
result = guess; /* Success! */
/* On successful completion, the values of tm_wday and tm_yday
have to be set appropriately. */
/* me->tm_yday = guess_tm->tm_yday;
me->tm_mday = guess_tm->tm_mday; */
*me = *guess_tm;
}
/* Update the caller's version of the structure */
*timeptr = *me;
return result;
}
time_t
#ifdef DEBUG /* make it work even if the system's
libc has it's own mktime routine */
my_mktime (timeptr)
#if ! HAVE_LOCALTIME_R && ! defined (localtime_r)
#ifdef _LIBC
#define localtime_r __localtime_r
#else
mktime (timeptr)
#endif
struct tm *timeptr;
/* Approximate localtime_r as best we can in its absence. */
#define localtime_r my_localtime_r
static struct tm *localtime_r __P ((const time_t *, struct tm *));
static struct tm *
localtime_r (t, tp)
const time_t *t;
struct tm *tp;
{
return _mktime_internal (timeptr, localtime);
struct tm *l = localtime (t);
if (! l)
return 0;
*tp = *l;
return tp;
}
#endif /* ! _LIBC */
#endif /* ! HAVE_LOCALTIME_R && ! defined (localtime_r) */
/* Yield the difference between (YEAR-YDAY HOUR:MIN:SEC) and (*TP),
measured in seconds, ignoring leap seconds.
YEAR uses the same numbering as TM->tm_year.
All values are in range, except possibly YEAR.
If overflow occurs, yield the low order bits of the correct answer. */
static time_t
ydhms_tm_diff (year, yday, hour, min, sec, tp)
int year, yday, hour, min, sec;
const struct tm *tp;
{
time_t ay = year + (time_t) (TM_YEAR_BASE - 1);
time_t by = tp->tm_year + (time_t) (TM_YEAR_BASE - 1);
time_t intervening_leap_days =
(ay/4 - by/4) - (ay/100 - by/100) + (ay/400 - by/400);
time_t years = ay - by;
time_t days = (365 * years + intervening_leap_days
+ (yday - tp->tm_yday));
return (60 * (60 * (24 * days + (hour - tp->tm_hour))
+ (min - tp->tm_min))
+ (sec - tp->tm_sec));
}
/* Convert *TP to a time_t value. */
time_t
mktime (tp)
struct tm *tp;
{
static time_t localtime_offset;
return __mktime_internal (tp, localtime_r, &localtime_offset);
}
/* Convert *TP to a time_t value, inverting
the monotonic and mostly-unit-linear conversion function CONVERT.
Use *OFFSET to keep track of a guess at the offset of the result,
compared to what the result would be for UTC without leap seconds.
If *OFFSET's guess is correct, only one CONVERT call is needed. */
time_t
__mktime_internal (tp, convert, offset)
struct tm *tp;
struct tm *(*convert) __P ((const time_t *, struct tm *));
time_t *offset;
{
time_t t, dt, t0;
struct tm tm;
/* The maximum number of probes (calls to CONVERT) should be enough
to handle any combinations of time zone rule changes, solar time,
and leap seconds. Posix.1 prohibits leap seconds, but some hosts
have them anyway. */
int remaining_probes = 4;
/* Time requested. Copy it in case CONVERT modifies *TP; this can
occur if TP is localtime's returned value and CONVERT is localtime. */
int sec = tp->tm_sec;
int min = tp->tm_min;
int hour = tp->tm_hour;
int mday = tp->tm_mday;
int mon = tp->tm_mon;
int year_requested = tp->tm_year;
int isdst = tp->tm_isdst;
/* Ensure that mon is in range, and set year accordingly. */
int mon_remainder = mon % 12;
int negative_mon_remainder = mon_remainder < 0;
int mon_years = mon / 12 - negative_mon_remainder;
int year = year_requested + mon_years;
/* The other values need not be in range:
the remaining code handles minor overflows correctly,
assuming int and time_t arithmetic wraps around.
Major overflows are caught at the end. */
/* Calculate day of year from year, month, and day of month.
The result need not be in range. */
int yday = ((__mon_yday[__isleap (year + TM_YEAR_BASE)]
[mon_remainder + 12 * negative_mon_remainder])
+ mday - 1);
#if LEAP_SECONDS_POSSIBLE
/* Handle out-of-range seconds specially,
since ydhms_tm_diff assumes every minute has 60 seconds. */
int sec_requested = sec;
if (sec < 0)
sec = 0;
if (59 < sec)
sec = 59;
#endif
/* Invert CONVERT by probing. First assume the same offset as last time.
Then repeatedly use the error to improve the guess. */
tm.tm_year = EPOCH_YEAR - TM_YEAR_BASE;
tm.tm_yday = tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
t0 = ydhms_tm_diff (year, yday, hour, min, sec, &tm);
for (t = t0 + *offset;
(dt = ydhms_tm_diff (year, yday, hour, min, sec, (*convert) (&t, &tm)));
t += dt)
if (--remaining_probes == 0)
return -1;
/* Check whether tm.tm_isdst has the requested value, if any. */
if (0 <= isdst && 0 <= tm.tm_isdst)
{
int dst_diff = (isdst != 0) - (tm.tm_isdst != 0);
if (dst_diff)
{
/* Move two hours in the direction indicated by the disagreement,
probe some more, and switch to a new time if found.
The largest known fallback due to daylight savings is two hours:
once, in Newfoundland, 1988-10-30 02:00 -> 00:00. */
time_t ot = t - 2 * 60 * 60 * dst_diff;
while (--remaining_probes != 0)
{
struct tm otm;
if (! (dt = ydhms_tm_diff (year, yday, hour, min, sec,
(*convert) (&ot, &otm))))
{
t = ot;
tm = otm;
break;
}
if ((ot += dt) == t)
break; /* Avoid a redundant probe. */
}
}
}
*offset = t - t0;
#if LEAP_SECONDS_POSSIBLE
if (sec_requested != tm.tm_sec)
{
/* Adjust time to reflect the tm_sec requested, not the normalized value.
Also, repair any damage from a false match due to a leap second. */
t += sec_requested - sec + (sec == 0 && tm.tm_sec == 60);
(*convert) (&t, &tm);
}
#endif
if (TIME_T_MAX / INT_MAX / 366 / 24 / 60 / 60 < 3)
{
/* time_t isn't large enough to rule out overflows in ydhms_tm_diff,
so check for major overflows. A gross check suffices,
since if t has overflowed, it is off by a multiple of
TIME_T_MAX - TIME_T_MIN + 1. So ignore any component of
the difference that is bounded by a small value. */
double dyear = (double) year_requested + mon_years - tm.tm_year;
double dday = 366 * dyear + mday;
double dsec = 60 * (60 * (24 * dday + hour) + min) + sec_requested;
if (TIME_T_MAX / 3 - TIME_T_MIN / 3 < (dsec < 0 ? - dsec : dsec))
return -1;
}
*tp = tm;
return t;
}
#ifdef weak_alias
weak_alias (mktime, timelocal)
#endif
#ifdef DEBUG
void
#if DEBUG
static int
not_equal_tm (a, b)
struct tm *a;
struct tm *b;
{
return ((a->tm_sec ^ b->tm_sec)
| (a->tm_min ^ b->tm_min)
| (a->tm_hour ^ b->tm_hour)
| (a->tm_mday ^ b->tm_mday)
| (a->tm_mon ^ b->tm_mon)
| (a->tm_year ^ b->tm_year)
| (a->tm_mday ^ b->tm_mday)
| (a->tm_yday ^ b->tm_yday)
| (a->tm_isdst ^ b->tm_isdst));
}
static void
print_tm (tp)
struct tm *tp;
{
printf ("%04d-%02d-%02d %02d:%02d:%02d yday %03d wday %d isdst %d",
tp->tm_year + TM_YEAR_BASE, tp->tm_mon + 1, tp->tm_mday,
tp->tm_hour, tp->tm_min, tp->tm_sec,
tp->tm_yday, tp->tm_wday, tp->tm_isdst);
}
static int
check_result (tk, tmk, tl, tml)
time_t tk;
struct tm tmk;
time_t tl;
struct tm tml;
{
if (tk != tl || not_equal_tm (&tmk, &tml))
{
printf ("mktime (");
print_tm (&tmk);
printf (")\nyields (");
print_tm (&tml);
printf (") == %ld, should be %ld\n", (long) tl, (long) tk);
return 1;
}
return 0;
}
int
main (argc, argv)
int argc;
char *argv[];
char **argv;
{
int time;
int result_time;
struct tm *tmptr;
if (argc == 1)
int status = 0;
struct tm tm, tmk, tml;
time_t tk, tl;
char trailer;
if ((argc == 3 || argc == 4)
&& (sscanf (argv[1], "%d-%d-%d%c",
&tm.tm_year, &tm.tm_mon, &tm.tm_mday, &trailer)
== 3)
&& (sscanf (argv[2], "%d:%d:%d%c",
&tm.tm_hour, &tm.tm_min, &tm.tm_sec, &trailer)
== 3))
{
long q;
printf ("starting long test...\n");
for (q = 10000000; q < 1000000000; q += 599)
{
struct tm *tm = localtime ((time_t *) &q);
if ((q % 10000) == 0) { printf ("%ld\n", q); fflush (stdout); }
if (q != my_mktime (tm))
{ printf ("failed for %ld\n", q); fflush (stdout); }
}
printf ("test finished\n");
exit (0);
tm.tm_year -= TM_YEAR_BASE;
tm.tm_mon--;
tm.tm_isdst = argc == 3 ? -1 : atoi (argv[3]);
tmk = tm;
tl = mktime (&tmk);
tml = *localtime (&tl);
printf ("mktime returns %ld == ", (long) tl);
print_tm (&tmk);
printf ("\n");
status = check_result (tl, tmk, tl, tml);
}
if (argc != 2)
else if (argc == 4 || (argc == 5 && strcmp (argv[4], "-") == 0))
{
printf ("wrong # of args\n");
exit (0);
time_t from = atol (argv[1]);
time_t by = atol (argv[2]);
time_t to = atol (argv[3]);
if (argc == 4)
for (tl = from; tl <= to; tl += by)
{
tml = *localtime (&tl);
tmk = tml;
tk = mktime (&tmk);
status |= check_result (tk, tmk, tl, tml);
}
else
for (tl = from; tl <= to; tl += by)
{
/* Null benchmark. */
tml = *localtime (&tl);
tmk = tml;
tk = tl;
status |= check_result (tk, tmk, tl, tml);
}
}
debugging_enabled = 1; /* We want to see the info */
else
printf ("Usage:\
\t%s YYYY-MM-DD HH:MM:SS [ISDST] # Test given time.\n\
\t%s FROM BY TO # Test values FROM, FROM+BY, ..., TO.\n\
\t%s FROM BY TO - # Do not test those values (for benchmark).\n",
argv[0], argv[0], argv[0]);
++argv;
time = atoi (*argv);
tmptr = localtime ((time_t *) &time);
printf ("Localtime tells us that a time_t of %d represents\n ", time);
printtm (tmptr);
putchar ('\n');
printf (" Given localtime's return val, mktime returns %d which is\n ",
(int) my_mktime (tmptr));
printtm (tmptr);
putchar ('\n');
#if 0
tmptr->tm_sec -= 20;
tmptr->tm_min -= 20;
tmptr->tm_hour -= 20;
tmptr->tm_mday -= 20;
tmptr->tm_mon -= 20;
tmptr->tm_year -= 20;
tmptr->tm_gmtoff -= 20000; /* This has no effect! */
tmptr->tm_zone = NULL; /* Nor does this! */
tmptr->tm_isdst = -1;
#endif
tmptr->tm_hour += 1;
tmptr->tm_isdst = -1;
printf ("\n\nchanged ranges: ");
printtm (tmptr);
putchar ('\n');
result_time = my_mktime (tmptr);
printf ("\nmktime: %d\n", result_time);
tmptr->tm_isdst = 0;
printf ("\n\nchanged ranges: ");
printtm (tmptr);
putchar ('\n');
result_time = my_mktime (tmptr);
printf ("\nmktime: %d\n", result_time);
return status;
}
#endif /* DEBUG */
#endif /* DEBUG */
/*
Local Variables:
compile-command: "gcc -g mktime.c -o mktime -DDEBUG"
compile-command: "gcc -DDEBUG=1 -Wall -O -g mktime.c -o mktime"
End:
*/

View File

@@ -12,8 +12,8 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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 David MacKenzie <djm@ai.mit.edu> */
@@ -24,30 +24,30 @@
changing the mode of many files, this probably results in a
performance gain. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include "modechange.h"
#ifdef STDC_HEADERS
#include <stdlib.h>
#if STDC_HEADERS
# include <stdlib.h>
#else
char *malloc ();
#endif
#ifndef NULL
#define NULL 0
# define NULL 0
#endif
#ifdef STAT_MACROS_BROKEN
#undef S_ISDIR
#endif /* STAT_MACROS_BROKEN. */
#if STAT_MACROS_BROKEN
# undef S_ISDIR
#endif
#if !defined(S_ISDIR) && defined(S_IFDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
/* Return newly allocated memory to hold one element of type TYPE. */
@@ -72,7 +72,7 @@ static int oatoi ();
struct mode_change *
mode_compile (mode_string, masked_ops)
register char *mode_string;
const char *mode_string;
unsigned masked_ops;
{
struct mode_change *head; /* First element of the linked list. */
@@ -244,7 +244,7 @@ invalid:
unsigned short
mode_adjust (oldmode, changes)
unsigned oldmode;
register struct mode_change *changes;
const struct mode_change *changes;
{
unsigned short newmode; /* The adjusted mode and one operand. */
unsigned short value; /* The other operand. */

View File

@@ -12,8 +12,8 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Masks for the `flags' field in a `struct mode_change'. */
@@ -44,12 +44,14 @@ struct mode_change
#define MODE_INVALID (struct mode_change *) 0
#define MODE_MEMORY_EXHAUSTED (struct mode_change *) 1
#ifdef __STDC__
struct mode_change *mode_compile (char *, unsigned);
unsigned short mode_adjust (unsigned, struct mode_change *);
void mode_free (struct mode_change *);
#else
struct mode_change *mode_compile ();
unsigned short mode_adjust ();
void mode_free ();
#ifndef __P
# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
# define __P(Args) Args
# else
# define __P(Args) ()
# endif
#endif
struct mode_change *mode_compile __P ((const char *, unsigned));
unsigned short mode_adjust __P ((unsigned, const struct mode_change *));
void mode_free __P ((struct mode_change *));

View File

@@ -12,8 +12,8 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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>
@@ -80,6 +80,10 @@ void error ();
#include <sys/statfs.h>
#endif
#ifdef MOUNTED_LISTMNTENT
#include <mntent.h>
#endif
#ifdef MOUNTED_GETMNTENT2 /* SVR4. */
#include <sys/mnttab.h>
#endif
@@ -130,10 +134,6 @@ fstype_to_string (t)
{
switch (t)
{
case MOUNT_UFS:
return "ufs";
case MOUNT_NFS:
return "nfs";
#ifdef MOUNT_PC
case MOUNT_PC:
return "pc";
@@ -153,6 +153,70 @@ fstype_to_string (t)
#ifdef MOUNT_TMP
case MOUNT_TMP:
return "tmp";
#endif
#ifdef MOUNT_UFS
case MOUNT_UFS:
return "ufs" ;
#endif
#ifdef MOUNT_NFS
case MOUNT_NFS:
return "nfs" ;
#endif
#ifdef MOUNT_MSDOS
case MOUNT_MSDOS:
return "msdos" ;
#endif
#ifdef MOUNT_LFS
case MOUNT_LFS:
return "lfs" ;
#endif
#ifdef MOUNT_LOFS
case MOUNT_LOFS:
return "lofs" ;
#endif
#ifdef MOUNT_FDESC
case MOUNT_FDESC:
return "fdesc" ;
#endif
#ifdef MOUNT_PORTAL
case MOUNT_PORTAL:
return "portal" ;
#endif
#ifdef MOUNT_NULL
case MOUNT_NULL:
return "null" ;
#endif
#ifdef MOUNT_UMAP
case MOUNT_UMAP:
return "umap" ;
#endif
#ifdef MOUNT_KERNFS
case MOUNT_KERNFS:
return "kernfs" ;
#endif
#ifdef MOUNT_PROCFS
case MOUNT_PROCFS:
return "procfs" ;
#endif
#ifdef MOUNT_AFS
case MOUNT_AFS:
return "afs" ;
#endif
#ifdef MOUNT_CD9660
case MOUNT_CD9660:
return "cd9660" ;
#endif
#ifdef MOUNT_UNION
case MOUNT_UNION:
return "union" ;
#endif
#ifdef MOUNT_DEVFS
case MOUNT_DEVFS:
return "devfs" ;
#endif
#ifdef MOUNT_EXT2FS
case MOUNT_EXT2FS:
return "ext2fs" ;
#endif
default:
return "?";
@@ -195,6 +259,36 @@ read_filesystem_list (need_fs_type, all_fs)
me->me_next = NULL;
mount_list = mtail = me;
#ifdef MOUNTED_LISTMNTENT
{
struct tabmntent *mntlist, *p;
struct mntent *mnt;
struct mount_entry *me;
/* the third and fourth arguments could be used to filter mounts,
but Crays doesn't seem to have any mounts that we want to
remove. Specifically, automount create normal NFS mounts.
*/
if(listmntent(&mntlist, KMTAB, NULL, NULL) < 0)
return NULL;
p = mntlist;
while(p){
mnt = p->ment;
me = (struct mount_entry*) xmalloc(sizeof (struct mount_entry));
me->me_devname = xstrdup(mnt->mnt_fsname);
me->me_mountdir = xstrdup(mnt->mnt_dir);
me->me_type = xstrdup(mnt->mnt_type);
me->me_dev = -1;
me->me_next = NULL;
mtail->me_next = me;
mtail = me;
p = p->next;
}
freemntlist(mntlist);
}
#endif
#ifdef MOUNTED_GETMNTENT1 /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */
{
struct mntent *mnt;
@@ -225,7 +319,7 @@ read_filesystem_list (need_fs_type, all_fs)
me->me_dev = xatoi (devopt + 4);
}
else
me->me_dev = -1; /* Magic; means not known yet. */
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
me->me_next = NULL;
/* Add to the linked list. */
@@ -256,7 +350,7 @@ read_filesystem_list (need_fs_type, all_fs)
#else
me->me_type = fstype_to_string (fsp->f_type);
#endif
me->me_dev = -1; /* Magic; means not known yet. */
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
me->me_next = NULL;
/* Add to the linked list. */
@@ -317,7 +411,7 @@ read_filesystem_list (need_fs_type, all_fs)
me->me_devname = xstrdup (stats[counter].f_mntfromname);
me->me_mountdir = xstrdup (stats[counter].f_mntonname);
me->me_type = mnt_names[stats[counter].f_type];
me->me_dev = -1; /* Magic; means not known yet. */
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
me->me_next = NULL;
/* Add to the linked list. */
@@ -350,7 +444,7 @@ read_filesystem_list (need_fs_type, all_fs)
strcpy (me->me_devname + 5, mnt.mt_dev);
#endif
me->me_mountdir = xstrdup (mnt.mt_filsys);
me->me_dev = -1; /* Magic; means not known yet. */
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
me->me_type = "";
#ifdef GETFSTYP /* SVR3. */
if (need_fs_type)
@@ -384,7 +478,7 @@ read_filesystem_list (need_fs_type, all_fs)
me->me_devname = xstrdup ( (*ent)->mt_resource);
me->me_mountdir = xstrdup( (*ent)->mt_directory);
me->me_type = xstrdup ((*ent)->mt_fstype);
me->me_dev = -1; /* Magic; means not known yet. */
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
me->me_next = NULL;
/* Add to the linked list. */
@@ -412,7 +506,7 @@ read_filesystem_list (need_fs_type, all_fs)
me->me_devname = xstrdup (mnt.mnt_special);
me->me_mountdir = xstrdup (mnt.mnt_mountp);
me->me_type = xstrdup (mnt.mnt_fstype);
me->me_dev = -1; /* Magic; means not known yet. */
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
me->me_next = NULL;
/* Add to the linked list. */
@@ -464,7 +558,7 @@ read_filesystem_list (need_fs_type, all_fs)
}
me->me_mountdir = xstrdup (thisent + vmp->vmt_data[VMT_STUB].vmt_off);
me->me_type = xstrdup (fstype_to_string (vmp->vmt_gfstype));
me->me_dev = -1; /* vmt_fsid might be the info we want. */
me->me_dev = (dev_t) -1; /* vmt_fsid might be the info we want. */
me->me_next = NULL;
/* Add to the linked list. */

View File

@@ -12,8 +12,8 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* A mount table entry. */
struct mount_entry

View File

@@ -1,10 +1,10 @@
/* obstack.c - subroutines used implicitly by object stack macros
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
Copyright (C) 1988,89,90,91,92,93,94,96 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 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
@@ -13,25 +13,37 @@ 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "obstack.h"
/* This is just to get __GNU_LIBRARY__ defined. */
#include <stdio.h>
/* NOTE BEFORE MODIFYING THIS FILE: This version number must be
incremented whenever callers compiled using an old obstack.h can no
longer properly call the functions in this obstack.c. */
#define OBSTACK_INTERFACE_VERSION 1
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
Library, but also included in many other GNU distributions. Compiling
actually compiling the library itself, and the installed library
supports the same library interface we do. This code is part of the GNU
C Library, but also included in many other GNU distributions. Compiling
and linking in this code is a waste when using the GNU C library
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
program understand `configure --with-gnu-libc' and omit the object
files, it is simpler to just do this in the source for each such file. */
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
#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
#endif
#ifdef __STDC__
#ifndef ELIDE_CODE
#if defined (__STDC__) && __STDC__
#define POINTER void *
#else
#define POINTER char *
@@ -69,14 +81,14 @@ struct obstack *_obstack;
#define CALL_CHUNKFUN(h, size) \
(((h) -> use_extra_arg) \
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
: (*(h)->chunkfun) ((size)))
: (*(struct _obstack_chunk *(*) ()) (h)->chunkfun) ((size)))
#define CALL_FREEFUN(h, old_chunk) \
do { \
if ((h) -> use_extra_arg) \
(*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
else \
(*(h)->freefun) ((old_chunk)); \
(*(void (*) ()) (h)->freefun) ((old_chunk)); \
} while (0)
@@ -267,7 +279,7 @@ _obstack_newchunk (h, length)
This is here for debugging.
If you use it in a program, you are probably losing. */
#ifdef __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);
@@ -374,7 +386,7 @@ obstack_free (h, obj)
/* Now define the functional versions of the obstack macros.
Define them to simply use the corresponding macros to do the job. */
#ifdef __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. */
@@ -482,4 +494,4 @@ POINTER (obstack_copy0) (obstack, pointer, length)
#endif /* 0 */
#endif /* _LIBC or not __GNU_LIBRARY__. */
#endif /* !ELIDE_CODE */

View File

@@ -1,10 +1,10 @@
/* obstack.h - object stack macros
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
Copyright (C) 1988,89,90,91,92,93,94,96 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 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
@@ -13,7 +13,7 @@ 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Summary:
@@ -102,11 +102,16 @@ Summary:
#ifndef __OBSTACK_H__
#define __OBSTACK_H__
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy)
# define bcopy(from, to, len) memcpy ((to), (from), (len))
#endif
/* We use subtraction of (char *)0 instead of casting to int
because on word-addressable machines a simple cast to int
may ignore the byte-within-word field of the pointer. */
@@ -136,21 +141,18 @@ Summary:
#include <stddef.h>
#endif
#include <sys/types.h>
#ifndef HAVE_PTRDIFF_T
# define ptrdiff_t off_t
#endif
#if defined (__STDC__) && __STDC__
#define PTR_INT_TYPE ptrdiff_t
#else
#define PTR_INT_TYPE long
#endif
#if HAVE_STRING_H || STDC_HEADERS
# include <string.h>
# ifndef bcopy
# define bcopy(s, d, n) memcpy ((d), (s), (n))
# endif
#else /* HAVE_STRING_H || STDC_HEADERS */
# include <strings.h>
#endif /* not (HAVE_STRING_H || STDC_HEADERS) */
struct _obstack_chunk /* Lives at front of each chunk. */
{
char *limit; /* 1 past end of this chunk */
@@ -167,9 +169,18 @@ 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__
/* 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. */
struct _obstack_chunk *(*chunkfun) (void *, long);
void (*freefun) (void *, struct _obstack_chunk *);
void *extra_arg; /* first arg for chunk alloc/dealloc funcs */
#else
struct _obstack_chunk *(*chunkfun) (); /* User's fcn to allocate a chunk. */
void (*freefun) (); /* User's function to free a chunk. */
char *extra_arg; /* first arg for chunk alloc/dealloc funcs */
#endif
unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */
unsigned maybe_empty_object:1;/* There is a possibility that the current
chunk contains a zero-length object. This
@@ -184,9 +195,10 @@ struct obstack /* control current object in current chunk */
extern void _obstack_newchunk (struct obstack *, int);
extern void _obstack_free (struct obstack *, void *);
extern int _obstack_begin (struct obstack *, int, int,
void *(*) (), void (*) ());
void *(*) (long), void (*) (void *));
extern int _obstack_begin_1 (struct obstack *, int, int,
void *(*) (), void (*) (), void *);
void *(*) (void *, long),
void (*) (void *, void *), void *);
#else
extern void _obstack_newchunk ();
extern void _obstack_free ();
@@ -255,6 +267,34 @@ int obstack_chunk_size (struct obstack *obstack);
#define obstack_alignment_mask(h) ((h)->alignment_mask)
/* To prevent prototype warnings provide complete argument list in
standard C version. */
#if defined (__STDC__) && __STDC__
#define obstack_init(h) \
_obstack_begin ((h), 0, 0, \
(void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
#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) \
_obstack_begin ((h), (size), (alignment), \
(void *(*) (long)) (chunkfun), (void (*) (void *)) (freefun))
#define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
_obstack_begin_1 ((h), (size), (alignment), \
(void *(*) (long)) (chunkfun), (void (*) (void *)) (freefun), (arg))
#define obstack_chunkfun(h, newchunkfun) \
((h) -> chunkfun = (struct _obstack_chunk *(*)(long)) (newchunkfun))
#define obstack_freefun(h, newfreefun) \
((h) -> freefun = (void (*)(void *)) (newfreefun))
#else
#define obstack_init(h) \
_obstack_begin ((h), 0, 0, \
(void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
@@ -277,11 +317,13 @@ int obstack_chunk_size (struct obstack *obstack);
#define obstack_freefun(h, newfreefun) \
((h) -> freefun = (void (*)()) (newfreefun))
#endif
#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = achar)
#define obstack_blank_fast(h,n) ((h)->next_free += (n))
#if defined (__GNUC__) && defined (__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__. */

61
lib/path-concat.c Normal file
View File

@@ -0,0 +1,61 @@
/* path-concat.c -- concatenate two arbitrary pathnames
Copyright (C) 1996 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. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
char *malloc ();
char *stpcpy ();
/* 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. */
char *
path_concat (dir, base, base_in_result)
const char *dir;
const char *base;
char **base_in_result;
{
char *p;
char *p_concat;
p_concat = malloc (strlen (dir) + strlen (base) + 2);
if (!p_concat)
return 0;
p = stpcpy (p_concat, dir);
if (*(p - 1) == '/' && *base == '/')
--p;
else if (*(p - 1) != '/' && *base != '/')
p = stpcpy (p, "/");
if (base_in_result)
*base_in_result = p;
stpcpy (p, base);
return p_concat;
}

9
lib/path-concat.h Normal file
View File

@@ -0,0 +1,9 @@
#if __STDC__
# undef __P
# define __P(args) args
#else
# define __P(args) ()
#endif
char *
path_concat __P ((const char *dir, const char *base, char **base_in_result));

View File

@@ -12,8 +12,8 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _PATHMAX_H
#define _PATHMAX_H

View File

@@ -12,28 +12,50 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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 Kingdon and David MacKenzie. */
%{
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* The following block of alloca-related preprocessor directives is here
solely to allow compilation by non GNU-C compilers of the C parser
produced from this file by old versions of bison. Newer versions of
bison include a block similar to this one in bison.simple. */
#ifdef __GNUC__
#define alloca __builtin_alloca
#else
#ifdef sparc
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#else
#ifdef _AIX
#pragma alloca
#else
char *alloca ();
void *alloca ();
#endif
#endif
#endif
#include <stdio.h>
#include <sys/types.h>
#ifdef TM_IN_SYS_TIME
#include <sys/time.h>
#else
#include <time.h>
#endif
/* Some old versions of bison generate parsers that use bcopy.
That loses on systems that don't provide the function, so we have
to redefine it here. */
#if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy)
#define bcopy(from, to, len) memcpy ((to), (from), (len))
#endif
#define YYDEBUG 1
@@ -45,9 +67,56 @@ static struct tm t;
time_t mktime ();
#define yyparse posixtime_yyparse
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
as well as gratuitiously global symbol names, so we can have multiple
yacc generated parsers in the same program. Note that these are only
the variables produced by yacc. If other parser generators (bison,
byacc, etc) produce additional global names that conflict at link time,
then those parser generators need to be fixed instead of adding those
names to this list. */
#define yymaxdepth pt_maxdepth
#define yyparse pt_parse
#define yylex pt_lex
#define yyerror pt_error
#define yylval pt_lval
#define yychar pt_char
#define yydebug pt_debug
#define yypact pt_pact
#define yyr1 pt_r1
#define yyr2 pt_r2
#define yydef pt_def
#define yychk pt_chk
#define yypgo pt_pgo
#define yyact pt_act
#define yyexca pt_exca
#define yyerrflag pt_errflag
#define yynerrs pt_nerrs
#define yyps pt_ps
#define yypv pt_pv
#define yys pt_s
#define yy_yys pt_yys
#define yystate pt_state
#define yytmp pt_tmp
#define yyv pt_v
#define yy_yyv pt_yyv
#define yyval pt_val
#define yylloc pt_lloc
#define yyreds pt_reds /* With YYDEBUG defined */
#define yytoks pt_toks /* With YYDEBUG defined */
#define yylhs pt_yylhs
#define yylen pt_yylen
#define yydefred pt_yydefred
#define yydgoto pt_yydgoto
#define yysindex pt_yysindex
#define yyrindex pt_yyrindex
#define yygindex pt_yygindex
#define yytable pt_yytable
#define yycheck pt_yycheck
static int yylex ();
static int yyerror ();
%}
%token DIGIT

View File

@@ -15,13 +15,13 @@ 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
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>
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif
/* Define-away any (possibly conflicting) prototype of putenv.
@@ -29,26 +29,26 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define putenv _sys_putenv
#if defined (__GNU_LIBRARY__) || defined (HAVE_STDLIB_H)
#include <stdlib.h>
# include <stdlib.h>
#endif
#if defined (__GNU_LIBRARY__) || defined (HAVE_STRING_H)
#include <string.h>
# include <string.h>
#endif
#if defined (__GNU_LIBRARY__) || defined (HAVE_UNISTD_H)
#include <unistd.h>
# include <unistd.h>
#endif
#undef putenv
#if !defined (__GNU_LIBRARY__) && !defined (HAVE_STRCHR)
#define strchr index
# define strchr index
#endif
#if !defined (__GNU_LIBRARY__) && !defined (HAVE_MEMCPY)
#define memcpy(d,s,n) bcopy ((s), (d), (n))
# define memcpy(d,s,n) bcopy ((s), (d), (n))
#endif
#if HAVE_GNU_LD
#define environ __environ
# define environ __environ
#else
extern char **environ;
#endif

View File

@@ -12,8 +12,8 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA.
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. */
@@ -28,23 +28,23 @@
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
# include <config.h>
#endif
#include <stdio.h>
#ifdef STDC_HEADERS
#include <stdlib.h>
# include <stdlib.h>
#endif
#if defined (STDC_HEADERS) || defined(HAVE_STRING_H)
#include <string.h>
# include <string.h>
/* An ANSI string.h and pre-ANSI memory.h might conflict. */
#if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H)
#include <memory.h>
#endif /* not STDC_HEADERS and HAVE_MEMORY_H */
# if !defined (STDC_HEADERS) && defined (HAVE_MEMORY_H)
# include <memory.h>
# endif /* not STDC_HEADERS and HAVE_MEMORY_H */
#else /* not STDC_HEADERS and not HAVE_STRING_H */
#include <strings.h>
# include <strings.h>
/* memory.h and strings.h conflict on some systems. */
#endif /* not STDC_HEADERS and not HAVE_STRING_H */
@@ -58,7 +58,8 @@ void *xrealloc ();
/* Initialize a tokenbuffer. */
void
init_tokenbuffer (token_buffer *tokenbuffer)
init_tokenbuffer (tokenbuffer)
token_buffer *tokenbuffer;
{
tokenbuffer->size = INITIAL_TOKEN_LENGTH;
tokenbuffer->buffer = ((char *) xmalloc (INITIAL_TOKEN_LENGTH));
@@ -76,8 +77,11 @@ init_tokenbuffer (token_buffer *tokenbuffer)
and on files that aren't newline-terminated. */
long
readtoken (FILE *stream, const char *delim, int n_delim,
token_buffer *tokenbuffer)
readtoken (stream, delim, n_delim, tokenbuffer)
FILE *stream;
const char *delim;
int n_delim;
token_buffer *tokenbuffer;
{
char *p;
int c, i, n;
@@ -160,9 +164,14 @@ readtoken (FILE *stream, const char *delim, int n_delim,
%%% realloc() of `tokens' just before returning? */
int
readtokens (FILE *stream, int projected_n_tokens,
const char *delim, int n_delim,
char ***tokens_out, long **token_lengths)
readtokens (stream, projected_n_tokens, delim, n_delim,
tokens_out, token_lengths)
FILE *stream;
int projected_n_tokens;
const char *delim;
int n_delim;
char ***tokens_out;
long **token_lengths;
{
token_buffer tb, *token = &tb;
int token_length;

View File

@@ -1,12 +1,12 @@
#ifndef H_READTOKENS_H
#define H_READTOKENS_H
# define H_READTOKENS_H
#ifndef INITIAL_TOKEN_LENGTH
#define INITIAL_TOKEN_LENGTH 20
#endif
# ifndef INITIAL_TOKEN_LENGTH
# define INITIAL_TOKEN_LENGTH 20
# endif
#ifndef TOKENBUFFER_DEFINED
#define TOKENBUFFER_DEFINED
# ifndef TOKENBUFFER_DEFINED
# define TOKENBUFFER_DEFINED
struct tokenbuffer
{
long size;
@@ -14,16 +14,23 @@ struct tokenbuffer
};
typedef struct tokenbuffer token_buffer;
#endif /* not TOKENBUFFER_DEFINED */
# endif /* not TOKENBUFFER_DEFINED */
void init_tokenbuffer (token_buffer *tokenbuffer);
# undef __P
# if defined (__STDC__) && __STDC__
# define __P(x) x
# else
# define __P(x) ()
# endif
void init_tokenbuffer __P ((token_buffer *tokenbuffer));
long
readtoken (FILE *stream, const char *delim, int n_delim,
token_buffer *tokenbuffer);
readtoken __P ((FILE *stream, const char *delim, int n_delim,
token_buffer *tokenbuffer));
int
readtokens (FILE *stream, int projected_n_tokens,
readtokens __P ((FILE *stream, int projected_n_tokens,
const char *delim, int n_delim,
char ***tokens_out, long **token_lengths);
char ***tokens_out, long **token_lengths));
#endif /* not H_READTOKENS_H */

File diff suppressed because it is too large Load Diff

View File

@@ -14,8 +14,8 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef __REGEXP_LIBRARY_H__
#define __REGEXP_LIBRARY_H__
@@ -42,7 +42,7 @@ typedef unsigned reg_syntax_t;
#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
/* If this bit is not set, then + and ? are operators, and \+ and \? are
literals.
literals.
If set, then \+ and \? are operators and + and ? are literals. */
#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
@@ -58,7 +58,7 @@ typedef unsigned reg_syntax_t;
^ is an anchor if it is at the beginning of a regular
expression or after an open-group or an alternation operator;
$ is an anchor if it is at the end of a regular expression, or
before a close-group or an alternation operator.
before a close-group or an alternation operator.
This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
POSIX draft 11.2 says that * etc. in leading positions is undefined.
@@ -69,7 +69,7 @@ typedef unsigned reg_syntax_t;
/* If this bit is set, then special characters are always special
regardless of where they are in the pattern.
If this bit is not set, then special characters are special only in
some contexts; otherwise they are ordinary. Specifically,
some contexts; otherwise they are ordinary. Specifically,
* + ? and intervals are only special when not after the beginning,
open-group, or alternation operator. */
#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
@@ -91,7 +91,7 @@ typedef unsigned reg_syntax_t;
#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
/* If this bit is set, either \{...\} or {...} defines an
interval, depending on RE_NO_BK_BRACES.
interval, depending on RE_NO_BK_BRACES.
If not set, \{, \}, {, and } are literals. */
#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
@@ -116,7 +116,7 @@ typedef unsigned reg_syntax_t;
If not set, then \<digit> is a back-reference. */
#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
/* If this bit is set, then | is an alternation operator, and \| is literal.
/* If this bit is set, then | is an alternation operator, and \| is literal.
If not set, then \| is an alternation operator, and | is literal. */
#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
@@ -142,7 +142,7 @@ extern reg_syntax_t re_syntax_options;
/* Define combinations of the above bits for the standard possibilities.
(The [[[ comments delimit what gets put into the Texinfo file, so
don't delete them!) */
don't delete them!) */
/* [[[begin syntaxes]]] */
#define RE_SYNTAX_EMACS 0
@@ -209,7 +209,7 @@ extern reg_syntax_t re_syntax_options;
#ifdef RE_DUP_MAX
#undef RE_DUP_MAX
#endif
#define RE_DUP_MAX ((1 << 15) - 1)
#define RE_DUP_MAX ((1 << 15) - 1)
/* POSIX `cflags' bits (i.e., information for `regcomp'). */
@@ -221,7 +221,7 @@ extern reg_syntax_t re_syntax_options;
/* If this bit is set, then ignore case when matching.
If not set, then case is significant. */
#define REG_ICASE (REG_EXTENDED << 1)
/* If this bit is set, then anchors do not match at newline
characters in the string.
If not set, then anchors do match at newlines. */
@@ -260,7 +260,7 @@ typedef enum
REG_EESCAPE, /* Trailing backslash. */
REG_ESUBREG, /* Invalid back reference. */
REG_EBRACK, /* Unmatched left bracket. */
REG_EPAREN, /* Parenthesis imbalance. */
REG_EPAREN, /* Parenthesis imbalance. */
REG_EBRACE, /* Unmatched \{. */
REG_BADBR, /* Invalid contents of \{\}. */
REG_ERANGE, /* Invalid range end. */
@@ -279,6 +279,10 @@ typedef enum
compiled, the `re_nsub' field is available. All other fields are
private to the regex routines. */
#ifndef RE_TRANSLATE_TYPE
#define RE_TRANSLATE_TYPE char *
#endif
struct re_pattern_buffer
{
/* [[[begin pattern_buffer]]] */
@@ -291,7 +295,7 @@ struct re_pattern_buffer
unsigned long allocated;
/* Number of bytes actually used in `buffer'. */
unsigned long used;
unsigned long used;
/* Syntax setting with which the pattern was compiled. */
reg_syntax_t syntax;
@@ -305,7 +309,7 @@ struct re_pattern_buffer
comparing them, or zero for no translation. The translation
is applied to a pattern when it is compiled and to a string
when it is matched. */
char *translate;
RE_TRANSLATE_TYPE translate;
/* Number of subexpressions found by the compiler. */
size_t re_nsub;
@@ -335,7 +339,7 @@ struct re_pattern_buffer
unsigned no_sub : 1;
/* If set, a beginning-of-line anchor doesn't match at the
beginning of the string. */
beginning of the string. */
unsigned not_bol : 1;
/* Similarly for an end-of-line anchor. */
@@ -442,7 +446,7 @@ extern int re_match
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
extern int re_match_2
extern int re_match_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, struct re_registers *regs, int stop));

View File

@@ -1,4 +1,4 @@
/* rename.c -- BSD compatible directory function for System V
/* 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
@@ -12,11 +12,11 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
@@ -26,12 +26,12 @@
extern int errno;
#endif
#ifdef STAT_MACROS_BROKEN
#undef S_ISDIR
#endif /* STAT_MACROS_BROKEN. */
#if STAT_MACROS_BROKEN
# undef S_ISDIR
#endif
#if !defined(S_ISDIR) && defined(S_IFDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
/* Rename file FROM to file TO.
@@ -67,6 +67,12 @@ rename (from, to)
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. */
@@ -90,6 +96,9 @@ rename (from, to)
}
}
else
#endif /* MVDIR */
{
if (link (from, to))
return -1;

View File

@@ -1,4 +1,4 @@
/* rmdir.c -- BSD compatible remove directory function for System V
/* BSD compatible remove directory function for System V
Copyright (C) 1988, 1990 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -12,11 +12,11 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
@@ -27,12 +27,12 @@
extern int errno;
#endif
#ifdef STAT_MACROS_BROKEN
#undef S_ISDIR
#if STAT_MACROS_BROKEN
# undef S_ISDIR
#endif
#if !defined(S_ISDIR) && defined(S_IFDIR)
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
/* rmdir adapted from GNU tar. */

91
lib/rpmatch.c Normal file
View File

@@ -0,0 +1,91 @@
/* rpmatch - determine whether string value is affirmation or negative
response according to current locale's data
Copyright (C) 1996 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. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#if STDC_HEADERS || _LIBC
# include <stddef.h>
# include <stdlib.h>
#else
# ifndef NULL
# define NULL 0
# endif
#endif
#include <sys/types.h>
#ifdef WITH_REGEX
# include <regex.h>
#else
# include <rx.h>
#endif
#if ENABLE_NLS
# include <libintl.h>
# define _(Text) gettext (Text)
#else
# define _(Text) Text
#endif
static int
try (response, pattern, match, nomatch, lastp, re)
const char *response;
const char *pattern;
const int match;
const int nomatch;
const char **lastp;
regex_t *re;
{
if (pattern != *lastp)
{
/* The pattern has changed. */
if (*lastp)
{
/* Free the old compiled pattern. */
regfree (re);
*lastp = NULL;
}
/* Compile the pattern and cache it for future runs. */
if (regcomp (re, pattern, REG_EXTENDED) != 0)
return -1;
*lastp = pattern;
}
/* See if the regular expression matches RESPONSE. */
return regexec (re, response, 0, NULL, 0) == 0 ? match : nomatch;
}
int
rpmatch (response)
const char *response;
{
/* Match against one of the response patterns, compiling the pattern
first if necessary. */
/* We cache the response patterns and compiled regexps here. */
static const char *yesexpr, *noexpr;
static regex_t yesre, nore;
int result;
return ((result = try (response, _("^[yY]"), 1, 0,
&yesexpr, &yesre))
? result
: try (response, _("^[nN]"), 0, -1, &noexpr, &nore));
}

7185
lib/rx.c Normal file

File diff suppressed because it is too large Load Diff

3732
lib/rx.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -12,18 +12,18 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA.
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>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <errno.h>

View File

@@ -1,3 +1,22 @@
/* save-cwd.c -- Save and restore current working directory.
Copyright (C) 1995 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 <meyering@na-net.ornl.gov>. */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

View File

@@ -12,8 +12,8 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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 David MacKenzie <djm@gnu.ai.mit.edu>. */

129
lib/setenv.c Normal file
View File

@@ -0,0 +1,129 @@
/* Copyright (C) 1992, 1995 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.
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. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <errno.h>
#if _LIBC || HAVE_STDLIB_H
# include <stdlib.h>
#endif
#if _LIBC || HAVE_STRING_H
# include <string.h>
#endif
#if _LIBC || HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifndef HAVE_GNU_LD
# define __environ environ
#endif
int
setenv (name, value, replace)
const char *name;
const char *value;
int replace;
{
register char **ep;
register size_t size;
const size_t namelen = strlen (name);
const size_t vallen = strlen (value) + 1;
size = 0;
for (ep = __environ; *ep != NULL; ++ep)
if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=')
break;
else
++size;
if (*ep == NULL)
{
static char **last_environ;
char **new_environ;
if (__environ == last_environ)
/* We allocated this space; we can extend it. */
new_environ = (char **) realloc (last_environ,
(size + 2) * sizeof (char *));
else
new_environ = (char **) malloc ((size + 2) * sizeof (char *));
if (new_environ == NULL)
return -1;
new_environ[size] = malloc (namelen + 1 + vallen);
if (new_environ[size] == NULL)
{
free ((char *) new_environ);
errno = ENOMEM;
return -1;
}
if (__environ != last_environ)
memcpy ((char *) new_environ, (char *) __environ,
size * sizeof (char *));
memcpy (new_environ[size], name, namelen);
new_environ[size][namelen] = '=';
memcpy (&new_environ[size][namelen + 1], value, vallen);
new_environ[size + 1] = NULL;
last_environ = __environ = new_environ;
}
else if (replace)
{
size_t len = strlen (*ep);
if (len + 1 < namelen + 1 + vallen)
{
/* The existing string is too short; malloc a new one. */
char *new = malloc (namelen + 1 + vallen);
if (new == NULL)
return -1;
*ep = new;
}
memcpy (*ep, name, namelen);
(*ep)[namelen] = '=';
memcpy (&(*ep)[namelen + 1], value, vallen);
}
return 0;
}
void
unsetenv (name)
const char *name;
{
const size_t len = strlen (name);
char **ep;
for (ep = __environ; *ep; ++ep)
if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
{
/* Found it. Remove this pointer by moving later ones back. */
char **dp = ep;
do
dp[0] = dp[1];
while (*dp++);
/* Continue the loop in case NAME appears again. */
}
}

17
lib/setenv.h Normal file
View File

@@ -0,0 +1,17 @@
#ifndef SETENV_H
# define SETENV_H 1
# undef __P
# if defined (__STDC__) && __STDC__
# define __P(x) x
# else
# define __P(x) ()
# endif
int
setenv __P ((const char *name, const char *value, int replace));
void
unsetenv __P ((const char *name));
#endif /* SETENV_H */

View File

@@ -12,11 +12,15 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* David MacKenzie <djm@ai.mit.edu> */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <sys/types.h>
#include <sys/time.h>

View File

@@ -12,11 +12,11 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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>
#if HAVE_CONFIG_H
# include <config.h>
#endif
/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */

View File

@@ -11,20 +11,20 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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>
# include <config.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
# include <string.h>
#else
#include <strings.h>
#ifndef strchr
#define strchr index
#endif
# include <strings.h>
# ifndef strchr
# define strchr index
# endif
#endif
/* Return the length of the maximum inital segment of S

View File

@@ -12,8 +12,12 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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
#ifdef STDC_HEADERS
#include <string.h>
@@ -23,10 +27,6 @@ char *malloc ();
char *strcpy ();
#endif
#if !__STDC__
#define const
#endif
/* Return a newly allocated copy of STR,
or 0 if out of memory. */

File diff suppressed because it is too large Load Diff

View File

@@ -12,13 +12,17 @@
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
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(STDC_HEADERS) || defined(USG)
#include <string.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
# include <string.h>
#else
#include <strings.h>
# include <strings.h>
#endif
/* Remove trailing slashes from PATH.

49
lib/strndup.c Normal file
View File

@@ -0,0 +1,49 @@
/* Copyright (C) 1996 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.
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. */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <sys/types.h>
#ifdef STDC_HEADERS
# include <string.h>
# include <stdlib.h>
#else
char *malloc ();
#endif
/* Duplicate S, returning an identical malloc'd string. */
char *
strndup (s, n)
const char *s;
size_t n;
{
char *new = malloc (n + 1);
if (new == NULL)
return NULL;
memcpy (new, s, n);
new[n] = '\0';
return new;
}

39
lib/strpbrk.c Normal file
View File

@@ -0,0 +1,39 @@
/* Copyright (C) 1991, 1994 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.
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. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
/* Find the first ocurrence in S of any character in ACCEPT. */
char *
strpbrk (s, accept)
register const char *s;
register const char *accept;
{
while (*s != '\0')
{
const char *a = accept;
while (*a != '\0')
if (*a++ == *s)
return (char *) s;
++s;
}
return 0;
}

View File

@@ -1,49 +1,116 @@
/* strstr.c -- return the offset of one string within another
Copyright (C) 1989, 1990 Free Software Foundation, Inc.
/* Copyright (C) 1994 Free Software Foundation, Inc.
This file is part of the GNU C Library.
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 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.
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., 675 Mass Ave, Cambridge, MA 02139, 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. */
/* Author:
Mike Rendell Department of Computer Science
michael@garfield.mun.edu Memorial University of Newfoundland
..!uunet!garfield!michael St. John's, Nfld., Canada
(709) 737-4550 A1C 5S7
*/
/*
* My personal strstr() implementation that beats most other algorithms.
* Until someone tells me otherwise, I assume that this is the
* fastest implementation of strstr() in C.
* I deliberately chose not to comment it. You should have at least
* as much fun trying to understand it, as I had to write it :-).
*
* Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */
/* Return the starting address of string S2 in S1;
return 0 if it is not found. */
#include <string.h>
#include <sys/types.h>
typedef unsigned chartype;
char *
strstr (s1, s2)
char *s1;
char *s2;
strstr (phaystack, pneedle)
const char *phaystack;
const char *pneedle;
{
int i;
char *p1;
char *p2;
char *s = s1;
register const unsigned char *haystack, *needle;
register chartype b, c;
for (p2 = s2, i = 0; *s; p2 = s2, i++, s++)
haystack = (const unsigned char *) phaystack;
needle = (const unsigned char *) pneedle;
b = *needle;
if (b != '\0')
{
for (p1 = s; *p1 && *p2 && *p1 == *p2; p1++, p2++)
;
if (!*p2)
break;
}
if (!*p2)
return s1 + i;
haystack--; /* possible ANSI violation */
do
{
c = *++haystack;
if (c == '\0')
goto ret0;
}
while (c != b);
c = *++needle;
if (c == '\0')
goto foundneedle;
++needle;
goto jin;
for (;;)
{
register chartype a;
register const unsigned char *rhaystack, *rneedle;
do
{
a = *++haystack;
if (a == '\0')
goto ret0;
if (a == b)
break;
a = *++haystack;
if (a == '\0')
goto ret0;
shloop: }
while (a != b);
jin: a = *++haystack;
if (a == '\0')
goto ret0;
if (a != c)
goto shloop;
rhaystack = haystack-- + 1;
rneedle = needle;
a = *rneedle;
if (*rhaystack == a)
do
{
if (a == '\0')
goto foundneedle;
++rhaystack;
a = *++needle;
if (*rhaystack != a)
break;
if (a == '\0')
goto foundneedle;
++rhaystack;
a = *++needle;
}
while (*rhaystack == a);
needle = rneedle; /* took the register-poor aproach */
if (a == '\0')
break;
}
}
foundneedle:
return (char*) haystack;
ret0:
return 0;
}

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