Compare commits

...

596 Commits

Author SHA1 Message Date
Jim Meyering
2fc81ec762 . 1997-08-18 20:03:36 +00:00
Jim Meyering
b5ef7a4be7 (show_date): Don't hang if strftime produces an empty string. 1997-08-18 19:50:35 +00:00
Jim Meyering
41347fc40e *** empty log message *** 1997-08-16 17:41:45 +00:00
Jim Meyering
2bd0aa26c2 *** empty log message *** 1997-08-16 17:40:57 +00:00
Jim Meyering
962cb92146 *** empty log message *** 1997-08-16 17:39:59 +00:00
Jim Meyering
db00e4acb1 *** empty log message *** 1997-08-16 16:41:15 +00:00
Jim Meyering
754478c6f5 . 1997-08-16 16:40:55 +00:00
Jim Meyering
caa34fb806 . 1997-08-16 12:25:56 +00:00
Jim Meyering
aad3038b71 (mode_create_from_ref): Remove dcl of unused local, I. 1997-08-03 20:28:45 +00:00
Jim Meyering
a4def0664d . 1997-08-03 17:53:25 +00:00
Jim Meyering
8075bc7e8a s/\<_ (/_(/g 1997-08-03 02:49:43 +00:00
Jim Meyering
c710dafd38 . 1997-08-03 02:07:58 +00:00
Jim Meyering
dc16b600a5 *** empty log message *** 1997-08-03 02:07:26 +00:00
Jim Meyering
c091f9835b indent 1997-08-03 02:04:28 +00:00
Jim Meyering
6993b5780b . 1997-08-03 01:54:34 +00:00
Jim Meyering
6e08ff4f71 *** empty log message *** 1997-08-02 17:36:07 +00:00
Jim Meyering
6df8557d33 . 1997-08-02 17:32:04 +00:00
Jim Meyering
9608d12c39 *** empty log message *** 1997-08-02 17:31:01 +00:00
Jim Meyering
dd9b964694 *** empty log message *** 1997-08-02 17:21:18 +00:00
Jim Meyering
b8f7d0087d *** empty log message *** 1997-08-02 17:20:39 +00:00
Jim Meyering
70611589b3 . 1997-08-02 17:10:12 +00:00
Jim Meyering
94c7a45d8e *** empty log message *** 1997-08-02 16:51:37 +00:00
Jim Meyering
9a012ca907 . 1997-08-02 15:29:55 +00:00
Jim Meyering
9bb6fc54aa . 1997-08-02 15:25:25 +00:00
Jim Meyering
eb1e691d00 . 1997-08-02 15:23:59 +00:00
Jim Meyering
45764b9af2 Remove @code{} from node names. 1997-07-30 16:31:56 +00:00
Jim Meyering
fb1e26800f . 1997-07-29 03:08:13 +00:00
Jim Meyering
910502b044 Add new option: --reference=FILE. 1997-07-29 03:05:45 +00:00
Jim Meyering
2ff9982e42 Add new option: --reference=FILE. 1997-07-29 03:04:58 +00:00
Jim Meyering
f6e8b41a5f (mode_create_from_ref): Don't use umask.
Don't use MODE_X_IF_ANY_X.
1997-07-29 03:03:49 +00:00
Jim Meyering
42e5deb36c (usage): tweak -p descr 1997-07-29 02:55:45 +00:00
Jim Meyering
8bff24291a *** empty log message *** 1997-07-29 02:30:55 +00:00
Jim Meyering
16340bfef0 . 1997-07-29 02:30:34 +00:00
Jim Meyering
fa5f24c4c6 *** empty log message *** 1997-07-29 02:06:33 +00:00
Jim Meyering
b78d012e9d Declare pointer parameters const as appropriate. 1997-07-29 02:06:25 +00:00
Jim Meyering
43e8e1245e (main): New option --preserve-timestamps (-p).
(install_file_in_file): Change timestamps if requested.
(change_timestamps): New function.
(usage): Describe --preserve-timestamps.
Correct --mode description.
From Galen Hazelwood.
1997-07-29 01:57:24 +00:00
Jim Meyering
8569f8ffa9 replace with new version from libc 1997-07-26 02:55:14 +00:00
Jim Meyering
821c3f6fda use Cambridge, Mass example, not Azores one 1997-07-25 12:47:34 +00:00
Jim Meyering
e36d0b9d89 big patch from Paul Eggert 1997-07-25 12:43:58 +00:00
Jim Meyering
720e3dc89a *** empty log message *** 1997-07-22 01:37:42 +00:00
Jim Meyering
4fcb103952 *** empty log message *** 1997-07-22 01:36:06 +00:00
Jim Meyering
a267b98f43 *** empty log message *** 1997-07-22 01:27:45 +00:00
Jim Meyering
afc73d862b (parse_obsolescent_option): #ifdef-out portability warning. 1997-07-22 01:26:35 +00:00
Jim Meyering
9a1113585f *** empty log message *** 1997-07-22 01:16:55 +00:00
Jim Meyering
f1ee29eac3 (checkfp): tweak comment 1997-07-19 15:08:53 +00:00
Jim Meyering
1bc1e233ca *** empty log message *** 1997-07-19 15:05:08 +00:00
Jim Meyering
dddf0d13df (checkfp): Print the `disorder' message. Include both
the number and the contents of the first out-of-order line, in addition
to the file name.  Change meaning of return value.
(check): Don't print disorder message here.
Adjust test of checkfp's return value.
Feature suggestion from Karl Heuer.
1997-07-19 15:04:59 +00:00
Jim Meyering
b9551de86a *** empty log message *** 1997-07-19 15:02:19 +00:00
Jim Meyering
5bd6c2209a *** empty log message *** 1997-07-19 13:38:57 +00:00
Jim Meyering
08bc7404bc This means that if multiple users are given on the command line, the
error return code is that of the last, so earlier failures can't be
detected.
1997-07-16 13:46:53 +00:00
Jim Meyering
78b6253dea *** empty log message *** 1997-07-16 12:55:40 +00:00
Jim Meyering
10055f8398 *** empty log message *** 1997-07-16 12:55:05 +00:00
Jim Meyering
1a91d3ecc2 *** empty log message *** 1997-07-16 12:52:00 +00:00
Jim Meyering
74ed7c9f94 Exit with status from `id' command.
Don't print `$name : $groups' if id fails.
Reported by Austin Donnelly.
1997-07-16 12:49:36 +00:00
Jim Meyering
f46c35a744 *** empty log message *** 1997-07-15 14:12:45 +00:00
Jim Meyering
f574936f77 correct cpp-indentation 1997-07-15 14:05:07 +00:00
Jim Meyering
8abf2733e0 Merge with FSF. 1997-07-15 14:03:22 +00:00
Jim Meyering
8c6a8c7743 tweak again 1997-07-14 18:32:12 +00:00
Jim Meyering
197d78d428 new version from kb, with patch 1997-07-14 18:15:50 +00:00
Jim Meyering
64c3a36a0e . 1997-07-14 15:43:25 +00:00
Jim Meyering
bf72a762d8 . 1997-07-14 15:42:30 +00:00
Jim Meyering
78364faa8b . 1997-07-14 15:42:10 +00:00
Jim Meyering
92435ee51b . 1997-07-14 15:37:48 +00:00
Jim Meyering
589e18a1f7 Tweak new examples based on Karl B.s suggestions. 1997-07-14 14:41:16 +00:00
Jim Meyering
566451e5be remove fixme 1997-07-13 23:37:57 +00:00
Jim Meyering
8ea7459457 (EXTRA_DIST): Remove explicit mention of texinfo.texi.
Now, automake includes it automatically.
1997-07-13 23:20:39 +00:00
Jim Meyering
3a58489962 . 1997-07-13 23:03:49 +00:00
Jim Meyering
3ef794ff5f turn off losing tests 1997-07-13 23:03:31 +00:00
Jim Meyering
e30da6776c *** empty log message *** 1997-07-13 22:50:19 +00:00
Jim Meyering
a33a897f29 *** empty log message *** 1997-07-13 22:49:39 +00:00
Jim Meyering
f43d9ab8a6 *** empty log message *** 1997-07-13 22:06:36 +00:00
Jim Meyering
8acf7844dc *** empty log message *** 1997-07-13 22:04:17 +00:00
Jim Meyering
a3adba60c8 . 1997-07-13 21:59:43 +00:00
Jim Meyering
25ec733e8d Include xstrtoul.h.
Remove global variable, unit_size.
(atou): Remove now-unused function.
(parse_unit): Likewise.
(string_to_ull): New function.
(head): Take new parameter, count_lines.  Use it instead of unit_size.
Update callers.
(head_file): Likewise.
(main): Use string_to_ull, not atou/parse_unit.
1997-07-13 21:59:34 +00:00
Jim Meyering
08e6bd4da0 *** empty log message *** 1997-07-13 20:38:15 +00:00
Jim Meyering
7c97f17f9b *** empty log message *** 1997-07-13 20:27:15 +00:00
Jim Meyering
5b0298d2b5 . 1997-07-13 19:47:00 +00:00
Jim Meyering
7e73237bac . 1997-07-13 19:45:14 +00:00
Jim Meyering
8568fe543b . 1997-07-13 16:36:10 +00:00
Jim Meyering
1c9c4d7230 More tests -- add TZ-free equivalents. 1997-07-13 16:36:04 +00:00
Jim Meyering
3e129adac4 add ``First, a quote:'' 1997-07-13 15:08:31 +00:00
Jim Meyering
8f6f2a4cc1 don't include error.h. 1997-07-13 13:31:30 +00:00
Jim Meyering
4f110142bb *** empty log message *** 1997-07-13 04:28:05 +00:00
Jim Meyering
23497d87b7 (DISTFILES): Remove ChangeLog. 1997-07-13 04:27:57 +00:00
Jim Meyering
73f3647fe2 . 1997-07-13 04:25:15 +00:00
Jim Meyering
a305c4a189 . 1997-07-13 04:13:53 +00:00
Jim Meyering
b05ff2249b Rename lots of `this' locals.
Make some parameters `const'.
(who): Update read_utmp caller.
(search_entries): Take additional param: utmp_buf.
Update read_utmp caller.
(who_am_i): Update read_utmp caller.
1997-07-13 04:13:40 +00:00
Jim Meyering
7fe4db1451 (users): Update read_utmp caller. 1997-07-13 03:57:00 +00:00
Jim Meyering
393e4a8c36 (uptime): Update read_utmp caller. 1997-07-13 03:56:29 +00:00
Jim Meyering
aba02b5978 (PARAMS): Update prototype.
(utmp_contents): Remove dcl.
1997-07-13 03:55:38 +00:00
Jim Meyering
708d4a74de (read_utmp): Take new params: count and buffer.
Return boolean indicating failure.
Now, caller must give diagnostic upon.
1997-07-13 03:54:00 +00:00
Jim Meyering
6e1340462e Add FIXME.
indent
1997-07-13 03:13:09 +00:00
Jim Meyering
aeea923e99 indent 1997-07-13 03:10:15 +00:00
Jim Meyering
d461077920 indent 1997-07-13 03:08:45 +00:00
Jim Meyering
d0c515b45c indent 1997-07-13 03:07:36 +00:00
Jim Meyering
4b84ea8745 indent 1997-07-13 02:58:35 +00:00
Jim Meyering
51a0fa60c8 . 1997-07-13 02:54:48 +00:00
Jim Meyering
2d8c67c7d5 *** empty log message *** 1997-07-13 02:54:28 +00:00
Jim Meyering
ad0f8c9b71 (uptime): rename users to n_users 1997-07-13 02:52:58 +00:00
Jim Meyering
67fe78f11c declare xmalloc
(users): rename users to n_users
1997-07-13 02:52:24 +00:00
Jim Meyering
b18c5abf1c (who): rename users to n_users 1997-07-13 02:51:34 +00:00
Jim Meyering
59f66af0f4 . 1997-07-13 02:49:39 +00:00
Jim Meyering
4cf5b77561 . 1997-07-13 02:19:46 +00:00
Jim Meyering
65738c9162 . 1997-07-13 02:18:14 +00:00
Jim Meyering
6341f011d7 . 1997-07-13 02:17:51 +00:00
Jim Meyering
558f0fa3ea revert to previous version 1997-07-12 23:16:59 +00:00
Jim Meyering
7673378e0a *** empty log message *** 1997-07-12 23:01:17 +00:00
Jim Meyering
97fca9a840 *** empty log message *** 1997-07-12 22:56:55 +00:00
Jim Meyering
f124c131af *** empty log message *** 1997-07-12 22:55:13 +00:00
Jim Meyering
ee81a6190f *** empty log message *** 1997-07-12 22:53:07 +00:00
Jim Meyering
d1a07e1ad2 (MAYBE_SET_TZ_UTC0): New macro.
(set_tz): New function.
(batch_convert): If necessary, save the initial value of TZ and
for each date in the file, restore it before each call to get_date,
then set it to UTC0 before each show_date call.
(main): Don't set TZ before calling get_date.
Set TZ after get_date call and before show_date call.
Reported by Matthew Braun.
1997-07-12 22:52:57 +00:00
Jim Meyering
3dcfda7bda . 1997-07-12 22:32:21 +00:00
Jim Meyering
3f275a59a5 add a --file test 1997-07-12 22:32:12 +00:00
Jim Meyering
67132b480f Add a few more date examples. Prompted by question from Galen H. 1997-07-12 22:10:03 +00:00
Jim Meyering
d9921abba7 . 1997-07-12 21:59:08 +00:00
Jim Meyering
626e48dcca . 1997-07-12 21:57:51 +00:00
Jim Meyering
f1994a3f6e *** empty log message *** 1997-07-12 21:57:38 +00:00
Jim Meyering
b6a57ff354 add date2sec and sec2date from the manual 1997-07-12 21:56:35 +00:00
Jim Meyering
0e6b6d4c5c add utc-1 1997-07-12 21:07:26 +00:00
Jim Meyering
309b8c57fb *** empty log message *** 1997-07-12 20:34:34 +00:00
Jim Meyering
a3294a01b0 *** empty log message *** 1997-07-11 16:07:52 +00:00
Jim Meyering
204f6064e5 remove `minimally' 1997-07-11 16:07:29 +00:00
Jim Meyering
17ca5d8c74 remove `minimally' 1997-07-11 16:07:06 +00:00
Jim Meyering
4a2df8ccf5 new one from Karl 1997-07-11 15:27:19 +00:00
Jim Meyering
2d1baaeb31 *** empty log message *** 1997-07-10 18:30:08 +00:00
Jim Meyering
1a2964b988 *** empty log message *** 1997-07-10 18:29:27 +00:00
Jim Meyering
4170f6416d . 1997-07-10 18:25:12 +00:00
Jim Meyering
735847657b *** empty log message *** 1997-07-10 18:25:05 +00:00
Jim Meyering
8d6318c532 . 1997-07-10 17:32:31 +00:00
Jim Meyering
36df273199 . 1997-07-10 17:31:40 +00:00
Jim Meyering
1db47deedb . 1997-07-10 17:31:29 +00:00
Jim Meyering
d6bdaed4c0 . 1997-07-10 17:30:50 +00:00
Jim Meyering
1481657ca1 . 1997-07-10 17:29:09 +00:00
Jim Meyering
99f8939150 *** empty log message *** 1997-07-10 16:19:13 +00:00
Jim Meyering
45eb103e4c convert obsolescent tests to posix-style ones 1997-07-10 16:16:17 +00:00
Jim Meyering
990c0d0fad Include $0 in `wrong number of elements...' message. 1997-07-10 15:56:33 +00:00
Jim Meyering
9295c4fdca Remove $. from duplicate test name message 1997-07-10 15:56:09 +00:00
Jim Meyering
41c1791ddd *** empty log message *** 1997-07-10 15:38:43 +00:00
Jim Meyering
c8fbd48706 *** empty log message *** 1997-07-10 15:35:01 +00:00
Jim Meyering
ccd911b026 . 1997-07-10 15:34:31 +00:00
Jim Meyering
deb5b314a5 . 1997-07-10 15:26:51 +00:00
Jim Meyering
c23aa46af6 *** empty log message *** 1997-07-09 21:14:40 +00:00
Jim Meyering
8dfdbd327c . 1997-07-09 18:11:59 +00:00
Jim Meyering
49ec273bd5 . 1997-07-09 18:03:56 +00:00
Jim Meyering
b09226e1b4 *** empty log message *** 1997-07-09 18:03:12 +00:00
Jim Meyering
d68871bdec (make_path): Chdir to `/' before starting if necessary.
Call save_cwd before while loop rather than from first iteration inside it.
1997-07-09 18:02:07 +00:00
Jim Meyering
6b544d3d8a . 1997-07-09 17:57:48 +00:00
Jim Meyering
2624654a78 (strverscmp): Add `parenentheses around arithmetic in operand of |'
as suggested by gcc -Wall.
1997-07-09 15:55:41 +00:00
Jim Meyering
2d3d80a3f2 indent 1997-07-09 15:42:54 +00:00
Jim Meyering
f6ffa56bc6 fix typo in comment 1997-07-09 15:33:27 +00:00
Jim Meyering
8d71f2bb2d . 1997-07-09 15:32:31 +00:00
Jim Meyering
a9309ad872 . 1997-07-09 15:31:29 +00:00
Jim Meyering
bc1634bc1a *** empty log message *** 1997-07-09 15:30:22 +00:00
Jim Meyering
6da5f51d3a . 1997-07-09 15:28:14 +00:00
Jim Meyering
a8068a365d *** empty log message *** 1997-07-09 15:28:01 +00:00
Jim Meyering
29e0df8652 . 1997-07-09 15:21:03 +00:00
Jim Meyering
f9f695018a *** empty log message *** 1997-07-09 14:21:30 +00:00
Jim Meyering
64320d0470 . 1997-07-09 14:20:14 +00:00
Jim Meyering
5e0ce74b1d . 1997-07-09 14:18:57 +00:00
Jim Meyering
47489a5b27 *** empty log message *** 1997-07-09 14:16:44 +00:00
Jim Meyering
a5d528d3d7 *** empty log message *** 1997-07-09 14:12:13 +00:00
Jim Meyering
3358aeb5d3 . 1997-07-09 14:05:31 +00:00
Jim Meyering
bc16e65a8e *** empty log message *** 1997-07-09 14:05:22 +00:00
Jim Meyering
6bb8c4e904 Add comments. 1997-07-09 14:00:27 +00:00
Jim Meyering
89743fce5c *** empty log message *** 1997-07-08 23:20:50 +00:00
Jim Meyering
8f19e15873 *** empty log message *** 1997-07-08 23:06:36 +00:00
Jim Meyering
c2f3a114a8 *** empty log message *** 1997-07-08 23:05:32 +00:00
Jim Meyering
ba6af15f00 *** empty log message *** 1997-07-08 23:04:58 +00:00
Jim Meyering
0c073269a5 . 1997-07-08 23:00:29 +00:00
Jim Meyering
4e9441a1e7 . 1997-07-08 22:44:58 +00:00
Jim Meyering
c2b8fe4acf . 1997-07-08 22:43:38 +00:00
Jim Meyering
f3a329069e (mode_create_from_ref): New function. 1997-07-06 21:28:04 +00:00
Jim Meyering
244fb561f8 (mode_create_from_ref): Add prototype.
(MODE_MASK_ALL): New define.
(MODE_BAD_REFERENCE): New define.
1997-07-06 21:27:44 +00:00
Jim Meyering
2cd9474cb6 (getuidbyname): Declare parameter to be const.
(getgidbyname): Declare parameter to be const.
1997-07-06 21:27:07 +00:00
Jim Meyering
abd1bad4b6 (noinst_HEADERS): Add strverscmp.h. 1997-07-06 21:25:57 +00:00
Jim Meyering
f066a3acfe . 1997-07-06 21:25:19 +00:00
Jim Meyering
83c3f08048 declare stpcpy 1997-07-06 21:24:10 +00:00
Jim Meyering
d0caad54ae Add new option: --sort=version (-v). 1997-07-06 21:23:42 +00:00
Jim Meyering
f873ad6e6c (libfu_a_SOURCES): Add strverscmp.c.
(noinst_HEADERS): Add strverscmp.h.
1997-07-06 14:47:50 +00:00
Jim Meyering
0c5e6d93cd *** empty log message *** 1997-07-06 13:52:12 +00:00
Jim Meyering
2b0ecc7fa5 (print_long_format): Reflect changes in semantics of getuser, getgroup. 1997-07-06 13:51:16 +00:00
Jim Meyering
afe6283539 (getuser): Return NULL (rather than stringified uid) upon lookup failure.
(getgroup): Likewise.
(getuidbyname) [NOT_USED]: #ifdef-out unused function.
(getgidbyname) [NOT_USED]: #ifdef-out unused function.
1997-07-06 13:50:29 +00:00
Jim Meyering
0735c835a9 Change some #ifdef to #if.
Indent a cpp directive.
1997-07-06 11:57:38 +00:00
Jim Meyering
a1cf1abf4d *** empty log message *** 1997-07-05 22:52:33 +00:00
Jim Meyering
1fca2b262a *** empty log message *** 1997-07-05 22:50:58 +00:00
Jim Meyering
08f38fd930 (parse_obsolescent_option): If POSIXLY_CORRECT is set, give
a diagnostic and fail when there are two or more non-option arguments.
1997-07-05 22:50:32 +00:00
Jim Meyering
573588283f . 1997-07-05 13:24:11 +00:00
Jim Meyering
8e14d7accc *** empty log message *** 1997-07-05 13:23:18 +00:00
Jim Meyering
77ef7e08a7 *** empty log message *** 1997-07-05 08:26:21 +00:00
Jim Meyering
ac0ee614d6 Redefine/undef getusershell around inclusion of <unistd.h>
(via system.h) so Cray's int-returning prototype doesn't conflict
with our char*-returning one.
1997-07-05 08:25:58 +00:00
Jim Meyering
8e04be3e8d . 1997-07-04 23:05:22 +00:00
Jim Meyering
4369606f15 regenerate with updated mk-script 1997-07-04 23:04:21 +00:00
Jim Meyering
f014f4f60f *** empty log message *** 1997-07-04 19:12:34 +00:00
Jim Meyering
581b1540f5 Redirect output of cmp to /dev/null. 1997-07-04 19:12:25 +00:00
Jim Meyering
a7da25a2bb *** empty log message *** 1997-07-04 19:05:12 +00:00
Jim Meyering
14608042dd . 1997-07-04 19:01:55 +00:00
Jim Meyering
f8bedd0047 . 1997-07-04 15:02:30 +00:00
Jim Meyering
4d8f9c4929 regenerate with updated ../Makefile.am.in 1997-07-04 15:02:06 +00:00
Jim Meyering
1e80216861 regenerate with updated mk-script 1997-07-04 15:01:57 +00:00
Jim Meyering
b541bff3de . 1997-07-04 15:01:06 +00:00
Jim Meyering
bea4748f5c regenerate with updated mk-script 1997-07-04 14:43:55 +00:00
Jim Meyering
19d151cbbd regenerate with updated ../Makefile.am.in 1997-07-04 14:43:06 +00:00
Jim Meyering
d61ab3fc24 . 1997-07-04 14:42:16 +00:00
Jim Meyering
70cfca742f *** empty log message *** 1997-07-04 08:20:55 +00:00
Jim Meyering
677ddac432 (validate): Create test files in $(srcdir), not in build dir. 1997-07-04 08:09:15 +00:00
Jim Meyering
93b02c5289 *** empty log message *** 1997-07-04 07:53:28 +00:00
Jim Meyering
22ff29fe3e (apply_attributes): New function.
(copy_reg): Use apply_attributes instead of open-coding the pieces.
Now, failure to preserve file attributes does not cause mv to change
its exit status, and such failures elicit warning diagnostics.  This
behavior is required by POSIX.  Before, failure to preserve ownership
due to insufficient access was diagnosed only for root.
Prompted by a report from Bengt Martensson.
1997-07-03 12:16:41 +00:00
Jim Meyering
ab171ee6b5 *** empty log message *** 1997-07-03 12:13:31 +00:00
Jim Meyering
c86d0a7a45 *** empty log message *** 1997-07-03 10:29:48 +00:00
Jim Meyering
4396edc12e (test_vector): Remove bogus TZ=GMT environment setting. 1997-07-03 10:28:51 +00:00
Jim Meyering
442d670b3a . 1997-07-02 16:09:39 +00:00
Jim Meyering
7a280a0fda (STRTOX): Convert function header in macro definition
to K&R-style.  Otherwise, ansi2knr would fail to convert the function
definitions to K&R for old style compilers.  From Kaveh Ghazi.
1997-07-02 16:07:44 +00:00
Jim Meyering
df05506016 *** empty log message *** 1997-07-01 11:55:55 +00:00
Jim Meyering
b3580d0a75 . 1997-07-01 11:50:44 +00:00
Jim Meyering
2499628bff (make_path): Reorder stat-then-mkdir-if-missing
calls so that mkdir is called first.  Before make_path would first
`stat' a directory, then call mkdir if it didn't exist.  But if
some other process created the directory between the stat & mkdir,
the mkdir would fail with EEXIST.  Diagnosis and suggestion from
Greg McGary.
1997-07-01 11:50:39 +00:00
Jim Meyering
b5e0f033a6 *** empty log message *** 1997-07-01 11:50:08 +00:00
Jim Meyering
059ccb6ac7 [putenv]: Undefine before including system headers.
Otherwise, the declaration of *rpl_putenv* conflicts with the system
prototype on at least Irix5.3.  From Marcus Daniels.
1997-07-01 11:30:08 +00:00
Jim Meyering
5f14bb768e *** empty log message *** 1997-06-30 04:00:48 +00:00
Jim Meyering
7f490dad0e . 1997-06-30 03:53:28 +00:00
Jim Meyering
3e81211212 . 1997-06-30 01:58:23 +00:00
Jim Meyering
3f0b15ac80 *** empty log message *** 1997-06-29 22:26:54 +00:00
Jim Meyering
41faa55aed (base_name_strip_trailing_slashes): Remove. 1997-06-29 22:26:18 +00:00
Jim Meyering
04c0cd59a5 (base_name_strip_trailing_slashes): new function. 1997-06-29 22:25:54 +00:00
Jim Meyering
6ad0d51107 (copy): Add FIXME comment. 1997-06-29 22:24:26 +00:00
Jim Meyering
bc8c5033e3 *** empty log message *** 1997-06-29 22:21:51 +00:00
Jim Meyering
dc404c4107 (copy_reg): New parameter, SOURCE_STATS.
(do_move): Update caller.
(movefile): Take new boolean parameter, DEST_IS_DIR,
to save a stat per moved file when the destination is a directory.
(main): Call movefile with additional argument.
(strip_trailing_slashes_2): New function.
(movefile): Remove trailing slashes from dest.  Otherwise, stat ("b/")
fails with ENOTDIR on systems including Linux w/libc 2.0.30.
Reproduce with `rm -rf a b; mkdir a; touch b; ./mv a b/'.
(do_move): Fix misleading comment.
1997-06-29 22:21:42 +00:00
Jim Meyering
e44678aac2 *** empty log message *** 1997-06-29 21:24:26 +00:00
Jim Meyering
42a63be148 *** empty log message *** 1997-06-29 21:13:33 +00:00
Jim Meyering
1226259896 Remove _sys_putenv cruft and just rename the function itself. 1997-06-29 21:05:05 +00:00
Jim Meyering
cabc10b909 *** empty log message *** 1997-06-29 20:26:38 +00:00
Jim Meyering
90e9fd9c77 . 1997-06-29 20:24:27 +00:00
Jim Meyering
0935e2ce3f *** empty log message *** 1997-06-29 20:21:38 +00:00
Jim Meyering
611cf8e97b *** empty log message *** 1997-06-29 20:19:45 +00:00
Jim Meyering
3d9239c750 fix it right 1997-06-29 20:18:58 +00:00
Jim Meyering
551c02f7b6 Define-away putenv only if it's not already defined. 1997-06-29 20:12:52 +00:00
Jim Meyering
90c131fa21 . 1997-06-29 13:52:16 +00:00
Jim Meyering
a6b6c95b83 *** empty log message *** 1997-06-29 13:50:57 +00:00
Jim Meyering
25c1d1dccd *** empty log message *** 1997-06-29 13:49:53 +00:00
Jim Meyering
d9741142c8 . 1997-06-29 13:34:51 +00:00
Jim Meyering
a84d2bada4 Set and export LANGUAGE, LC_ALL, and LANG
so tests get english strings.  From Ulrich Drepper.
1997-06-29 12:19:43 +00:00
Jim Meyering
9654920c40 . 1997-06-29 03:27:24 +00:00
Jim Meyering
a13135d09e Move the OPENOPTS def from end to beginning of else clause so it's closer
to the one in the then clause.
1997-06-29 01:56:36 +00:00
Jim Meyering
f657d65570 update from automake-1.2 1997-06-25 17:05:56 +00:00
Jim Meyering
9bcfe15afe . 1997-06-25 17:01:22 +00:00
Jim Meyering
4378dcecdf . 1997-06-25 16:08:03 +00:00
Jim Meyering
fa4894b30c . 1997-06-25 15:38:35 +00:00
Jim Meyering
6700c89ac7 Use variable width columns when printing in multi-column mode.
(init_col_info): New function.
(print_current_files): Call init_col_info if format is
`many_per_line' or `horizontal'.
(print_many_per_line): Calculate optimum column widths.
(print_horizontal): Likewise.
From Ulrich Drepper.
1997-06-22 19:52:24 +00:00
Jim Meyering
d18dc59619 *** empty log message *** 1997-06-22 04:04:07 +00:00
Jim Meyering
973f13ccb2 . 1997-06-22 04:01:43 +00:00
Jim Meyering
e148f6d293 . 1997-06-22 03:51:36 +00:00
Jim Meyering
3841b591c1 . 1997-06-22 03:50:14 +00:00
Jim Meyering
e8b0678fed . 1997-06-22 03:49:51 +00:00
Jim Meyering
08f074fb34 *** empty log message *** 1997-06-22 03:38:08 +00:00
Jim Meyering
2f91f08a79 . 1997-06-22 03:32:37 +00:00
Jim Meyering
9bf8c1c229 . 1997-06-16 18:02:08 +00:00
Jim Meyering
504b9fe47a . 1997-06-16 18:01:32 +00:00
Jim Meyering
57f7889059 comment 1997-06-16 17:50:23 +00:00
Jim Meyering
8b4d49fc79 . 1997-06-16 17:42:33 +00:00
Jim Meyering
a6526f2171 (eval6): Accept new unary operator, quote.
From Karl Heuer.
1997-06-16 17:01:24 +00:00
Jim Meyering
bfc9115ee5 *** empty log message *** 1997-06-16 16:58:28 +00:00
Jim Meyering
5e3188fba4 . 1997-06-16 16:57:55 +00:00
Jim Meyering
57c0f5cfff (EXTRA_DIST): Add putenv.m4. 1997-06-16 16:57:02 +00:00
Jim Meyering
19342feca7 . 1997-06-16 16:45:15 +00:00
Jim Meyering
7b097c0e37 add copyright 1997-06-16 16:15:30 +00:00
Jim Meyering
952a76e506 tweak error message 1997-06-16 16:12:04 +00:00
Jim Meyering
0dcca900cc (full_write): Add comment regarding failure due to bug in
Linux Slackware 1.2.13 kernel.
1997-06-15 15:06:52 +00:00
Jim Meyering
ab029fd3e5 . 1997-06-15 13:35:02 +00:00
Jim Meyering
acdc74dbf5 Rewrite using save-cwd.c and chdir to remove quadratic component of complexity.
Before, it processed O(n^2) directory name components via stat and mkdir.
Now it's O(n).  This makes mkdir -p a lot more efficient when creating
directories with very many components.  On a Linux 2.0.30 ext2fs filesystem
this command: mkdir -p `perl -e 'print "a/" x 500'`  now runs in 0.77 seconds
(user+sys).  Contrast that with the 9.5(!) seconds it took before.
1997-06-15 13:34:47 +00:00
Jim Meyering
1830d29be9 Add test that -o 0 works. 1997-06-15 11:47:46 +00:00
Jim Meyering
3b4748d124 *** empty log message *** 1997-06-15 11:42:55 +00:00
Jim Meyering
50e65a424c (init_header) [T_BUF_FMT]: Output the 4-digit year (not the
2-digit abbreviation) in each page header.  Reported by Noah Friedman.
1997-06-15 11:40:47 +00:00
Jim Meyering
aca4091fae *** empty log message *** 1997-06-14 19:33:13 +00:00
Jim Meyering
2add756624 *** empty log message *** 1997-06-14 17:32:00 +00:00
Jim Meyering
2f1768f676 (cut_fields): Detect when the input is empty and handle
that special case.  Before `cut -f1 </dev/null' would improperly
output a single newline.  Reported by Phil Richards.
1997-06-14 17:31:40 +00:00
Jim Meyering
4f0bef5377 . 1997-06-14 16:45:00 +00:00
Jim Meyering
4dc1f7070b . 1997-06-14 16:36:22 +00:00
Jim Meyering
63ca47adfc proof reading from kb 1997-06-13 16:07:12 +00:00
Jim Meyering
c8460daf24 . 1997-06-12 16:40:53 +00:00
Jim Meyering
a6062bfb05 document expr's new quote operator 1997-06-12 16:32:08 +00:00
Jim Meyering
83461932b5 *** empty log message *** 1997-06-12 15:07:26 +00:00
Jim Meyering
23c6ab8674 *** empty log message *** 1997-06-12 15:07:05 +00:00
Jim Meyering
25f6a4a7c0 remove blank line at end and add copyright
tweak cpp indentation
1997-06-12 12:58:47 +00:00
Jim Meyering
8eebff2029 *** empty log message *** 1997-06-12 11:51:11 +00:00
Jim Meyering
6ecad0839e (eval6): Accept new unary operator, quote. From Karl Heuer. 1997-06-12 11:50:58 +00:00
Jim Meyering
9fb965dfd8 Add comment for posixly_correct. 1997-06-12 11:47:34 +00:00
Jim Meyering
bcdaf2c1a5 fix typo in expr/index doc.
from kwzh
1997-06-12 11:27:04 +00:00
Jim Meyering
e737958ebb . 1997-06-11 20:19:30 +00:00
Jim Meyering
44df08ee55 *** empty log message *** 1997-06-11 20:19:23 +00:00
Jim Meyering
8406b91aba (docolon): Test (re_buffer.re_nsub > 0) rather than
searching for `\(' to determine whether to return 0 or the empty
string.  Before it would improperly return '' if the pattern
contained a substring like this: `\\('.  From Karl Heuer.
For example, running expr c : '\\(' should print `0'.
1997-06-11 20:18:15 +00:00
Jim Meyering
2078f2391e . 1997-06-06 14:30:11 +00:00
Jim Meyering
f442eb2941 . 1997-06-03 20:01:55 +00:00
Jim Meyering
f1390de4c3 [HAVE_UNISTD_H]: Include unistd.h.
John Gatewood Ham reported that this is necessary for DJGPP/Win95.
1997-06-03 20:01:47 +00:00
Jim Meyering
93ede2c8e1 *** empty log message *** 1997-06-03 20:01:14 +00:00
Jim Meyering
ae7a2a007a . 1997-06-02 14:29:50 +00:00
Jim Meyering
1f107588fa . 1997-06-01 18:47:56 +00:00
Jim Meyering
a45a7e3819 . 1997-06-01 17:59:08 +00:00
Jim Meyering
5f0bf654a4 (mk-script): Depend on ../../config.status. 1997-06-01 17:58:27 +00:00
Jim Meyering
985bd80461 . 1997-06-01 17:20:42 +00:00
Jim Meyering
8bb2bf5d28 *** empty log message *** 1997-06-01 17:20:31 +00:00
Jim Meyering
cc167bce98 *** empty log message *** 1997-06-01 17:16:30 +00:00
Jim Meyering
f5291be83e Add tests using `next'. 1997-06-01 17:16:23 +00:00
Jim Meyering
2c0e561933 (OtherTable): Interpret `next' as 1 (not 2) units.
Patch from Richard Sharman <rsharman@magmacom.com>.
1997-06-01 17:15:51 +00:00
Jim Meyering
a488983890 fix for abs pathnames 1997-05-30 14:00:47 +00:00
Jim Meyering
94468e0921 indent cpp directives 1997-05-29 13:20:25 +00:00
Jim Meyering
4377246ee3 update from automake-1.1p 1997-05-29 13:19:34 +00:00
Jim Meyering
6edc738156 correct/normalize indentation in cpp directives 1997-05-28 12:19:28 +00:00
Jim Meyering
4f690a51e3 update from FSF 1997-05-28 12:01:33 +00:00
Jim Meyering
7eaf75e3b1 *** empty log message *** 1997-05-28 11:43:25 +00:00
Jim Meyering
4354caa2d4 (read_filesystem_list): Add `|| defined (__OpenBSD__)'
to the NetBSD #if so OpenBSD also uses the f_fstypename member.
(fstype_to_string): Add `&& !defined (__OpenBSD__)' to the NetBSD #if
expression to exclude this function definition.  OpenBSD 2.1 beta
doesn't need it.  Patch from Hugh Daniel <hugh@ecotone.xanadu.com>
1997-05-28 11:42:29 +00:00
Jim Meyering
106775512b *** empty log message *** 1997-05-28 11:40:16 +00:00
Jim Meyering
72559c0e30 *** empty log message *** 1997-05-27 14:17:08 +00:00
Jim Meyering
437b98461e Don't include backupfile.h. 1997-05-27 14:16:49 +00:00
Jim Meyering
074c7edade *** empty log message *** 1997-05-27 13:55:45 +00:00
Jim Meyering
e4f25ca7b1 Use base_name, not basename. 1997-05-27 13:55:23 +00:00
Jim Meyering
dd547a84bf . 1997-05-27 12:50:39 +00:00
Jim Meyering
bc50ceb474 clean up for -Wall 1997-05-27 11:05:40 +00:00
Jim Meyering
4c2adcbd56 Use base_name, not basename. 1997-05-27 11:04:41 +00:00
Jim Meyering
f0c27dac9e Use base_name, not basename.
Use X, not CP_OPTIONS.
1997-05-27 11:00:50 +00:00
Jim Meyering
93e9fef09f (libfu_a_SOURCES): Add addext.c.
Remove getversion.c;  get_version is now in backupfile.c.
Add basename.c since it's no longer replacible.
1997-05-27 10:45:34 +00:00
Jim Meyering
187f712b73 *** empty log message *** 1997-05-27 10:39:22 +00:00
Jim Meyering
aa8b6cf83c Change dcl of program_name so it doesn't conflict with the ubiquitous char* one. 1997-05-27 10:39:10 +00:00
Jim Meyering
46a9863033 . 1997-05-27 10:31:04 +00:00
Jim Meyering
c213bae308 Update from patch-2.2.93. 1997-05-27 10:30:45 +00:00
Jim Meyering
ca55ba3715 Update from FSF via patch-2.2.93. 1997-05-27 09:41:25 +00:00
Jim Meyering
168eb7758e Update from FSF via patch-2.2.93. 1997-05-27 09:39:25 +00:00
Jim Meyering
96c4c01019 Update from glibc via patch-2.2.93. 1997-05-27 09:38:06 +00:00
Jim Meyering
926c6c3301 *** empty log message *** 1997-05-26 04:46:57 +00:00
Jim Meyering
8805ede31b (copy_internal): When preserving symlinks (--no-dereference) and the
destination file is a symlink, use stat (not xstat) to see if it points
back to the source.  Reported by James <james@albion.glarp.com>.
1997-05-26 04:46:47 +00:00
Jim Meyering
cd29ba84ab *** empty log message *** 1997-05-26 04:43:47 +00:00
Jim Meyering
a65a081656 declare strip_trailing_slashes 1997-05-25 21:25:28 +00:00
Jim Meyering
8b36f9cbcd *** empty log message *** 1997-05-25 21:24:44 +00:00
Jim Meyering
0cc1681a5b Remove global variable opt_human_readable.
(enum Output_units): Rename from output_size.
Rename size_* to Unit_*.
Add Unit_variable to correspond to --human-readable.
(convert_blocks): Remove now-unused definition.
(human_readable): Rename paramater n_bytes to n_blocks.
Adjust conversions to reflect fact that input is now number of
512-byte blocks, not bytes.
(print_size): New function.
(du_files): Use print_size instead of open coding it.
(count_entry): Always count in units of 512-byte blocks to delay.
This lets du accumulate totals corresponding to a terabyte before
overflowing 32-bit long int.
Use print_size instead of open coding it.
1997-05-25 21:23:15 +00:00
Jim Meyering
e3e8f658c4 *** empty log message *** 1997-05-25 15:17:31 +00:00
Jim Meyering
07876bcb5d (convert_blocks): Add definition. 1997-05-25 15:10:03 +00:00
Jim Meyering
11080b7544 (convert_blocks): Remove definition.
Indent cpp directives.
1997-05-25 14:22:55 +00:00
Jim Meyering
1b71b3372e (convert_blocks): Remove now-unnecessary #undef.
(du_files): Pass output_size unchanged to convert_blocks.  No need
to test output_size for size_bytes, convert_blocks handles that
correctly.
(count_entry): Likewise.
1997-05-25 14:21:41 +00:00
Jim Meyering
1bfb2c3ec7 *** empty log message *** 1997-05-25 14:11:59 +00:00
Jim Meyering
1ba34180d7 (main): Implement new --max-depth=N option.
Based on the idea and a patch from Torbjorn Lindgren.
(du_files): Likewise.
(count_entry): Likewise.
[AIX]: Remove unused #pragma alloca.
1997-05-25 14:11:50 +00:00
Jim Meyering
54a61c3cf6 Remove FIXME.
Add spurious curlies and an empty line.
1997-05-25 13:00:01 +00:00
Jim Meyering
f735e157e9 . 1997-05-25 03:47:31 +00:00
Jim Meyering
5708e7bba8 *** empty log message *** 1997-05-25 03:47:21 +00:00
Jim Meyering
6919955eb1 New options: --ignore-fail-on-non-empty and --verbose.
(remove_parents): Implement new options.
(main): Likewise.
1997-05-25 03:46:46 +00:00
Jim Meyering
4f99d359c8 . 1997-05-25 03:15:30 +00:00
Jim Meyering
6fd92cf72b *** empty log message *** 1997-05-24 18:27:46 +00:00
Jim Meyering
2ebfd210cd . 1997-05-24 18:26:59 +00:00
Jim Meyering
d5659aa5e1 . 1997-05-24 18:12:59 +00:00
Jim Meyering
9add219c87 . 1997-05-24 18:11:33 +00:00
Jim Meyering
4d347c9e1f *** empty log message *** 1997-05-24 14:43:51 +00:00
Jim Meyering
90721ff4a4 (read_filesystem_list): Show automount-related
duplicate filesystems only when --all specified.  With suggestions
from Stuart Kemp.
1997-05-24 14:43:21 +00:00
Jim Meyering
1024238089 Indent cpp directives. 1997-05-24 14:42:40 +00:00
Jim Meyering
b0f8e63615 . 1997-05-24 14:31:23 +00:00
Jim Meyering
c8062f789d . 1997-05-24 14:13:55 +00:00
Jim Meyering
3dc7a93409 . 1997-05-24 14:11:19 +00:00
Jim Meyering
59ed92cdcf . 1997-05-23 13:23:49 +00:00
Jim Meyering
d0a506b84b . 1997-05-02 04:02:17 +00:00
Jim Meyering
ccb48f46d6 indent cpp-directives 1997-05-01 20:53:59 +00:00
Jim Meyering
9080de09fc indent cpp-directives 1997-05-01 20:51:16 +00:00
Jim Meyering
44848c0887 update from automake-1.1o 1997-04-29 15:48:14 +00:00
Jim Meyering
f6a1207cf9 . 1997-04-29 15:22:05 +00:00
Jim Meyering
6c04dfc1e1 *** empty log message *** 1997-04-27 23:46:02 +00:00
Jim Meyering
795d254715 (STRTOX): Don't fail because of extra character(s) following a
character constant.  Give the *warning* only if !POSIXLY_CORRECT.
1997-04-27 23:45:57 +00:00
Jim Meyering
e5ce0d8b3e *** empty log message *** 1997-04-27 23:33:54 +00:00
Jim Meyering
9778fd673b (cfcc_msg): File-scope constant.
(STRTOX): Use new constant as error message format string in macro.
Suggestion from Andreas Schwab.
1997-04-27 23:33:49 +00:00
Jim Meyering
3a46eb9695 . 1997-04-27 23:12:01 +00:00
Jim Meyering
3a84136d8c . 1997-04-27 20:18:07 +00:00
Jim Meyering
a77bf7510f *** empty log message *** 1997-04-27 20:13:21 +00:00
Jim Meyering
afdfd95be8 *** empty log message *** 1997-04-27 20:12:16 +00:00
Jim Meyering
3f9d8ee21b . 1997-04-27 19:41:52 +00:00
Jim Meyering
480a5db227 . 1997-04-27 19:41:16 +00:00
Jim Meyering
9874f0eedf changes suggested by kb 1997-04-24 13:00:51 +00:00
Jim Meyering
39361c9d6e patch from Andreas S. 1997-04-21 14:55:26 +00:00
Jim Meyering
7f74dcb1a6 s/;/. in comment to placate francois 1997-04-10 03:46:01 +00:00
Jim Meyering
738818ee66 . 1997-04-07 16:59:43 +00:00
Jim Meyering
90e1281e8e *** empty log message *** 1997-04-07 15:24:38 +00:00
Jim Meyering
907f15c7d6 *** empty log message *** 1997-04-07 15:21:33 +00:00
Jim Meyering
258186e1ce . 1997-04-07 15:10:57 +00:00
Jim Meyering
2e1059b400 . 1997-04-07 15:08:56 +00:00
Jim Meyering
58a9554b17 . 1997-04-07 00:44:33 +00:00
Jim Meyering
ca70b66b72 (STRTOX): New macro to eliminate code duplication.
(xstrtod, xstrtol, xstrtoul): Remove functions.
Use the STRTOX instead.
1997-04-06 20:58:16 +00:00
Jim Meyering
b3f0804efd . 1997-04-06 20:42:00 +00:00
Jim Meyering
ebce57b0e6 *** empty log message *** 1997-04-06 20:36:48 +00:00
Jim Meyering
3426e7ca7a Change most char* dcls to const char*. 1997-04-06 19:32:19 +00:00
Jim Meyering
39b444e420 Reorder functions to obviate forward decls. 1997-04-06 19:30:07 +00:00
Jim Meyering
00ea088ccd . 1997-04-04 03:29:25 +00:00
Jim Meyering
cd45cc7335 (EXTRA_DIST): Update file list. 1997-04-04 03:27:35 +00:00
Jim Meyering
7ecf5ed43b . 1997-04-04 03:18:54 +00:00
Jim Meyering
6d648c45ed Add test from Phil Richards. 1997-04-04 03:18:04 +00:00
Jim Meyering
cc093a9945 (main): Implement new --max-depth=N option.
Based on the idea and a patch from Torbjorn Lindgren.
(du_files): Likewise.
(count_entry): Likewise.
1997-03-27 05:47:56 +00:00
Jim Meyering
3416bdb6e1 *** empty log message *** 1997-03-27 05:45:12 +00:00
Jim Meyering
a37da82c38 . 1997-03-23 21:27:46 +00:00
Jim Meyering
f101a9b57f *** empty log message *** 1997-03-23 21:22:14 +00:00
Jim Meyering
c7b5fd2423 . 1997-03-23 02:56:47 +00:00
Jim Meyering
f1c111d469 *** empty log message *** 1997-03-23 02:30:09 +00:00
Jim Meyering
24ffa56fd0 . 1997-03-22 19:54:32 +00:00
Jim Meyering
e269fcdb28 *** empty log message *** 1997-03-22 06:06:02 +00:00
Jim Meyering
61ac269c6e *** empty log message *** 1997-03-22 06:05:16 +00:00
Jim Meyering
e71f8cf087 *** empty log message *** 1997-03-22 06:03:31 +00:00
Jim Meyering
b524db4e87 *** empty log message *** 1997-03-22 05:58:50 +00:00
Jim Meyering
37e05875d5 *** empty log message *** 1997-03-22 05:58:26 +00:00
Jim Meyering
fcc31060fa . 1997-03-21 03:16:03 +00:00
Jim Meyering
e328e25bd1 . 1997-03-21 03:14:53 +00:00
Jim Meyering
bf435650e1 . 1997-03-21 03:11:55 +00:00
Jim Meyering
cd0aba1c14 . 1997-03-21 03:10:21 +00:00
Jim Meyering
a1e46876c6 . 1997-03-19 02:57:20 +00:00
Jim Meyering
66c246fc17 cpp-indent
Change a few #ifdef to #if.
Remove 3 spurious #ifdef that were guarding an #undef each.
1997-03-19 02:56:54 +00:00
Jim Meyering
fbe78f2ef6 . 1997-03-19 02:12:42 +00:00
Jim Meyering
33da7dcdda (check_format): Rename local, FORMAT_STRING, to avoid shadowing global.
(print_numbers): Likewise.
1997-03-19 02:12:36 +00:00
Jim Meyering
3f2ded808d (idle_string): Rename local, IDLE, to avoid shadowing global. 1997-03-18 23:34:23 +00:00
Jim Meyering
bcdeccb6a3 (log_su): Resort to getpwuid if getlogin fails.
If no tty name is found, use `none' in the log message.
Based on a patch from Galen Hazelwood.
1997-03-18 12:49:20 +00:00
Jim Meyering
808a6a2308 . 1997-03-14 04:14:37 +00:00
Jim Meyering
29e56fa096 . 1997-03-14 04:09:13 +00:00
Jim Meyering
f02b837782 (main): Allow use of 0 (zero) as the margin offset
argument to the -o option.  Patch from Gary Anderson.
1997-03-14 04:06:12 +00:00
Jim Meyering
294ea6ffc2 . 1997-03-14 04:00:19 +00:00
Jim Meyering
c127695e96 (main): Make sure c1 is not -1 before using it as an
array index.  Patch from Greg McGary.  Although this is truly a
bug, I believe it would not cause tr to misbehave on most systems.
I could not construct a test case with which this bug causes tr
to generate invalid output.
1997-03-14 03:59:21 +00:00
Jim Meyering
d713508802 Add test that -o 0 works. 1997-03-14 03:52:10 +00:00
Jim Meyering
c42ed1e1fb . 1997-03-14 03:30:22 +00:00
Jim Meyering
e64db863dd . 1997-03-14 03:30:02 +00:00
Jim Meyering
40b667e0e9 . 1997-03-14 03:29:41 +00:00
Jim Meyering
effc683cfc (TIME_T_MIN): Work around a bug in Cray C 5.0.3.0. 1997-03-14 03:28:09 +00:00
Jim Meyering
898fd10ec0 . 1997-03-13 05:21:23 +00:00
Jim Meyering
7017b8f67f (change_file_group): Use uid of -1 to indicate
we don't want to change the file's user ID.
1997-03-13 05:19:54 +00:00
Jim Meyering
c230f7db00 Update from gettext-0.10.27. 1997-03-13 05:17:50 +00:00
Jim Meyering
5ed7bf6069 . 1997-03-13 05:17:16 +00:00
Jim Meyering
a7cbdd04cd . 1997-03-13 05:16:47 +00:00
Jim Meyering
4e81181981 (EXTRA_DIST): Add chown.c. 1997-03-13 05:13:18 +00:00
Jim Meyering
1dc27001d5 Add chown.m4. 1997-03-13 05:12:13 +00:00
Jim Meyering
9034e099da . 1997-03-13 05:10:42 +00:00
Jim Meyering
78f4331cab . 1997-03-13 03:54:05 +00:00
Jim Meyering
a9616d4982 . 1997-03-12 01:26:15 +00:00
Jim Meyering
f1fbec95d5 . 1997-03-11 05:11:09 +00:00
Jim Meyering
dd2f783492 . 1997-03-11 05:02:11 +00:00
Jim Meyering
fac7cfba06 . 1997-03-10 04:47:59 +00:00
Jim Meyering
613357b0ab (decode_switches): Ignore value of COLUMNS envionment
variable when it is the empty string.  Suggestion from Ulrich Drepper.
1997-03-10 04:47:32 +00:00
Jim Meyering
de397548a8 comm's exit status 1997-03-10 03:47:13 +00:00
Jim Meyering
8a3180c8f0 . 1997-03-09 06:33:43 +00:00
Jim Meyering
73e03453df . 1997-03-09 06:18:33 +00:00
Jim Meyering
ea805db369 (usage): Fix typo in --help output. From Andreas Schwab. 1997-03-01 04:33:59 +00:00
Jim Meyering
d358cd813b . 1997-02-28 05:02:41 +00:00
Jim Meyering
571f4f4fde . 1997-02-28 05:01:39 +00:00
Jim Meyering
8c93627ccb (tYEAR_UNIT): Increase yyRelYear by $1, not just by 1.
From Andreas Schwab.
1997-02-27 05:53:15 +00:00
Jim Meyering
80409f292d . 1997-02-27 05:52:59 +00:00
Jim Meyering
8b2b45e172 . 1997-02-27 05:49:51 +00:00
Jim Meyering
94cab36432 (re_protect): When there is any potential for ambiguity in a diagnostic,
give explanatory diagnostic in addition to file name.
1997-02-27 05:49:44 +00:00
Jim Meyering
e1b834211b (copy_internal): When there is any potential for
ambiguity in a diagnostic, give explanatory diagnostic in addition
to file name.
1997-02-27 05:49:01 +00:00
Jim Meyering
a0400ec19b . 1997-02-26 13:01:45 +00:00
Jim Meyering
27237bfb10 . 1997-02-26 04:21:01 +00:00
Jim Meyering
df86f458a2 . 1997-02-26 02:21:34 +00:00
Jim Meyering
88c3a362e9 . 1997-02-23 05:47:16 +00:00
Jim Meyering
a4ccff96f9 . 1997-02-23 02:01:27 +00:00
Jim Meyering
6df1efb30c . 1997-02-22 20:41:21 +00:00
Jim Meyering
75bc50c6fc . 1997-02-22 20:34:30 +00:00
Jim Meyering
5cb0201730 . 1997-02-22 20:19:05 +00:00
Jim Meyering
db78b4797a (tMONTH_UNIT): Increase yyRelMonth by $1, not just by 1.
(tDAY_UNIT): Likewise for yyRelDay.
(tHOUR_UNIT): Likewise for yyRelHour.
(tMINUTE_UNIT): Likewise for yyRelMinutes.
(tSEC_UNIT): Likewise for yyRelSeconds.
1997-02-22 20:13:19 +00:00
Jim Meyering
9de7f6a024 . 1997-02-21 02:19:59 +00:00
Jim Meyering
4b0e6d0a33 update from FSF 1997-02-21 02:19:48 +00:00
Jim Meyering
a6ebe05733 . 1997-02-21 02:17:18 +00:00
Jim Meyering
e16668553e update from FSF 1997-02-21 02:16:54 +00:00
Jim Meyering
3b459d46bc . 1997-02-20 05:11:19 +00:00
Jim Meyering
2e31651a02 (factor): Rewrite inner loop to be more efficient.
Patch from Torbjorn Granlund.
1997-02-20 05:11:12 +00:00
Jim Meyering
9e2c86c67a . 1997-02-20 05:06:29 +00:00
Jim Meyering
4af2c36dfa (main): Remove trailing slashes from command line arguments.
Otherwise, running `mkdir x; chmod 644 x; ls -d x/' (note the trailing
slash) makes ls fail with permission denied on at least Linux 1.2.13
and 2.0.14 systems.
1997-02-20 04:54:56 +00:00
Jim Meyering
5234813a09 . 1997-02-19 03:38:52 +00:00
Jim Meyering
3b8313838c . 1997-02-19 03:27:18 +00:00
Jim Meyering
9b47c04ac1 . 1997-02-19 03:25:30 +00:00
Jim Meyering
11332e0c26 Add tests for %U, %V, and %W and for a bug fixed on 1996-03-05.
Remove misleading `-' from leap-1 test.
1997-02-19 03:23:16 +00:00
Jim Meyering
785168be90 . 1997-02-19 03:20:35 +00:00
Jim Meyering
91eb812c61 . 1997-02-19 02:54:43 +00:00
Jim Meyering
2be08dd6d3 . 1997-02-19 00:56:22 +00:00
Jim Meyering
6d09ea7b0d . 1997-02-18 17:46:56 +00:00
Jim Meyering
7bb258353f . 1997-02-18 17:46:04 +00:00
Jim Meyering
35ec0a08b5 . 1997-02-18 15:13:51 +00:00
Jim Meyering
1b1bca8a63 . 1997-02-18 15:13:12 +00:00
Jim Meyering
11e498679b . 1997-02-18 15:12:41 +00:00
Jim Meyering
30979f06d8 . 1997-02-18 02:47:49 +00:00
Jim Meyering
c321e5b51a . 1997-02-18 02:46:29 +00:00
Jim Meyering
bf8b53e78b . 1997-02-18 02:43:59 +00:00
Jim Meyering
1ee3e32c80 . 1997-02-17 04:18:26 +00:00
Jim Meyering
668010de9e . 1997-02-17 04:18:06 +00:00
Jim Meyering
24f79bb72c . 1997-02-17 04:17:09 +00:00
Jim Meyering
1bdee95e06 . 1997-02-17 04:12:20 +00:00
Jim Meyering
90bdeb65ca . 1997-02-17 04:11:19 +00:00
Jim Meyering
522f1f2f27 . 1997-02-17 01:33:48 +00:00
Jim Meyering
0d457a8063 . 1997-02-17 01:30:05 +00:00
Jim Meyering
5db942f46c . 1997-02-17 01:26:54 +00:00
Jim Meyering
80cccededc . 1997-02-17 01:26:13 +00:00
Jim Meyering
dd77d0602a Add missing paren. 1997-02-16 23:49:11 +00:00
Jim Meyering
4722a74bcf (Tests '7.*'): Reflect file-renaming. 1997-02-16 19:14:32 +00:00
Jim Meyering
16632f72fc . 1997-02-16 19:11:10 +00:00
Jim Meyering
be855de208 renamed from T- versions to avoid name-clashes on case-indep filesystems 1997-02-16 19:08:01 +00:00
Jim Meyering
feb2f918b3 (parse_obsolescent_option): Reverse order of args in diagnostic.
Remove `' quotes in diagnostic.
(parse_options): Remove `' quotes in diagnostic.
1997-02-16 14:31:39 +00:00
Jim Meyering
6bdbdae68c fixed off-by-one error 1997-02-12 16:31:01 +00:00
Jim Meyering
59f891e8b8 FIXME: major revamp to use FILE*; passed a few more tests 1997-02-12 16:25:40 +00:00
Jim Meyering
2be25646bd change wording in message 1997-02-09 16:07:38 +00:00
Jim Meyering
4ee12115f0 update copyright 1997-02-09 04:56:33 +00:00
Jim Meyering
7eb03c4372 update copyrights for 1997 1997-02-09 04:54:16 +00:00
Jim Meyering
b7ffe8cdaf update copyrights for 1997 1997-02-09 04:52:50 +00:00
Jim Meyering
dbc538f92b update copyrights for 1997 1997-02-09 04:46:02 +00:00
Jim Meyering
562488ee9c (parse_obsolescent_option): Give warning diagnostic for
(but now accept) obsolescent usage with more than one file argument.
1997-02-09 04:44:47 +00:00
Jim Meyering
3e9c9be49e . 1997-02-08 03:25:12 +00:00
Jim Meyering
9e2ad11286 . 1997-02-07 04:17:25 +00:00
Jim Meyering
5d159ca17a . 1997-02-07 04:04:24 +00:00
Jim Meyering
b7a12bb110 (quote_filename): Allocate two more bytes (for quotes)
when using --quote-name (-Q).
Feb 2 change wasn't complete.  Patch from Mark Harris.
1997-02-06 03:58:09 +00:00
Jim Meyering
155fa29f27 . 1997-02-05 04:20:20 +00:00
Jim Meyering
8257531353 . 1997-02-05 04:07:17 +00:00
Jim Meyering
49e3c8fee2 Bracket inclusion of termios.h with #if HAVE_TERMIOS_H.
Masami Takikawa reported that NeXTStep 3.0 doesn't have termios.h.
1997-02-05 04:06:53 +00:00
Jim Meyering
7a5980964b Dennis Biringer <biringer@textron.mhpcc.af.mil> writes:
| Please note that Hawaii has no daylight savings time (HDT - Hawaii
| Daylight) as stated on page 147 of the tar manual.  We are always on Hawaii
| Standard Time (HST).
|
| Also, on page 146, the Alaska-Hawaii Standard zone (AHST) is called
| Hawaii-Aleutian Standard Time by section 263 of the United States Code.
| (http://tycho.usno.navy.mil/260.html).
|
| Thanks for the effort on the manual,
| Dennis
|
| --
| Dennis Biringer                            535 Lipoa Parkway #149
| Dennis.Biringer@textron.mhpcc.af.mil       Kihei HI 96753
| biringer@mrtc.org                          VOICE: 808-874-3206
1997-02-05 02:35:46 +00:00
Jim Meyering
c1e4806502 [__GNUC__]: Don't define alloca to __builtin_alloca. 1997-02-04 03:52:16 +00:00
Jim Meyering
84ed9c3db9 . 1997-02-04 03:48:17 +00:00
Jim Meyering
3c97cf0102 libitize 1997-02-04 03:30:49 +00:00
Jim Meyering
9e61c5f51a . 1997-02-04 03:29:06 +00:00
Jim Meyering
a0aa288531 libitize 1997-02-04 03:27:13 +00:00
Jim Meyering
1235c944d2 libitize 1997-02-04 03:26:31 +00:00
Jim Meyering
05ff9c82a6 new obstack from libc 1997-02-04 03:20:29 +00:00
Jim Meyering
e4af7abbde . 1997-02-03 05:09:12 +00:00
Jim Meyering
e8bcfd934a Move alloca-related preprocessor code into system.h. 1997-02-03 05:08:19 +00:00
Jim Meyering
1b5a74d1a7 (parse_long_options): Compare getopt_long return
value against -1, not EOF.  Use NULL, not `(int *) 0' as last parameter
in getopt_long call.
1997-02-03 05:06:27 +00:00
Jim Meyering
a2ffd5db02 [__GNUC__]: Don't define alloca to __builtin_alloca. 1997-02-03 04:20:22 +00:00
Jim Meyering
704a69781e . 1997-02-03 03:22:52 +00:00
Jim Meyering
5f24ab538f . 1997-02-03 03:21:02 +00:00
Jim Meyering
6a203a2347 (quote_filename): Don't backslash-escape double quotes.
This fixes a problem whereby columns weren't aligned when some files
contained double quote characters and ls's --escape (-b) option was
used.  Reported by Mark Harris.
1997-02-03 00:10:40 +00:00
Jim Meyering
16e150496f . 1997-02-02 23:51:20 +00:00
Jim Meyering
44a82a9eb6 . 1997-02-02 22:22:37 +00:00
Jim Meyering
a15366696c * src/cp-hash.c (struct entry): Move dcl to this file from cp.h.
(struct htab): Likewise.
No longer include cp.h.  Instead, include the things it used to include.
1997-02-02 22:21:03 +00:00
Jim Meyering
c64a391bb2 . 1997-02-02 21:23:10 +00:00
Jim Meyering
1d286acd9a (hash_insert2): Rename local HTAB to HT to avoid shadowing global. 1997-02-02 20:44:10 +00:00
Jim Meyering
b63df62ce1 [obstack_chunk_alloc]: Define to malloc, not xmalloc
to work better with new obstack functions.
1997-02-02 20:11:54 +00:00
Jim Meyering
ff323743c5 [obstack_chunk_alloc]: Define to malloc, not xmalloc
to work better with new obstack functions.
1997-02-02 20:10:11 +00:00
Jim Meyering
50d2bb5b7b (main): Rename local I to C to avoid shadowing and to
be more consistent.  Declare I in inner scopes.
1997-02-02 20:09:02 +00:00
Jim Meyering
1a375e421b Gutted code -- pieces are in copy.[ch]. 1997-02-02 18:33:19 +00:00
Jim Meyering
09e2cc2fdf use $@, instead of literal `POTFILES' 1997-02-02 16:05:43 +00:00
Jim Meyering
d262a3cc82 (POTFILES): Redirect to an intermediate file and write-protect POTFILES. 1997-02-02 15:43:54 +00:00
Jim Meyering
badb35bdb7 . 1997-02-02 00:09:46 +00:00
Jim Meyering
3cca84e543 . 1997-02-02 00:09:25 +00:00
Jim Meyering
4ea19e3b31 . 1997-02-01 23:12:18 +00:00
Jim Meyering
118cbe89db . 1997-02-01 16:56:47 +00:00
Jim Meyering
f13f9c1936 Reflect renamings. 1997-02-01 16:56:32 +00:00
Jim Meyering
0bda501d01 rename 1997-02-01 16:55:41 +00:00
Jim Meyering
8e6d4e2d3e . 1997-02-01 16:53:08 +00:00
Jim Meyering
c859133450 . 1997-02-01 16:52:02 +00:00
Jim Meyering
1b4dfdc778 . 1997-02-01 16:51:33 +00:00
Jim Meyering
620317a6bf . 1997-02-01 16:51:11 +00:00
Jim Meyering
c1c6d5fa1f (test 10md): Reflect renaming. 1997-02-01 16:48:08 +00:00
Jim Meyering
576b49f9f0 . 1997-02-01 16:47:56 +00:00
Jim Meyering
f18a2cdcd6 . 1997-02-01 16:47:17 +00:00
Jim Meyering
b6aa3e6c17 . 1997-02-01 16:46:06 +00:00
Jim Meyering
2e2fe82afe (spec_to_list): Warn about all filenames that exceed max-length before dying. 1997-02-01 16:44:15 +00:00
Jim Meyering
67c5175138 . 1997-02-01 16:41:08 +00:00
Jim Meyering
bece4592b4 update for 20.1 patch from roland 1997-02-01 16:39:27 +00:00
Jim Meyering
0081aea9e1 . 1997-02-01 13:23:39 +00:00
Jim Meyering
fec37a7211 (init_parameters): For compatibility: use default
separator `TAB' with full length lines.  From Roland Huebner.
1997-02-01 13:23:27 +00:00
Jim Meyering
5d3c42ac61 . 1997-02-01 13:20:02 +00:00
Jim Meyering
cd0b33c839 (usage): Make parenthetical note on --no-dereference a little more general. 1997-02-01 04:49:51 +00:00
Jim Meyering
a7dbd3f5e4 . 1997-02-01 04:25:59 +00:00
Jim Meyering
e077b7593b bracket bug address with <> and append a period 1997-02-01 04:24:58 +00:00
Jim Meyering
a882d55b52 bracket bug address with <> and append a period 1997-02-01 04:24:08 +00:00
Jim Meyering
899a90bfd9 bracket bug address with <> and append a period 1997-02-01 04:23:31 +00:00
Jim Meyering
09f70cf63b Rename globals buffer and buffer_size to have G_ prefix
to avoid shadowing local variables.
1997-02-01 03:29:21 +00:00
Jim Meyering
d4efcf477e (add_line_number): Rename from `number' to avoid shadowing local variables. 1997-02-01 03:25:14 +00:00
Jim Meyering
0e291b59ed . 1997-02-01 03:13:22 +00:00
Jim Meyering
b8c82a8e39 Compare getopt_long return value against -1, not EOF. Use NULL, not '(int *) 0' as last parameter in getopt_long call. 1997-02-01 03:05:36 +00:00
Jim Meyering
4f51b86bfb Compare getopt_long return value against -1, not EOF. Use NULL, not '(int *) 0' as last parameter in getopt_long call. 1997-02-01 03:03:44 +00:00
Jim Meyering
c2d2dec516 Compare getopt_long return value against -1, not EOF. Use NULL, not '(int *) 0' as last parameter in getopt_long call. 1997-02-01 02:00:04 +00:00
Jim Meyering
1e40423be8 (maintainer-clean): Remove GMOFILES.
From Paul Eggert.
1997-01-30 05:28:37 +00:00
Jim Meyering
0c5ab92b59 . 1997-01-30 04:16:33 +00:00
Jim Meyering
b9278db095 . 1997-01-30 04:11:17 +00:00
Jim Meyering
944b08f293 Do each test twice: get input via REDIR and PIPE. 1997-01-30 03:38:47 +00:00
Jim Meyering
307b54a273 (test_vector): Do each (non-stdin-requiring) test three times. 1997-01-30 03:38:07 +00:00
Jim Meyering
795162649b . 1997-01-30 03:36:40 +00:00
Jim Meyering
3181551ddd . 1997-01-30 03:36:06 +00:00
Jim Meyering
4cbcb32a53 correctly compute number of tests 1997-01-30 03:31:40 +00:00
Jim Meyering
13a5e426f3 Remove common_option_prefix flag.
(test_vector): Prepend the common option here instead.
1997-01-30 03:27:35 +00:00
Jim Meyering
56557d787a Remove input_via_stdin flag.
Do each test twice: get input via REDIR and PIPE.
1997-01-30 03:26:27 +00:00
Jim Meyering
6b1d2c4de1 Do each test three times. 1997-01-30 03:25:16 +00:00
Jim Meyering
bca3705ac5 . 1997-01-30 03:22:44 +00:00
Jim Meyering
9fcda065b6 . 1997-01-30 03:14:43 +00:00
Jim Meyering
188edf1546 . 1997-01-30 03:01:15 +00:00
Jim Meyering
22922b8765 Allow each test to be run any or all of three different ways. Program
input may be specified via a file or files listed on the command line,
via input redirection (if there's only one file), or via a pipe.
1997-01-29 14:19:17 +00:00
Jim Meyering
e16812dea8 . 1997-01-29 13:03:05 +00:00
Jim Meyering
20580c3f25 . 1997-01-29 02:54:21 +00:00
Jim Meyering
a6871ebbce Remove `t' prefix on all generated test file names.
Change suffixes from (.in, .exp, .out, .err) to (.I, .X, .O, .E).
Ensure that no test file (generated or maintainer-supplied) has a
longer than 14 characters.
1997-01-28 21:22:34 +00:00
Jim Meyering
0ce61713d5 (usage): Remove one space in message to make colons line up. 1997-01-28 03:44:27 +00:00
Jim Meyering
d705b6c469 . 1997-01-28 03:43:05 +00:00
Jim Meyering
771ab6e1bf (print_long_format): Fix off-by-one problem in size being passed to strftime. 1997-01-28 03:40:18 +00:00
Jim Meyering
b103723acc . 1997-01-27 03:15:14 +00:00
Jim Meyering
03ebea3ec6 . 1997-01-27 03:10:22 +00:00
Jim Meyering
5f011471a3 really make the messages identical 1997-01-27 02:28:39 +00:00
Jim Meyering
6b3f36f935 . 1997-01-27 02:18:56 +00:00
Jim Meyering
1010c1f580 . 1997-01-26 20:01:11 +00:00
Jim Meyering
7490632078 . 1997-01-26 19:04:03 +00:00
Jim Meyering
537381d409 . 1997-01-26 19:03:30 +00:00
Jim Meyering
3a01be66d4 . 1997-01-26 19:02:52 +00:00
Jim Meyering
8a87c1a169 . 1997-01-26 19:01:54 +00:00
Jim Meyering
07b07ca07c . 1997-01-26 18:57:36 +00:00
Jim Meyering
26a10a8026 (usage): Fix typo (--writeable -> --writable) in help output 1997-01-26 18:51:44 +00:00
Jim Meyering
072c1efe39 (parse_options): Add quotes to make messages identical. 1997-01-26 18:50:33 +00:00
Jim Meyering
c38939be8e . 1997-01-26 07:03:50 +00:00
283 changed files with 24452 additions and 12228 deletions

View File

@@ -134,8 +134,8 @@ 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 December
1996:
in ISO 3166. The following translation teams exist, as of February
1997:
Arabic `ar', Chinese `zh', Czech `cs', Danish `da', Dutch `nl',
English `en', Esperanto `eo', Finnish `fi', French `fr', German
@@ -173,7 +173,7 @@ Available Packages
Languages are not equally supported in all GNU packages. The
following matrix shows the current state of GNU internationalization,
as of December 1996. The matrix shows, in regard of each package, for
as of February 1997. The matrix shows, in regard of each package, for
which languages PO files have been submitted to translation
coordination.
@@ -182,33 +182,33 @@ coordination.
bash | [] [] [] | 3
bison | [] [] [] | 3
clisp | [] [] [] | 3
cpio | [] [] [] [] | 4
cpio | [] [] [] [] [] | 5
diffutils | [] [] [] [] | 4
enscript | [] [] [] [] [] | 5
fileutils | [] [] [] [] [] [] [] [] | 8
findutils | [] [] [] [] [] [] | 6
flex | [] [] | 2
findutils | [] [] [] [] [] [] [] | 7
flex | [] [] [] | 3
gcal | [] [] [] | 3
gettext | [] [] [] [] [] [] [] [] [] [] | 11
grep | [] [] [] [] [] [] [] [] | 8
hello | [] [] [] [] [] [] [] [] [] [] | 10
id-utils | [] [] | 2
indent | | 0
libc | [] [] [] [] [] [] | 6
indent | [] [] | 2
libc | [] [] [] [] [] [] [] | 7
m4 | [] [] [] [] [] | 5
make | [] [] [] [] [] | 5
make | [] [] [] [] [] [] | 6
music | [] | 1
ptx | [] [] [] [] [] [] [] [] | 8
recode | [] [] [] [] [] [] [] | 7
recode | [] [] [] [] [] [] [] [] | 8
sh-utils | [] [] [] [] [] | 5
sharutils | [] [] [] [] | 4
sharutils | [] [] [] [] [] | 5
tar | [] [] [] [] [] [] [] [] [] | 9
texinfo | | 0
textutils | [] [] [] [] [] [] | 6
wdiff | [] [] [] [] [] [] [] [] | 8
`-------------------------------------------'
14 languages cs de en es fi fr ja ko nl no pl pt sl sv
27 packages 1 21 1 11 1 24 1 8 20 7 14 6 7 14 136
27 packages 1 22 1 14 1 25 1 10 20 7 14 7 7 15 145
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
@@ -221,6 +221,6 @@ 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 December 1996 seems to be old, you may fetch a more recent copy
If February 1997 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.
59 Temple Place - Suite 330, Boston, MA 02111-1307, 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.
@@ -279,7 +279,7 @@ POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -304,8 +304,9 @@ 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., 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
Also add information on how to contact you by electronic and paper mail.

View File

@@ -31,7 +31,7 @@ The simplest way to compile this package is:
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes a while. While running, it prints some
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
@@ -167,7 +167,9 @@ operates.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made.
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
@@ -178,4 +180,3 @@ operates.
script, and exit.
`configure' also accepts some other, not widely useful, options.

13
THANKS
View File

@@ -1,21 +1,32 @@
This is just a start at listing e-mail addresses of contributors.
The rest of the addresses are still in the ChangeLog.
Arne Henrik Juul arnej@imf.unit.no
Andreas Schwab: schwab@issan.informatik.uni-dortmund.de
Arne Henrik Juul: arnej@imf.unit.no
Bauke Jan Douma: bjdouma@xs4all.nl
Bengt Martensson: bengt@mathematik.uni-Bremen.de
Charles Karney: karney@pppl.gov
Eirik Fuller: eirik@netcom.com
Emile LeBlanc: leblanc@math.toronto.edu
Galen Hazelwood: galenh@micron.net
Greg McGary: gkm@eng.ascend.com
Hugh Daniel: hugh@xanadu.com
James: james@albion.glarp.com
James Antill: jmanti%essex.ac.uk@seralph21.essex.ac.uk
Jesse Thilo: jgt2@eecs.lehigh.edu
Joakim Rosqvist: dvljrt@cs.umu.se
John Gatewood Ham: zappaman@alphabox.compsci.buu.ac.th
Marcus Daniels: marcus@sysc.pdx.edu
Mark A. Thomas: thommark@access.digex.net
Mark Harris: mark@monitor.designacc.com
Matthew S. Levine: mslevine@theory.lcs.mit.edu
Miles Bader: miles@gnu.ai.mit.edu
Peter Eriksson: peter@ifm.liu.se
Ross Ridge: rridge@calum.csclub.uwaterloo.ca
Santiago Vila Doncel: sanvila@ctv.es
Stuart Kemp: skemp@peter.bmc.com
Thomas Bushnell, n/BSG: thomas@gnu.ai.mit.edu
Torbjorn Lindgren: tl@funcom.no
Tony Leneis: tony@plaza.ds.adp.com
Wayne Stewart: wstewa@atl.com

View File

@@ -1,9 +1,7 @@
## 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
EXTRA_DIST = perm.texi getdate.texi
# 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],

View File

@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.1l from Makefile.am
# Makefile.in generated automatically by automake 1.2 from Makefile.am
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
@@ -32,26 +32,58 @@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
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@
NORMAL_INSTALL = true
PRE_INSTALL = true
POST_INSTALL = true
NORMAL_UNINSTALL = true
PRE_UNINSTALL = true
POST_UNINSTALL = true
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CPP = @CPP@
DATADIRNAME = @DATADIRNAME@
DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAINT = @MAINT@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MVDIR_PROG = @MVDIR_PROG@
PACKAGE = @PACKAGE@
PERL = @PERL@
POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
LN = @LN@
RM = @RM@
U = @U@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
YACC = @YACC@
l = @l@
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
EXTRA_DIST = perm.texi getdate.texi
# 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],
@@ -62,6 +94,7 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
TEXI2DVI = texi2dvi
TEXINFO_TEX = $(srcdir)/texinfo.tex
INFO_DEPS = fileutils.info
DVIS = fileutils.dvi
TEXINFOS = fileutils.texi
@@ -69,19 +102,16 @@ 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)
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
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
.SUFFIXES: .dvi .info .ps .texi .texinfo
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnits doc/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
@@ -89,15 +119,17 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
version.texi: @MAINT@stamp-vti
cp $(srcdir)/stamp-vti $(srcdir)/version.texi
stamp-vti: fileutils.texi $(top_srcdir)/configure.in
echo "@set UPDATED `cd $(srcdir) \
@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
@echo "@set EDITION $(VERSION)" >> vti.tmp
@echo "@set VERSION $(VERSION)" >> vti.tmp
@cmp -s vti.tmp $(srcdir)/stamp-vti \
|| (echo "Updating $(srcdir)/stamp-vti"; \
cp vti.tmp $(srcdir)/stamp-vti)
@rm -f vti.tmp
mostlyclean-vti:
rm -f vti.tmp
@@ -116,6 +148,7 @@ fileutils.dvi: fileutils.texi version.texi
DVIPS = dvips
.texi.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
@@ -123,42 +156,59 @@ DVIPS = dvips
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.texi:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo.info:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo:
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
cd $(srcdir) \
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.texinfo.dvi:
TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) $<
TEXINPUTS=$(srcdir):$$TEXINPUTS \
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.dvi.ps:
$(DVIPS) $< -o $@
install-info-am: $(INFO_DEPS)
$(NORMAL_INSTALL)
@$(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; \
d=$(srcdir); \
for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
if test -f $$d/$$ifile; then \
echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
$(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
else : ; fi; \
done; \
done
$(POST_INSTALL)
@if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
@$(POST_INSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/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; :;\
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 \
$(PRE_UNINSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/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
$(NORMAL_UNINSTALL)
for file in $(INFO_DEPS); do \
(cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
done
dist-info: $(INFO_DEPS)
for base in $(INFO_DEPS); do \
@@ -170,17 +220,18 @@ dist-info: $(INFO_DEPS)
done; \
done
mostlyclean-info:
mostlyclean-aminfo:
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
fileutils.pg fileutils.toc fileutils.tp fileutils.tps \
fileutils.vr fileutils.vrs fileutils.op fileutils.tr \
fileutils.cv
clean-info:
clean-aminfo:
distclean-info:
distclean-aminfo:
maintainer-clean-info:
maintainer-clean-aminfo:
for i in $(INFO_DEPS); do rm -f `eval echo $$i*`; done
tags: TAGS
TAGS:
@@ -189,34 +240,39 @@ TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = doc
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnits doc/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
$(MAKE) distdir="$(distdir)" dist-info
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
info: $(INFO_DEPS)
dvi: $(DVIS)
check: all
$(MAKE)
installcheck:
install-exec:
$(NORMAL_INSTALL)
@$(NORMAL_INSTALL)
install-data: install-info-am
$(NORMAL_INSTALL)
@$(NORMAL_INSTALL)
install: install-exec install-data all
@:
uninstall: uninstall-info
all: $(INFO_DEPS) Makefile
all: Makefile $(INFO_DEPS)
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
$(mkinstalldirs) $(infodir)
@@ -229,28 +285,28 @@ clean-generic:
distclean-generic:
rm -f Makefile $(DISTCLEANFILES)
rm -f config.cache config.log stamp-h
rm -f config.cache config.log stamp-h stamp-h[0-9]*
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
mostlyclean: mostlyclean-vti mostlyclean-aminfo mostlyclean-generic
clean: clean-vti clean-info clean-generic mostlyclean
clean: clean-vti clean-aminfo clean-generic mostlyclean
distclean: distclean-vti distclean-info distclean-generic clean
distclean: distclean-vti distclean-aminfo distclean-generic clean
rm -f config.status
maintainer-clean: maintainer-clean-vti maintainer-clean-info \
maintainer-clean: maintainer-clean-vti maintainer-clean-aminfo \
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 \
maintainer-clean-vti install-info-am uninstall-info mostlyclean-aminfo \
distclean-aminfo clean-aminfo maintainer-clean-aminfo 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

View File

@@ -4,6 +4,8 @@
@cindex date input formats
@findex getdate
First, a quote:
@quotation
Our units of temporal measurement, from seconds on up to months, are so
complicated, asymmetrical and disjunctive so as to make coherent mental
@@ -44,7 +46,7 @@ midnight, 1 January 1970 UCT.
* General date syntax:: Common rules.
* Calendar date item:: 19 Dec 1994.
* Time of day item:: 9:20pm.
* Timezone item:: EST, DST, BST, UCT, AHST, ...
* Time zone item:: EST, DST, BST, UTC, ...
* Day of week item:: Monday and others.
* Relative item in date strings:: next tuesday, 2 years ago.
* Pure numbers in date strings:: 19931219, 1440.
@@ -203,161 +205,139 @@ indicates the first half of the day, @samp{pm} indicates the second
half of the day. In this notation, 12 is the predecessor of 1:
midnight is @samp{12am} while noon is @samp{12pm}.
@cindex timezone correction
@cindex minutes, timezone correction by
The time may alternatively be followed by a timezone correction,
@cindex time zone correction
@cindex minutes, time zone correction by
The time may alternatively be followed by a time zone correction,
expressed as @samp{@var{s}@var{hh}@var{mm}}, where @var{s} is @samp{+}
or @samp{-}, @var{hh} is a number of zone hours and @var{mm} is a number
of zone minutes. When a timezone correction is given this way, it
forces interpretation of the time in UTC, overriding any previous
specification for the timezone or the local timezone. The @var{minute}
part of the time of the day may not be elided when a timezone correction
is used. This is the only way to specify a timezone correction by
of zone minutes. When a time zone correction is given this way, it
forces interpretation of the time relative to
Coordinated Universal Time (UTC), overriding any previous
specification for the time zone or the local time zone. The @var{minute}
part of the time of the day may not be elided when a time zone correction
is used. This is the only way to specify a time zone correction by
fractional parts of an hour.
Either @samp{am}/@samp{pm} or a timezone correction may be specified,
Either @samp{am}/@samp{pm} or a time zone correction may be specified,
but not both.
@node Timezone item
@section Timezone item
@node Time zone item
@section Time zone item
@cindex timezone item
@cindex time zone item
A @dfn{timezone item} specifies an international timezone, indicated by
a small set of letters. Any included period is ignored. Military
timezone designations use a single letter. Currently, only integral
zone hours may be represented in a timezone item. See the previous
section for a finer control over the timezone correction.
A @dfn{time zone item} specifies an international time zone, indicated by
a small set of letters. They are supported for backward compatibility reasons,
but they are not recommended because they are ambiguous in practice:
for example, the abbreviation @samp{EST} has different meanings in
Australia and the United States. Any included period is ignored. Military
time zone designations use a single letter. Currently, only integral
zone hours may be represented in a time zone item. See the previous
section for a finer control over the time zone correction.
Here are many non-daylight-savings-time timezones, indexed by the zone
Here are many non-daylight-saving-time time zones, indexed by the zone
hour value.
@table @asis
@item +000
@cindex Greenwich Mean Time
@cindex Universal Coordinated Time
@cindex Western European Time
@samp{GMT} for Greenwich Mean, @samp{UT} or @samp{UTC} for Universal
(Coordinated), @samp{WET} for Western European and @samp{Z} for
militaries.
@item +100
@cindex West African Time
@samp{WAT} for West Africa and
@samp{A} for militaries.
@item +200
@cindex Azores Time
@samp{AT} for Azores and @samp{B} for militaries.
@item +300
@samp{C} for militaries.
@item +400
@cindex Atlantic Standard Time
@samp{AST} for Atlantic Standard and @samp{D} for militaries.
@item +500
@cindex Eastern Standard Time
@samp{E} for militaries and @samp{EST} for Eastern Standard.
@item +600
@cindex Central Standard Time
@samp{CST} for Central Standard and @samp{F} for militaries.
@item +700
@cindex Mountain Standard Time
@samp{G} for militaries and @samp{MST} for Mountain Standard.
@item +800
@cindex Pacific Standard Time
@samp{H} for militaries and @samp{PST} for Pacific Standard.
@item +900
@cindex Yukon Standard Time
@samp{I} for militaries and @samp{YST} for Yukon Standard.
@item +1000
@cindex Alaska-Hawaii Time
@cindex Central Alaska Time
@cindex Hawaii Standard Time
@samp{AHST} for Alaska-Hawaii Standard, @samp{CAT} for Central Alaska,
@samp{HST} for Hawaii Standard and @samp{K} for militaries.
@item +1100
@cindex Nome Standard Time
@samp{L} for militaries and @samp{NT} for Nome.
@item +1200
@cindex International Date Line West
@samp{IDLW} for International Date Line West and @samp{M} for
militaries.
@item -100
@cindex Central European Time
@cindex Middle European Time
@cindex Middle European Winter Time
@cindex French Winter Time
@cindex Swedish Winter Time
@samp{CET} for Central European, @samp{FWT} for French Winter,
@samp{MET} for Middle European, @samp{MEWT} for Middle European
Winter, @samp{N} for militaries and @samp{SWT} for Swedish Winter.
@item -200
@cindex Eastern European Time
@cindex USSR Zone
@samp{EET} for Eastern European, USSR Zone 1 and @samp{O} for militaries.
@item -300
@cindex Baghdad Time
@samp{BT} for Baghdad, USSR Zone 2 and @samp{P} for militaries.
@item -400
@samp{Q} for militaries and @samp{ZP4} for USSR Zone 3.
@item -500
@samp{R} for militaries and @samp{ZP5} for USSR Zone 4.
@item -600
@samp{S} for militaries and @samp{ZP6} for USSR Zone 5.
@item -700
@cindex West Australian Standard Time
@samp{T} for militaries and @samp{WAST} for West Australian Standard.
@item -800
@cindex China Coast Time
@samp{CCT} for China Coast, USSR Zone 7 and @samp{U} for militaries.
@item -900
@cindex Japan Standard Time
@samp{JST} for Japan Standard, USSR Zone 8 and @samp{V} for militaries.
@item -1000
@cindex East Australian Standard Time
@cindex Guam Standard Time
@samp{EAST} for East Australian Standard, @samp{GST} for Guam
Standard, USSR Zone 9 and @samp{W} for militaries.
@item -1200
@samp{Y} for militaries.
@item -1100
@samp{X} for militaries.
@item -1200
@cindex International Date Line East
@cindex New Zealand Standard Time
@samp{IDLE} for International Date Line East, @samp{NZST} for
New Zealand Standard, @samp{NZT} for New Zealand and @samp{Y} for
militaries.
@item -1000
@samp{W} for militaries.
@item -0900
@samp{V} for militaries.
@item -0800
@samp{PST} for Pacific Standard, and
@samp{U} for militaries.
@item -0700
@samp{MST} for Mountain Standard, and
@samp{T} for militaries.
@item -0600
@samp{CST} for Central Standard, and
@samp{S} for militaries.
@item -0500
@samp{EST} for Eastern Standard, and
@samp{R} for militaries.
@item -0400
@samp{AST} for Atlantic Standard, and
@samp{Q} for militaries.
@item -0300
@samp{P} for militaries.
@item -0200
@samp{O} for militaries.
@item -0100
@samp{N} for militaries.
@item +0000
@cindex Greenwich Mean Time
@cindex Coordinated Universal Time
@cindex Universal Coordinated Time
@cindex Universal Time (Coordinated)
@samp{GMT} for Greenwich Mean,
@samp{UT} for Universal,
@samp{UTC} for Coordinated Universal,
@samp{WET} for Western European, and
@samp{Z} for ISO 8601 and militaries.
@item +0100
@samp{A} for militaries,
@samp{CET} for Central European,
@samp{MET} for Midden Europesche Tijd (Dutch), and
@samp{MEZ} for Mittel-Europ@"aische Zeit (German).
@item +0200
@samp{B} for militaries, and
@samp{EET} for Eastern European.
@item +0300
@samp{C} for militaries.
@item +0400
@samp{D} for militaries.
@item +0500
@samp{E} for militaries.
@item +0600
@samp{F} for militaries.
@item +0700
@samp{G} for militaries.
@item +0800
@samp{H} for militaries.
@item +0900
@samp{I} for militaries, and
@samp{JST} for Japan Standard.
@item +1000
@samp{GST} for Guam Standard, and
@samp{K} for militaries.
@item +1100
@samp{L} for militaries.
@item +1200
@samp{M} for militaries, and
@samp{NZST} for New Zealand Standard.
@end table
@cindex daylight savings time
Here are many DST timezones, indexed by the zone hour value. Also, by
following a non-DST timezone by the string @samp{DST} in a separate word
(that is, separated by some whitespace), the corresponding DST timezone
@cindex daylight-saving time
Here are many daylight-saving time (DST) time zones,
indexed by the zone hour value. Also, by
following a non-DST time zone by the string @samp{DST} in a separate word
(that is, separated by some whitespace), the corresponding DST time zone
may be specified.
@table @asis
@item 0
@samp{BST} for British Summer.
@item +400
@samp{ADT} for Atlantic Daylight.
@item +500
@samp{EDT} for Eastern Daylight.
@item +600
@samp{CDT} for Central Daylight.
@item +700
@samp{MDT} for Mountain Daylight.
@item +800
@item -0700
@samp{PDT} for Pacific Daylight.
@item +900
@samp{YDT} for Yukon Daylight.
@item +1000
@samp{HDT} for Hawaii Daylight.
@item -100
@samp{MEST} for Middle European Summer, @samp{MESZ} for Middle European
Summer, @samp{SST} for Swedish Summer and @samp{FST} for French Summer.
@item -700
@samp{WADT} for West Australian Daylight.
@item -1000
@samp{EADT} for Eastern Australian Daylight.
@item -1200
@item -0600
@samp{MDT} for Mountain Daylight.
@item -0500
@samp{CDT} for Central Daylight.
@item -0400
@samp{EDT} for Eastern Daylight.
@item -0300
@samp{ADT} for Atlantic Daylight.
@item +0100
@samp{BST} for British Summer, and
@samp{WEST} for Western European Summer.
@item +0200
@samp{CEST} for Central European Summer,
@samp{MEST} for Midden Europesche S. Tijd (Dutch), and
@samp{MESZ} for Mittel-Europ@"aische Sommerzeit (German).
@item +1300
@samp{NZDT} for New Zealand Daylight.
@end table

View File

@@ -1,7 +1,7 @@
#!/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
# Get modification time of a file or directory and pretty-print it.
# Copyright (C) 1995, 1996, 1997 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
@@ -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., 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.
# Prevent date giving response in another language.
LANG=C
@@ -25,14 +25,15 @@ export LC_ALL
LC_TIME=C
export LC_TIME
# Get the extended ls output of the file.
# Get the extended ls output of the file or directory.
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
if ls -L /dev/null 1>/dev/null 2>&1; then
set - `ls -L -l $1`
set - x`ls -L -l -d $1`
else
set - `ls -l $1`
set - x`ls -l -d $1`
fi
# The month is at least the fourth argument.
# (3 shifts here, the next inside the loop)
# The month is at least the fourth argument
# (3 shifts here, the next inside the loop).
shift
shift
shift

View File

@@ -120,8 +120,7 @@ by the Foundation.
@cindex shell utilities
@cindex utilities for shell programming
This manual minimally documents version @value{VERSION} of the GNU shell
utilities.
This manual documents version @value{VERSION} of the GNU shell utilities.
@menu
* Introduction:: Caveats, overview, and authors.
@@ -182,8 +181,10 @@ sometimes difficult to infer. @xref{Bugs, , , gcc, GNU CC}.
@cindex Pinard, @value{Francois}
@cindex Berry, Karl
@cindex Stallman, Richard
This manual is based on the Unix man pages in the distribution, which
were originally written by David MacKenzie and updated by Jim Meyering.
This manual was originally derived from the Unix man pages in the
distribution, which were written by David MacKenzie and updated by Jim
Meyering. What you are reading now is the authoritative documentation
for these utilities; the man pages are no longer being maintained.
@value{Francois} 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
@@ -719,7 +720,7 @@ Exit status:
@menu
* Relations for expr:: | & < <= = == != >= >
* Numeric expressions:: + - * / %
* String expressions:: <colon> match substr index length
* String expressions:: <colon> match substr index length quote
* Examples of expr:: Examples.
@end menu
@@ -840,9 +841,9 @@ An alternative way to do pattern matching. This is the same as
@findex substr
Returns the substring of @var{string} beginning at @var{position}
with length at most @var{length}. If either @var{position} or
@var{length} is negative or non-numeric, returns the null string.
@var{length} is negative, zero, or non-numeric, returns the null string.
@item index @var{string} @var{character-class}
@item index @var{string} @var{charset}
@findex index
Returns the first position in @var{string} where the first character in
@var{charset} was found. If no character in @var{charset} is found in
@@ -852,9 +853,20 @@ Returns the first position in @var{string} where the first character in
@findex length
Returns the length of @var{string}.
@item quote @var{token}
@findex quote
Interpret @var{token} as a string, even if it is a keyword like @var{match}
or an operator like @code{/}.
This makes it possible to test @code{expr length quote "$x"} or
@code{expr quote "$x" : '.*/\(.\)'} and have it do the right thing even if
the value of @var{$x} happens to be (for example) @code{/} or @code{index}.
This operator is a GNU extension. It is disabled when
the environment variable @var{POSIXLY_CORRECT} is set.
@end table
The keywords cannot be used as strings.
To make @code{expr} interpret keywords as strings, you must use the
@code{quote} operator.
@node Examples of expr
@@ -881,6 +893,8 @@ expr index abcdef cz
@result{} 3
expr index index a
@error{} expr: syntax error
expr index quote index a
@result{} 0
@end example
@@ -2439,6 +2453,50 @@ use @samp{date --rfc}. I just did and saw this:
Mon, 25 Mar 1996 23:34:17 -0600
@end example
@item
To convert a date string to the number of seconds since the epoch
(which is 1970-01-01 00:00:00 UTC), use the @samp{--date} option with
the @samp{%s} format. That can be useful in sorting and/or graphing
and/or comparing data by date. The following command outputs the
number of the seconds since the epoch for the time one second later
than the epoch, but in time zone five hours later (Cambridge, Massachusetts),
thus a total of five hours and one second after the epoch:
@example
date --date='1970-01-01 00:00:01 UTC +5 hours' +%s
18001
@end example
Suppose you had @emph{not} specified time zone information in the example above.
Then, date would have used your computer's idea of the time zone when
interpreting the string. Here's what you would get if you were in
Greenwich, England:
@example
# local time zone used
date --date='1970-01-01 00:00:01' +%s
1
@end example
@item
If you're sorting or graphing dated data, your raw date values may be
represented as seconds since the epoch. But few people can look at
the date @samp{946684800} and casually note ``Oh, that's the first second
of the year 2000.''
@example
date --date='2000-01-01 UTC' +%s
946684800
@end example
To convert such an unwieldy number of seconds back to
a more readable form, use a command like this:
@smallexample
date -d '1970-01-01 946684800 sec' +"%Y-%m-%d %T %z"
2000-01-01 00:00:00 +0000
@end smallexample
@end itemize

File diff suppressed because it is too large Load Diff

View File

@@ -108,8 +108,7 @@ by the Foundation.
@cindex text utilities
@cindex utilities for text handling
This manual minimally documents version @value{VERSION} of the GNU text
utilities.
This manual documents version @value{VERSION} of the GNU text utilities.
@menu
* Introduction:: Caveats, overview, and authors.
@@ -150,8 +149,10 @@ expected, what you got, and why it is wrong. Diffs are welcome, but
please include a description of the problem as well, since this is
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.
This manual was originally derived from the Unix man pages in the
distribution, which were written by David MacKenzie and updated by Jim
Meyering. What you are reading now is the authoritative documentation
for these utilities; the man pages are no longer being maintained.
The original @code{fmt} man page was written by Ross Paterson.
Fran@,{c}ois Pinard did the initial conversion to Texinfo format.
Karl Berry did the indexing, some reorganization, and editing of the results.
@@ -996,10 +997,10 @@ opened. (The exit status will still be nonzero, however.)
@opindex -s
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.
option is omitted altogether, the default is @key{TAB} together with
@samp{-j} option and space otherwise (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
@@ -1630,7 +1631,7 @@ options}.
If a @var{file} is specified as @samp{-} or if no files are given
@code{md5sum} computes the checksum for the standard input.
@code{md5sum} can also determine whether a file and checksum are
consistent. Synopsis:
consistent. Synopses:
@example
md5sum [@var{option}]@dots{} [@var{file}]@dots{}
@@ -1704,7 +1705,7 @@ Treat all input files as text files. This is the reverse of
@opindex -w
@opindex --warn
@cindex verifying MD5 checksums
When verifying checksums, warn about improperly formated MD5 checksum lines.
When verifying checksums, warn about improperly formatted MD5 checksum lines.
This option is useful only if all but a few lines in the checked input
are valid.
@@ -2167,6 +2168,11 @@ Columns are separated by @key{TAB}.
The options @samp{-1}, @samp{-2}, and @samp{-3} suppress printing of
the corresponding columns. Also see @ref{Common options}.
Unlike some other comparison utilities, @code{comm} has an exit
status that does not depend on the result of the comparison.
Upon normal completion @code{comm} produces an exit code of zero.
If there is an error it exits with nonzero status.
@node Operating on fields within a line
@chapter Operating on fields within a line
@@ -2453,7 +2459,7 @@ used only in @var{set1} or @var{set2}, as noted below.
@table @asis
@item Backslash escapes.
@item Backslash escapes
@cindex backslash escapes
A backslash followed by a character not listed below causes an error
@@ -2461,19 +2467,19 @@ message.
@table @samp
@item \a
Control-G,
Control-G.
@item \b
Control-H,
Control-H.
@item \f
Control-L,
Control-L.
@item \n
Control-J,
Control-J.
@item \r
Control-M,
Control-M.
@item \t
Control-I,
Control-I.
@item \v
Control-K,
Control-K.
@item \@var{ooo}
The character with the value given by @var{ooo}, which is 1 to 3
octal digits,
@@ -2481,7 +2487,7 @@ octal digits,
A backslash.
@end table
@item Ranges.
@item Ranges
@cindex ranges
The notation @samp{@var{m}-@var{n}} expands to all of the characters
@@ -2493,7 +2499,7 @@ enclose ranges, translations specified in that format will still work as
long as the brackets in @var{string1} correspond to identical brackets
in @var{string2}.
@item Repeated characters.
@item Repeated characters
@cindex repeated characters
The notation @samp{[@var{c}*@var{n}]} in @var{set2} expands to @var{n}
@@ -2503,7 +2509,7 @@ to as many copies of @var{c} as are needed to make @var{set2} as long as
@var{set1}. If @var{n} begins with @samp{0}, it is interpreted in
octal, otherwise in decimal.
@item Character classes.
@item Character classes
@cindex characters classes
The notation @samp{[:@var{class}:]} expands to all of the characters in
@@ -2558,7 +2564,7 @@ Uppercase letters.
Hexadecimal digits.
@end table
@item Equivalence classes.
@item Equivalence classes
@cindex equivalence classes
The syntax @samp{[=@var{c}=]} expands to all of the characters that are
@@ -2820,10 +2826,10 @@ Robbins.
@menu
* Toolbox introduction::
* I/O redirection::
* The @code{who} command::
* The @code{cut} command::
* The @code{sort} command::
* The @code{uniq} command::
* The who command::
* The cut command::
* The sort command::
* The uniq command::
* Putting the tools together::
@end menu
@@ -2938,7 +2944,7 @@ discussion, we will only present those command line options that interest
us. As you should always do, double check your system documentation
for the full story.
@node The @code{who} command
@node The who command
@unnumberedsec The @code{who} command
The first program is the @code{who} command. By itself, it generates a
@@ -2960,7 +2966,7 @@ Unix systems, user names are never more than eight characters long. This
little bit of trivia will be useful later. The output of @code{who} is nice,
but the data is not all that exciting.
@node The @code{cut} command
@node The cut command
@unnumberedsec The @code{cut} command
The next program we'll look at is the @code{cut} command. This program
@@ -2989,7 +2995,7 @@ With the @samp{-c} option, @code{cut} will cut out specific characters
useful for data filtering.
@node The @code{sort} command
@node The sort command
@unnumberedsec The @code{sort} command
Next we'll look at the @code{sort} command. This is one of the most
@@ -3002,7 +3008,7 @@ making it into a filter). The sort is based on the machine collating
sequence (@sc{ASCII}) or based on user-supplied ordering criteria.
@node The @code{uniq} command
@node The uniq command
@unnumberedsec The @code{uniq} command
Finally (at least for now), we'll look at the @code{uniq} program. When

View File

@@ -3,13 +3,13 @@ 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 getgroups.c
EXTRA_DIST = chown.c mkdir.c rmdir.c getline.c mktime.c strftime.c getgroups.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 \
addext.c argmatch.c backupfile.c basename.c dirname.c filemode.c \
full-write.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
@@ -20,6 +20,6 @@ libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
noinst_HEADERS = argmatch.h backupfile.h error.h fnmatch.h fsusage.h \
getdate.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
save-cwd.h xstrtol.h xstrtoul.h strverscmp.h
BUILT_SOURCES = getdate.c posixtm.c

View File

@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.1l from Makefile.am
# Makefile.in generated automatically by automake 1.2 from Makefile.am
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
@@ -32,32 +32,68 @@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
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@
NORMAL_INSTALL = true
PRE_INSTALL = true
POST_INSTALL = true
NORMAL_UNINSTALL = true
PRE_UNINSTALL = true
POST_UNINSTALL = true
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CPP = @CPP@
DATADIRNAME = @DATADIRNAME@
DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MVDIR_PROG = @MVDIR_PROG@
PACKAGE = @PACKAGE@
PERL = @PERL@
POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
LN = @LN@
RM = @RM@
U = @U@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
YACC = @YACC@
l = @l@
noinst_LIBRARIES = libfu.a
EXTRA_DIST = mkdir.c rmdir.c getline.c mktime.c strftime.c getgroups.c
EXTRA_DIST = chown.c mkdir.c rmdir.c getline.c mktime.c strftime.c getgroups.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 \
addext.c argmatch.c backupfile.c basename.c dirname.c filemode.c \
full-write.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 \
safe-read.c save-cwd.c savedir.c simple-hash.c \
stripslash.c userspec.c xgetcwd.c \
xmalloc.c xstrdup.c xstrtol.c xstrtoul.c yesno.c
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
@@ -66,7 +102,7 @@ libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
noinst_HEADERS = argmatch.h backupfile.h error.h fnmatch.h fsusage.h \
getdate.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
save-cwd.h simple-hash.h xstrtol.h xstrtoul.h strverscmp.h
BUILT_SOURCES = getdate.c posixtm.c
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -79,59 +115,55 @@ 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
libfu_a_OBJECTS = getdate.o posixtm.o getopt.o getopt1.o addext.o \
argmatch.o backupfile.o basename.o dirname.o filemode.o full-write.o \
idcache.o isdir.o long-options.o makepath.o modechange.o path-concat.o \
safe-read.o save-cwd.o savedir.o simple-hash.o stripslash.o userspec.o \
xgetcwd.o xmalloc.o xstrdup.o xstrtol.o xstrtoul.o yesno.o
AR = ar
INTERLOCK = ./interlock
YLWRAP = ./ylwrap
YLWRAP = $(srcdir)/ylwrap
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(CC) $(LDFLAGS) -o $@
LINK = $(CC) $(CFLAGS) $(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 getgroups.c getline.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
DIST_COMMON = Makefile.am Makefile.in alloca.c chown.c error.c error.h \
euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c getdate.c \
getgroups.c getline.c group-member.c 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 strverscmp.c ylwrap
PACKAGE = @PACKAGE@
VERSION = @VERSION@
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) \
$(TEXINFOS) $(MANS) $(EXTRA_DIST)
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(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/getgroups.P \
.deps/getline.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
GZIP = --best
DEP_FILES = .deps/addext.P .deps/alloca.P .deps/argmatch.P \
.deps/backupfile.P .deps/basename.P .deps/chown.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/getgroups.P .deps/getline.P .deps/getopt.P \
.deps/getopt1.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/simple-hash.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/strverscmp.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 .y
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL)
cd $(top_srcdir) && automake --gnu lib/Makefile
.SUFFIXES: .c .h .o .y
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnits lib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
@@ -159,14 +191,15 @@ 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) $<
$(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(YFLAGS)
.y.h:
$(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(YFLAGS)
tags: TAGS
@@ -176,11 +209,8 @@ ID: $(HEADERS) $(SOURCES)
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
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $(SOURCES) $(HEADERS) -o $$here/TAGS)
mostlyclean-tags:
@@ -194,7 +224,12 @@ maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = lib
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnits lib/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
@@ -204,13 +239,12 @@ distdir: $(DISTFILES)
MKDEP = gcc -M $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
-include .deps/.P
.deps/.P:
test -d .deps || mkdir .deps
.deps/.P: $(BUILT_SOURCES)
echo > $@
-include $(DEP_FILES)
$(DEP_FILES): .deps/.P
mostlyclean-depend:
@@ -221,31 +255,33 @@ distclean-depend:
maintainer-clean-depend:
rm -rf .deps
.deps/%.P: $(srcdir)/%.c
.deps/%.P: %.c
@echo "Computing dependencies for $<..."
@o='o'; \
test -n "$o" && o='$$o'; \
$(MKDEP) $< | sed "s/^\(.*\)\.o:/\1.$$o \1.l$$o:/" > $@
@o='o'; \
test -n "$o" && o='$$o'; \
$(MKDEP) $< >$@.tmp \
&& sed "s,^\(.*\)\.o:,\1.$$o \1.l$$o $@:," < $@.tmp > $@ \
&& rm -f $@.tmp
info:
dvi:
check: all
$(MAKE)
installcheck:
install-exec:
$(NORMAL_INSTALL)
@$(NORMAL_INSTALL)
install-data:
$(NORMAL_INSTALL)
@$(NORMAL_INSTALL)
install: install-exec install-data all
@:
uninstall:
all: $(LIBRARIES) $(BUILT_SOURCES) $(HEADERS) Makefile
all: Makefile $(LIBRARIES) $(HEADERS)
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
@@ -257,7 +293,7 @@ clean-generic:
distclean-generic:
rm -f Makefile $(DISTCLEANFILES)
rm -f config.cache config.log stamp-h
rm -f config.cache config.log stamp-h stamp-h[0-9]*
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:

106
lib/addext.c Normal file
View File

@@ -0,0 +1,106 @@
/* addext.c -- add an extension to a file name
Copyright (C) 1990, 1997 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; see the file COPYING.
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu> and Paul Eggert */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#ifndef HAVE_DOS_FILE_NAMES
#define HAVE_DOS_FILE_NAMES 0
#endif
#ifndef HAVE_LONG_FILE_NAMES
#define HAVE_LONG_FILE_NAMES 0
#endif
#include <backupfile.h>
#if HAVE_LIMITS_H
# include <limits.h>
#endif
#ifndef _POSIX_NAME_MAX
#define _POSIX_NAME_MAX 14
#endif
#include <sys/types.h>
#if HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
/* Append to FILENAME the extension EXT, unless the result would be too long,
in which case just append the character E. */
void
addext (filename, ext, e)
char *filename;
char const *ext;
int e;
{
char *s = base_name (filename);
size_t slen = strlen (s), extlen = strlen (ext);
long slen_max = -1;
#if HAVE_PATHCONF && defined _PC_NAME_MAX
if (slen + extlen <= _POSIX_NAME_MAX && ! HAVE_DOS_FILE_NAMES)
/* The file name is so short there's no need to call pathconf. */
slen_max = _POSIX_NAME_MAX;
else if (s == filename)
slen_max = pathconf (".", _PC_NAME_MAX);
else
{
char c = *s;
*s = 0;
slen_max = pathconf (filename, _PC_NAME_MAX);
*s = c;
}
#endif
if (slen_max < 0)
slen_max = HAVE_LONG_FILE_NAMES ? 255 : 14;
if (HAVE_DOS_FILE_NAMES && slen_max <= 12)
{
/* Live within DOS's 8.3 limit. */
char *dot = strchr (s, '.');
if (dot)
{
slen -= dot + 1 - s;
s = dot + 1;
slen_max = 3;
}
else
slen_max = 8;
extlen = 9; /* Don't use EXT. */
}
if (slen + extlen <= slen_max)
strcpy (s + slen, ext);
else
{
if (slen_max <= slen)
slen = slen_max - 1;
s[slen] = e;
s[slen + 1] = 0;
}
}

View File

@@ -1,5 +1,5 @@
/* argmatch.c -- find a match for a string in an array
Copyright (C) 1990 Free Software Foundation, Inc.
Copyright (C) 1990, 1997 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,24 +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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
along with this program; see the file COPYING.
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by David MacKenzie <djm@ai.mit.edu> */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu> */
#ifdef HAVE_CONFIG_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <argmatch.h>
#include <sys/types.h>
#include <stdio.h>
#ifdef STDC_HEADERS
#if HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
extern char *program_name;
/* If ARG is an unambiguous match for an element of the
null-terminated array OPTLIST, return the index in OPTLIST
of the matched element, else -1 if it does not match any element

View File

@@ -1,18 +1,12 @@
#ifndef ARGMATCH_H
#define ARGMATCH_H 1
/* argmatch.h -- declarations for matching arguments against option lists */
#ifndef __P
# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
# define __P(args) args
# else
# define __P(args) ()
# endif /* GCC. */
#endif /* Not __P. */
#if defined __STDC__ || __GNUC__
# define __ARGMATCH_P(args) args
#else
# define __ARGMATCH_P(args) ()
#endif
int
argmatch __P ((const char *arg, const char *const *optlist));
int argmatch __ARGMATCH_P ((const char *, const char * const *));
void invalid_arg __ARGMATCH_P ((const char *, const char *, int));
void
invalid_arg __P ((const char *kind, const char *value, int problem));
#endif /* ARGMATCH_H */
extern char *program_name;

View File

@@ -1,5 +1,5 @@
/* backupfile.c -- make Emacs style backup file names
Copyright (C) 1990 Free Software Foundation, Inc.
Copyright (C) 1990,1991,1992,1993,1995,1997 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,84 +12,89 @@
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; see the file COPYING.
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* David MacKenzie <djm@gnu.ai.mit.edu>.
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>.
Some algorithms adapted from GNU Emacs. */
#ifdef HAVE_CONFIG_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <argmatch.h>
#include <backupfile.h>
#include <stdio.h>
#include <ctype.h>
#include <sys/types.h>
#include "backupfile.h"
#ifdef HAVE_STRING_H
#if HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
#endif
#ifdef HAVE_DIRENT_H
#if HAVE_DIRENT_H
# include <dirent.h>
# define NLENGTH(direct) (strlen((direct)->d_name))
#else /* not HAVE_DIRENT_H */
# define NLENGTH(direct) strlen ((direct)->d_name)
#else
# define dirent direct
# define NLENGTH(direct) ((direct)->d_namlen)
# ifdef HAVE_SYS_NDIR_H
# define NLENGTH(direct) ((size_t) (direct)->d_namlen)
# if HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif /* HAVE_SYS_NDIR_H */
# ifdef HAVE_SYS_DIR_H
# endif
# if HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif /* HAVE_SYS_DIR_H */
# ifdef HAVE_NDIR_H
# endif
# if HAVE_NDIR_H
# include <ndir.h>
# endif /* HAVE_NDIR_H */
#endif /* HAVE_DIRENT_H */
# endif
#endif
#ifdef CLOSEDIR_VOID
#if CLOSEDIR_VOID
/* Fake a return value. */
# define CLOSEDIR(d) (closedir (d), 0)
#else
# define CLOSEDIR(d) closedir (d)
#endif
#ifdef STDC_HEADERS
#if STDC_HEADERS
# include <stdlib.h>
#else
char *malloc ();
#endif
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
# define IN_CTYPE_DOMAIN(c) 1
#if HAVE_DIRENT_H || HAVE_NDIR_H || HAVE_SYS_DIR_H || HAVE_SYS_NDIR_H
# define HAVE_DIR 1
#else
# define IN_CTYPE_DOMAIN(c) isascii(c)
# define HAVE_DIR 0
#endif
#define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
#if HAVE_LIMITS_H
# include <limits.h>
#endif
#ifndef CHAR_BIT
#define CHAR_BIT 8
#endif
/* Upper bound on the string length of an integer converted to string.
302 / 1000 is ceil (log10 (2.0)). Subtract 1 for the sign bit;
add 1 for integer division truncation; add 1 more for a minus sign. */
#define INT_STRLEN_BOUND(t) ((sizeof (t) * CHAR_BIT - 1) * 302 / 1000 + 2)
/* ISDIGIT differs from ISDIGIT_LOCALE, as follows:
/* ISDIGIT differs from isdigit, as follows:
- Its arg may be any int or unsigned int; it need not be an unsigned char.
- It's guaranteed to evaluate its argument exactly once.
- It's typically faster.
Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
only '0' through '9' are digits. Prefer ISDIGIT to ISDIGIT_LOCALE unless
only '0' through '9' are digits. Prefer ISDIGIT to isdigit unless
it's important to use the locale's definition of `digit' even when the
host does not conform to Posix. */
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
#if defined (HAVE_UNISTD_H)
#include <unistd.h>
#endif
#if defined (_POSIX_VERSION)
/* POSIX does not require that the d_ino field be present, and some
systems do not provide it. */
# define REAL_DIR_ENTRY(dp) 1
#else
#if D_INO_IN_DIRENT
# define REAL_DIR_ENTRY(dp) ((dp)->d_ino != 0)
#else
# define REAL_DIR_ENTRY(dp) 1
#endif
/* Which type of backup file names are generated. */
@@ -97,15 +102,10 @@ enum backup_type backup_type = none;
/* The extension added to file names to produce a simple (as opposed
to numbered) backup file name. */
char *simple_backup_suffix = "~";
const char *simple_backup_suffix = ".orig";
char *basename ();
char *dirname ();
static char *concat ();
char *find_backup_file_name ();
static char *make_version_name ();
static int max_backup_version ();
static int version_number ();
static int max_backup_version __BACKUPFILE_P ((const char *, const char *));
static int version_number __BACKUPFILE_P ((const char *, const char *, size_t));
/* Return the name of the new backup file for file FILE,
allocated with malloc. Return 0 if out of memory.
@@ -116,33 +116,51 @@ char *
find_backup_file_name (file)
const char *file;
{
char *dir;
char *base_versions;
int highest_backup;
size_t backup_suffix_size_max;
size_t file_len = strlen (file);
size_t numbered_suffix_size_max = INT_STRLEN_BOUND (int) + 4;
char *s;
const char *suffix = simple_backup_suffix;
if (backup_type == simple)
return concat (file, simple_backup_suffix);
base_versions = concat (basename (file), ".~");
if (base_versions == 0)
return 0;
dir = dirname (file);
if (dir == 0)
/* Allow room for simple or `.~N~' backups. */
backup_suffix_size_max = strlen (simple_backup_suffix) + 1;
if (HAVE_DIR && backup_suffix_size_max < numbered_suffix_size_max)
backup_suffix_size_max = numbered_suffix_size_max;
s = malloc (file_len + backup_suffix_size_max + numbered_suffix_size_max);
if (s)
{
free (base_versions);
return 0;
strcpy (s, file);
#if HAVE_DIR
if (backup_type != simple)
{
int highest_backup;
size_t dir_len = base_name (s) - s;
strcpy (s + dir_len, ".");
highest_backup = max_backup_version (file + dir_len, s);
if (! (backup_type == numbered_existing && highest_backup == 0))
{
char *numbered_suffix = s + (file_len + backup_suffix_size_max);
sprintf (numbered_suffix, ".~%d~", highest_backup + 1);
suffix = numbered_suffix;
}
strcpy (s, file);
}
#endif /* HAVE_DIR */
addext (s, suffix, '~');
}
highest_backup = max_backup_version (base_versions, dir);
free (base_versions);
free (dir);
if (backup_type == numbered_existing && highest_backup == 0)
return concat (file, simple_backup_suffix);
return make_version_name (file, highest_backup + 1);
return s;
}
#if HAVE_DIR
/* Return the number of the highest-numbered backup file for file
FILE in directory DIR. If there are no numbered backups
of FILE in DIR, or an error occurs reading DIR, return 0.
FILE should already have ".~" appended to it. */
*/
static int
max_backup_version (file, dir)
@@ -164,7 +182,7 @@ max_backup_version (file, dir)
while ((dp = readdir (dirp)) != 0)
{
if (!REAL_DIR_ENTRY (dp) || NLENGTH (dp) <= file_name_length)
if (!REAL_DIR_ENTRY (dp) || NLENGTH (dp) < file_name_length + 4)
continue;
this_version = version_number (file, dp->d_name, file_name_length);
@@ -176,62 +194,59 @@ max_backup_version (file, dir)
return highest_version;
}
/* Return a string, allocated with malloc, containing
"FILE.~VERSION~". Return 0 if out of memory. */
static char *
make_version_name (file, version)
const char *file;
int version;
{
char *backup_name;
backup_name = malloc (strlen (file) + 16);
if (backup_name == 0)
return 0;
sprintf (backup_name, "%s.~%d~", file, version);
return backup_name;
}
/* If BACKUP is a numbered backup of BASE, return its version number;
otherwise return 0. BASE_LENGTH is the length of BASE.
BASE should already have ".~" appended to it. */
*/
static int
version_number (base, backup, base_length)
const char *base;
const char *backup;
int base_length;
size_t base_length;
{
int version;
const char *p;
version = 0;
if (!strncmp (base, backup, base_length) && ISDIGIT (backup[base_length]))
if (strncmp (base, backup, base_length) == 0
&& backup[base_length] == '.'
&& backup[base_length + 1] == '~')
{
for (p = &backup[base_length]; ISDIGIT (*p); ++p)
for (p = &backup[base_length + 2]; ISDIGIT (*p); ++p)
version = version * 10 + *p - '0';
if (p[0] != '~' || p[1])
version = 0;
}
return version;
}
#endif /* HAVE_DIR */
/* Return the newly-allocated concatenation of STR1 and STR2.
If out of memory, return 0. */
static char *
concat (str1, str2)
const char *str1;
const char *str2;
static const char * const backup_args[] =
{
char *newstr;
int str1_length = strlen (str1);
"never", "simple", "nil", "existing", "t", "numbered", 0
};
newstr = malloc (str1_length + strlen (str2) + 1);
if (newstr == 0)
return 0;
strcpy (newstr, str1);
strcpy (newstr + str1_length, str2);
return newstr;
static const enum backup_type backup_types[] =
{
simple, simple, numbered_existing, numbered_existing, numbered, numbered
};
/* Return the type of backup indicated by VERSION.
Unique abbreviations are accepted. */
enum backup_type
get_version (version)
const char *version;
{
int i;
if (version == 0 || *version == 0)
return numbered_existing;
i = argmatch (version, backup_args);
if (i < 0)
{
invalid_arg ("version control type", version, i);
exit (2);
}
return backup_types[i];
}

View File

@@ -1,5 +1,5 @@
/* backupfile.h -- declarations for making Emacs style backup file names
Copyright (C) 1990 Free Software Foundation, Inc.
Copyright (C) 1990, 1991, 1992, 1997 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,8 +12,9 @@
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; see the file COPYING.
If not, write to the Free Software Foundation,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* When to make backup files. */
enum backup_type
@@ -33,10 +34,17 @@ enum backup_type
};
extern enum backup_type backup_type;
extern char *simple_backup_suffix;
extern char const *simple_backup_suffix;
#ifdef __STDC__
char *find_backup_file_name (const char *file);
#else
char *find_backup_file_name ();
#ifndef __BACKUPFILE_P
# if defined __STDC__ || __GNUC__
# define __BACKUPFILE_P(args) args
# else
# define __BACKUPFILE_P(args) ()
# endif
#endif
char *base_name __BACKUPFILE_P ((char const *));
char *find_backup_file_name __BACKUPFILE_P ((char const *));
enum backup_type get_version __BACKUPFILE_P ((char const *));
void addext __BACKUPFILE_P ((char *, char const *, int));

View File

@@ -1,38 +1,30 @@
/* basename.c -- return the last element in a path
Copyright (C) 1990 Free Software Foundation, Inc.
/* basename.c -- return the last element in a path */
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
#if HAVE_CONFIG_H
# include <config.h>
#endif
/* Return NAME with any leading path stripped off.
Don't use strrchr/rindex. */
#ifndef FILESYSTEM_PREFIX_LEN
# define FILESYSTEM_PREFIX_LEN(f) 0
#endif
#ifndef ISSLASH
# define ISSLASH(c) ((c) == '/')
#endif
/* In general, we can't use the builtin `basename' function if available,
since it has different meanings in different environments.
In some environments the builtin `basename' modifies its argument. */
char *
basename (name)
const char *name;
base_name (name)
char const *name;
{
const char *base = name;
char const *base = name += FILESYSTEM_PREFIX_LEN (name);
for (; *name; name++)
if (ISSLASH (*name))
base = name + 1;
while (*name)
{
if (*name == '/')
base = name + 1;
++name;
}
return (char *) base;
}

53
lib/chown.c Normal file
View File

@@ -0,0 +1,53 @@
/* provide consistent interface to chown for systems that don't interpret
an ID of -1 as meaning `don't change the corresponding ID'.
Copyright (C) 1997 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* written by Jim Meyering */
#include <config.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
/* FIXME: describe. */
int
chown (file, gid, uid)
const char *file;
gid_t git;
uid_t uit;
{
if (gid == (gid_t) -1 || uid == (uid_t) -1)
{
struct stat file_stats;
/* Stat file to get id(s) that should remain unchanged. */
if (stat (file, &file_stats))
return 1;
if (gid == (gid_t) -1)
gid = file_stats.st_gid;
if (uid == (uid_t) -1)
uid = file_stats.st_uid;
}
#undef chown
return chown (file, gid, uid);
}

View File

@@ -68,7 +68,7 @@ unsigned int error_message_count;
# define program_name program_invocation_name
# include <errno.h>
#else /* not _LIBC */
#else /* not _LIBC */
/* The calling program should define program_name and set it to the
name of the executing program. */
@@ -92,6 +92,7 @@ private_strerror (errnum)
}
# define strerror private_strerror
# endif /* HAVE_STRERROR */
#endif /* not _LIBC */
/* Print the program name and error message MESSAGE, which is a printf-style

View File

@@ -1,5 +1,5 @@
/* Convert file size to number of blocks on System V-like machines.
Copyright (C) 1990 Free Software Foundation, Inc.
Copyright (C) 1990, 1997 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,6 +25,10 @@
# include <sys/types.h>
# include <sys/param.h>
# if HAVE_UNISTD_H
# include <unistd.h>
# endif
# ifndef NINDIR
/* Some SysV's, like Irix, seem to lack these. Hope they're correct. */
/* Size of a indirect block, in bytes. */

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1993, 1997 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.
@@ -33,18 +33,6 @@
#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
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. */
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
# ifndef errno
extern int errno;
# endif
@@ -60,7 +48,7 @@ fnmatch (pattern, string, flags)
register const char *p = pattern, *n = string;
register char c;
/* Note that this evalutes C many times. */
/* Note that this evaluates C many times. */
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
while ((c = *p++) != '\0')
@@ -208,5 +196,3 @@ fnmatch (pattern, string, flags)
# undef FOLD
}
#endif /* _LIBC or not __GNU_LIBRARY__. */

View File

@@ -1,5 +1,5 @@
/* full-write.c -- an interface to write that retries after interrupts
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
Copyright (C) 1993, 1994, 1997 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
@@ -48,6 +48,10 @@ full_write (desc, ptr, len)
while (len > 0)
{
int written = write (desc, ptr, len);
/* FIXME: write on my slackware Linux 1.2.13 returns zero when
I try to write more data than there is room on a floppy disk.
This puts dd into an infinite loop. Reproduce with
dd if=/dev/zero of=/dev/fd0. */
if (written < 0)
{
#ifdef EINTR

View File

@@ -3,7 +3,7 @@
** Originally written by Steven M. Bellovin <smb@research.att.com> while
** at the University of North Carolina at Chapel Hill. Later tweaked by
** a couple of people on Usenet. Completely overhauled by Rich $alz
** <rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990;
** <rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990.
**
** This grammar has 13 shift/reduce conflicts.
**
@@ -347,7 +347,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelYear += $1 * $2;
}
| tYEAR_UNIT {
yyRelYear++;
yyRelYear += $1;
}
| tUNUMBER tMONTH_UNIT {
yyRelMonth += $1 * $2;
@@ -356,7 +356,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelMonth += $1 * $2;
}
| tMONTH_UNIT {
yyRelMonth++;
yyRelMonth += $1;
}
| tUNUMBER tDAY_UNIT {
yyRelDay += $1 * $2;
@@ -365,7 +365,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelDay += $1 * $2;
}
| tDAY_UNIT {
yyRelDay++;
yyRelDay += $1;
}
| tUNUMBER tHOUR_UNIT {
yyRelHour += $1 * $2;
@@ -374,7 +374,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelHour += $1 * $2;
}
| tHOUR_UNIT {
yyRelHour++;
yyRelHour += $1;
}
| tUNUMBER tMINUTE_UNIT {
yyRelMinutes += $1 * $2;
@@ -383,7 +383,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelMinutes += $1 * $2;
}
| tMINUTE_UNIT {
yyRelMinutes++;
yyRelMinutes += $1;
}
| tUNUMBER tSEC_UNIT {
yyRelSeconds += $1 * $2;
@@ -392,7 +392,7 @@ relunit : tUNUMBER tYEAR_UNIT {
yyRelSeconds += $1 * $2;
}
| tSEC_UNIT {
yyRelSeconds++;
yyRelSeconds += $1;
}
;
@@ -493,7 +493,7 @@ static TABLE const OtherTable[] = {
{ "now", tMINUTE_UNIT, 0 },
{ "last", tUNUMBER, -1 },
{ "this", tMINUTE_UNIT, 0 },
{ "next", tUNUMBER, 2 },
{ "next", tUNUMBER, 1 },
{ "first", tUNUMBER, 1 },
/* { "second", tUNUMBER, 2 }, */
{ "third", tUNUMBER, 3 },

View File

@@ -1,5 +1,5 @@
/* Get the system load averages.
Copyright (C) 1985, 86, 87, 88, 89, 91, 92, 93, 1994, 1995
Copyright (C) 1985, 86, 87, 88, 89, 91, 92, 93, 1994, 1995, 1997
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -51,7 +51,7 @@
DGUX
eunice UNIX emulator under VMS.
hpux
MSDOS No-op for MSDOS.
__MSDOS__ No-op for MSDOS.
NeXT
sgi
sequent Sequent Dynix 3.x.x (BSD)
@@ -60,7 +60,7 @@
UMAX
UMAX4_3
VMS
WIN32 No-op for Windows95/NT.
WINDOWS32 No-op for Windows95/NT.
__linux__ Linux: assumes /proc filesystem mounted.
Support from Michael K. Johnson.
__NetBSD__ NetBSD: assumes /kern filesystem mounted.
@@ -167,6 +167,9 @@ extern int errno;
# if defined (__osf__) && (defined (__alpha) || defined (__alpha__))
# define OSF_ALPHA
# include <sys/mbuf.h>
# include <sys/socket.h>
# include <net/route.h>
# include <sys/table.h>
# endif
@@ -278,7 +281,7 @@ extern int errno;
/* Sometimes both MIPS and sgi are defined, so FSCALE was just defined
above under #ifdef MIPS. But we want the sgi value. */
# undef FSCALE
# define FSCALE 1000.0
# define FSCALE 1000.0
# endif
# if defined (ardent) && defined (titan)
@@ -296,7 +299,7 @@ extern int errno;
# endif /* Not FSCALE. */
# if !defined (LDAV_CVT) && defined (FSCALE)
# define LDAV_CVT(n) (((double) (n)) / FSCALE)
# define LDAV_CVT(n) (((double) (n)) / FSCALE)
# endif
/* VAX C can't handle multi-line #ifs, or lines longer that 256 characters. */
@@ -444,6 +447,14 @@ extern int errno;
# endif /* LOAD_AVE_TYPE */
# if defined(__GNU__) && !defined (NeXT)
/* Note that NeXT Openstep defines __GNU__ even though it should not. */
/* GNU system acts much like NeXT, for load average purposes,
but not exactly. */
# define NeXT
# define host_self mach_host_self
# endif
# ifdef NeXT
# ifdef HAVE_MACH_MACH_H
# include <mach/mach.h>
@@ -543,7 +554,7 @@ getloadavg (loadavg, nelem)
elem = -1;
# endif
# if !defined (LDAV_DONE) && defined (SUNOS_5)
# if !defined (LDAV_DONE) && defined (HAVE_LIBKSTAT)
/* Use libkstat because we don't have to be root. */
# define LDAV_DONE
kstat_ctl_t *kc;
@@ -588,7 +599,7 @@ getloadavg (loadavg, nelem)
}
kstat_close (kc);
# endif /* SUNOS_5 */
# endif /* HAVE_LIBKSTAT */
# if !defined (LDAV_DONE) && defined (hpux) && defined (HAVE_PSTAT_GETDYNAMIC)
/* Use pstat_getdynamic() because we don't have to be root. */
@@ -826,7 +837,7 @@ getloadavg (loadavg, nelem)
: (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale));
# endif /* OSF_MIPS */
# if !defined (LDAV_DONE) && (defined (MSDOS) || defined (WIN32))
# if !defined (LDAV_DONE) && (defined (__MSDOS__) || defined (WINDOWS32))
# define LDAV_DONE
/* A faithful emulation is going to have to be saved for a rainy day. */
@@ -834,7 +845,7 @@ getloadavg (loadavg, nelem)
{
loadavg[elem] = 0.0;
}
# endif /* MSDOS */
# endif /* __MSDOS__ || WINDOWS32 */
# if !defined (LDAV_DONE) && defined (OSF_ALPHA)
# define LDAV_DONE

View File

@@ -4,25 +4,27 @@
before changing it!
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97
Free Software Foundation, Inc.
Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
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.
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.
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.
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.
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. */
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. */
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
@@ -253,26 +255,41 @@ 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;
/* Defined in getopt_init.c */
extern char *__getopt_nonoption_flags;
static int nonoption_flags_max_len;
static int nonoption_flags_len;
static int original_argc;
static char *const *original_argv;
extern pid_t __libc_pid;
/* Make sure the environment variable bash 2.0 puts in the environment
is valid for the getopt call we must make sure that the ARGV passed
to getopt is that one passed to the process. */
static void store_args (int argc, char *const *argv) __attribute__ ((unused));
static void
store_args (int argc, char *const *argv)
__attribute__ ((unused))
store_args_and_env (int argc, char *const *argv)
{
/* XXX This is no good solution. We should rather copy the args so
that we can compare them later. But we must not use malloc(3). */
original_argc = argc;
original_argv = argv;
}
text_set_element (__libc_subinit, store_args);
#endif
text_set_element (__libc_subinit, store_args_and_env);
# define SWAP_FLAGS(ch1, ch2) \
if (nonoption_flags_len > 0) \
{ \
char __tmp = __getopt_nonoption_flags[ch1]; \
__getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \
__getopt_nonoption_flags[ch2] = __tmp; \
}
#else /* !_LIBC */
# define SWAP_FLAGS(ch1, ch2)
#endif /* _LIBC */
/* Exchange two adjacent subsequences of ARGV.
One subsequence is elements [first_nonopt,last_nonopt)
@@ -301,6 +318,28 @@ exchange (argv)
It leaves the longer segment in the right place overall,
but it consists of two parts that need to be swapped next. */
#ifdef _LIBC
/* First make sure the handling of the `__getopt_nonoption_flags'
string can work normally. Our top argument must be in the range
of the string. */
if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)
{
/* We must extend the array. The user plays games with us and
presents new arguments. */
char *new_str = malloc (top + 1);
if (new_str == NULL)
nonoption_flags_len = nonoption_flags_max_len = 0;
else
{
memcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len);
memset (&new_str[nonoption_flags_max_len], '\0',
top + 1 - nonoption_flags_max_len);
nonoption_flags_max_len = top + 1;
__getopt_nonoption_flags = new_str;
}
}
#endif
while (top > middle && middle > bottom)
{
if (top - middle > middle - bottom)
@@ -315,6 +354,7 @@ exchange (argv)
tem = argv[bottom + i];
argv[bottom + i] = argv[top - (middle - bottom) + i];
argv[top - (middle - bottom) + i] = tem;
SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
}
/* Exclude the moved bottom segment from further swapping. */
top -= len;
@@ -331,6 +371,7 @@ exchange (argv)
tem = argv[bottom + i];
argv[bottom + i] = argv[middle + i];
argv[middle + i] = tem;
SWAP_FLAGS (bottom + i, middle + i);
}
/* Exclude the moved top segment from further swapping. */
bottom += len;
@@ -358,7 +399,7 @@ _getopt_initialize (argc, argv, optstring)
is the program name); the sequence of previously skipped
non-option ARGV-elements is empty. */
first_nonopt = last_nonopt = optind = 1;
first_nonopt = last_nonopt = optind;
nextchar = NULL;
@@ -385,17 +426,30 @@ _getopt_initialize (argc, argv, optstring)
if (posixly_correct == NULL
&& argc == original_argc && argv == original_argv)
{
/* 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);
if (nonoption_flags_max_len == 0)
{
if (__getopt_nonoption_flags == NULL
|| __getopt_nonoption_flags[0] == '\0')
nonoption_flags_max_len = -1;
else
{
const char *orig_str = __getopt_nonoption_flags;
int len = nonoption_flags_max_len = strlen (orig_str);
if (nonoption_flags_max_len < argc)
nonoption_flags_max_len = argc;
__getopt_nonoption_flags =
(char *) malloc (nonoption_flags_max_len);
if (__getopt_nonoption_flags == NULL)
nonoption_flags_max_len = -1;
else
{
memcpy (__getopt_nonoption_flags, orig_str, len);
memset (&__getopt_nonoption_flags[len], '\0',
nonoption_flags_max_len - len);
}
}
}
nonoption_flags_len = nonoption_flags_max_len;
}
else
nonoption_flags_len = 0;
@@ -471,10 +525,11 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
{
optarg = NULL;
if (!__getopt_initialized || optind == 0)
if (optind == 0 || !__getopt_initialized)
{
if (optind == 0)
optind = 1; /* Don't scan ARGV[0], the program name. */
optstring = _getopt_initialize (argc, argv, optstring);
optind = 1; /* Don't scan ARGV[0], the program name. */
__getopt_initialized = 1;
}
@@ -485,7 +540,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
#ifdef _LIBC
#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
|| (optind < nonoption_flags_len \
&& nonoption_flags[optind] == '1'))
&& __getopt_nonoption_flags[optind] == '1'))
#else
#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
#endif

View File

@@ -1,23 +1,25 @@
/* Declarations for getopt.
Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
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.
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.
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.
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.
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. */
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 _GETOPT_H
#define _GETOPT_H 1

View File

@@ -1,23 +1,25 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
This file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
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.
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.
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.
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.
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. */
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>

View File

@@ -1,5 +1,5 @@
/* idcache.c -- map user and group IDs, cached for speed
Copyright (C) 1985, 1988, 1989, 1990 Free Software Foundation, Inc.
Copyright (C) 1985, 1988, 1989, 1990, 1997 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,8 +15,8 @@
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 <stdio.h>
@@ -25,14 +25,15 @@
#include <grp.h>
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
#include <string.h>
# include <string.h>
#else
#include <strings.h>
# include <strings.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifndef _POSIX_VERSION
struct passwd *getpwuid ();
struct passwd *getpwnam ();
@@ -56,11 +57,14 @@ struct userid
static struct userid *user_alist;
#ifdef NOT_USED
/* The members of this list have names not in the local passwd file. */
static struct userid *nouser_alist;
#endif /* NOT_USED */
/* Translate UID to a login name or a stringified number,
with cache. */
/* Translate UID to a login name, with cache.
If UID cannot be resolved, return NULL.
Cache lookup failures, too. */
char *
getuser (uid)
@@ -68,7 +72,6 @@ getuser (uid)
{
register struct userid *tail;
struct passwd *pwent;
char usernum_string[20];
for (tail = user_alist; tail; tail = tail->next)
if (tail->id.u == uid)
@@ -77,13 +80,7 @@ getuser (uid)
pwent = getpwuid (uid);
tail = (struct userid *) xmalloc (sizeof (struct userid));
tail->id.u = uid;
if (pwent == 0)
{
sprintf (usernum_string, "%u", (unsigned) uid);
tail->name = xstrdup (usernum_string);
}
else
tail->name = xstrdup (pwent->pw_name);
tail->name = (pwent ? xstrdup (pwent->pw_name) : NULL);
/* Add to the head of the list, so most recently used is first. */
tail->next = user_alist;
@@ -91,6 +88,8 @@ getuser (uid)
return tail->name;
}
#ifdef NOT_USED
/* Translate USER to a UID, with cache.
Return NULL if there is no such user.
(We also cache which user names have no passwd entry,
@@ -98,7 +97,7 @@ getuser (uid)
uid_t *
getuidbyname (user)
char *user;
const char *user;
{
register struct userid *tail;
struct passwd *pwent;
@@ -132,6 +131,8 @@ getuidbyname (user)
return 0;
}
#endif /* NOT_USED */
/* Use the same struct as for userids. */
static struct userid *group_alist;
static struct userid *nogroup_alist;
@@ -145,7 +146,6 @@ getgroup (gid)
{
register struct userid *tail;
struct group *grent;
char groupnum_string[20];
for (tail = group_alist; tail; tail = tail->next)
if (tail->id.g == gid)
@@ -154,13 +154,7 @@ getgroup (gid)
grent = getgrgid (gid);
tail = (struct userid *) xmalloc (sizeof (struct userid));
tail->id.g = gid;
if (grent == 0)
{
sprintf (groupnum_string, "%u", (unsigned int) gid);
tail->name = xstrdup (groupnum_string);
}
else
tail->name = xstrdup (grent->gr_name);
tail->name = (grent ? xstrdup (grent->gr_name) : NULL);
/* Add to the head of the list, so most recently used is first. */
tail->next = group_alist;
@@ -168,14 +162,16 @@ getgroup (gid)
return tail->name;
}
/* Translate GROUP to a UID, with cache.
#ifdef NOT_USED
/* Translate GROUP to a GID, with cache.
Return NULL if there is no such group.
(We also cache which group names have no group entry,
so we don't keep looking them up.) */
gid_t *
getgidbyname (group)
char *group;
const char *group;
{
register struct userid *tail;
struct group *grent;
@@ -208,3 +204,5 @@ getgidbyname (group)
nogroup_alist = tail;
return 0;
}
#endif /* NOT_USED */

View File

@@ -53,7 +53,7 @@ parse_long_options (argc, argv, command_name, package, version, usage)
opterr = 0;
if (argc == 2
&& (c = getopt_long (argc, argv, "+", long_options, (int *) 0)) != EOF)
&& (c = getopt_long (argc, argv, "+", long_options, NULL)) != -1)
{
switch (c)
{

View File

@@ -1,5 +1,5 @@
/* makepath.c -- Ensure that a directory path exists.
Copyright (C) 1990 Free Software Foundation, Inc.
Copyright (C) 1990, 1997 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
# include <alloca.h>
# else
# ifdef _AIX
#pragma alloca
# pragma alloca
# else
char *alloca ();
# endif
@@ -76,9 +76,34 @@ typedef int uid_t;
typedef int gid_t;
#endif
#include "save-cwd.h"
#include "makepath.h"
#include "error.h"
void error ();
void strip_trailing_slashes ();
#define CLEANUP_CWD \
do \
{ \
/* We're done operating on basename_dir. \
Restore working directory. */ \
if (do_chdir) \
{ \
int fail = restore_cwd (&cwd, NULL, NULL); \
free_cwd (&cwd); \
if (fail) \
return 1; \
} \
} \
while (0)
#define CLEANUP \
do \
{ \
umask (oldmask); \
CLEANUP_CWD; \
} \
while (0)
/* Ensure that the directory ARGPATH exists.
Remove any trailing slashes from ARGPATH before calling this function.
@@ -120,17 +145,10 @@ make_path (argpath, mode, parent_mode, owner, group, preserve_existing,
const char *verbose_fmt_string;
#endif
{
char *dirpath; /* A copy we can scribble NULs on. */
struct stat stats;
int retval = 0;
int oldmask = umask (0);
/* FIXME: move this alloca and strcpy into the if-block.
Set dirpath to argpath in the else-block. */
dirpath = (char *) alloca (strlen (argpath) + 1);
strcpy (dirpath, argpath);
if (stat (dirpath, &stats))
if (stat (argpath, &stats))
{
char *slash;
int tmp_mode; /* Initial perms for leading dirs. */
@@ -141,6 +159,18 @@ make_path (argpath, mode, parent_mode, owner, group, preserve_existing,
struct ptr_list *next;
};
struct ptr_list *p, *leading_dirs = NULL;
int do_chdir; /* Whether to chdir before each mkdir. */
struct saved_cwd cwd;
char *basename_dir;
char *dirpath;
/* Temporarily relax umask in case it's overly restrictive. */
int oldmask = umask (0);
/* Make a copy of ARGPATH that we can scribble NULs on. */
dirpath = (char *) alloca (strlen (argpath) + 1);
strcpy (dirpath, argpath);
strip_trailing_slashes (dirpath);
/* If leading directories shouldn't be writable or executable,
or should have set[ug]id or sticky bits set and we are setting
@@ -158,49 +188,89 @@ make_path (argpath, mode, parent_mode, owner, group, preserve_existing,
re_protect = 0;
}
/* If we can record the current working directory, we may be able
to do the chdir optimization. */
do_chdir = !save_cwd (&cwd);
/* If we've saved the cwd and DIRPATH is an absolute pathname,
we must chdir to `/' in order to enable the chdir optimization.
So if chdir ("/") fails, turn off the optimization. */
if (do_chdir && *dirpath == '/' && chdir ("/") < 0)
do_chdir = 0;
slash = dirpath;
/* Skip over leading slashes. */
while (*slash == '/')
slash++;
while ((slash = strchr (slash, '/')))
while (1)
{
/* slash points to the leftmost unprocessed component of dirpath. */
basename_dir = slash;
slash = strchr (slash, '/');
if (slash == NULL)
break;
/* If we're *not* doing chdir before each mkdir, then we have to refer
to the target using the full (multi-component) directory name. */
if (!do_chdir)
basename_dir = dirpath;
*slash = '\0';
if (stat (dirpath, &stats))
if (mkdir (basename_dir, tmp_mode))
{
if (mkdir (dirpath, tmp_mode))
if (stat (basename_dir, &stats))
{
error (0, errno, "cannot create directory `%s'", dirpath);
umask (oldmask);
CLEANUP;
return 1;
}
else if (!S_ISDIR (stats.st_mode))
{
error (0, 0, "`%s' exists but is not a directory", dirpath);
CLEANUP;
return 1;
}
else
{
if (verbose_fmt_string != NULL)
error (0, 0, verbose_fmt_string, dirpath);
if (owner != (uid_t) -1 && group != (gid_t) -1
&& chown (dirpath, owner, group)
#if defined(AFS) && defined (EPERM)
&& errno != EPERM
#endif
)
{
error (0, errno, "%s", dirpath);
retval = 1;
}
if (re_protect)
{
struct ptr_list *new = (struct ptr_list *)
alloca (sizeof (struct ptr_list));
new->dirname_end = slash;
new->next = leading_dirs;
leading_dirs = new;
}
/* DIRPATH already exists and is a directory. */
}
}
else if (!S_ISDIR (stats.st_mode))
if (verbose_fmt_string != NULL)
error (0, 0, verbose_fmt_string, dirpath);
if (owner != (uid_t) -1 && group != (gid_t) -1
&& chown (basename_dir, owner, group)
#if defined(AFS) && defined (EPERM)
&& errno != EPERM
#endif
)
{
error (0, 0, "`%s' exists but is not a directory", dirpath);
umask (oldmask);
error (0, errno, "%s", dirpath);
CLEANUP;
return 1;
}
if (re_protect)
{
struct ptr_list *new = (struct ptr_list *)
alloca (sizeof (struct ptr_list));
new->dirname_end = slash;
new->next = leading_dirs;
leading_dirs = new;
}
/* If we were able to save the initial working directory,
then we can use chdir to change into each directory before
creating an entry in that directory. This avoids making
stat and mkdir process O(n^2) file name components. */
if (do_chdir && chdir (basename_dir) < 0)
{
error (0, errno, "cannot chdir to directory, %s", dirpath);
CLEANUP;
return 1;
}
@@ -212,40 +282,49 @@ make_path (argpath, mode, parent_mode, owner, group, preserve_existing,
slash++;
}
if (!do_chdir)
basename_dir = dirpath;
/* We're done making leading directories.
Create the final component of the path. */
/* The path could end in "/." or contain "/..", so test
if we really have to create the directory. */
if (stat (dirpath, &stats) && mkdir (dirpath, mode))
if (stat (basename_dir, &stats) && mkdir (basename_dir, mode))
{
error (0, errno, "cannot create directory `%s'", dirpath);
umask (oldmask);
CLEANUP;
return 1;
}
/* Done creating directories. Restore original umask. */
umask (oldmask);
if (verbose_fmt_string != NULL)
error (0, 0, verbose_fmt_string, dirpath);
if (owner != (uid_t) -1 && group != (gid_t) -1)
{
if (chown (dirpath, owner, group)
if (chown (basename_dir, owner, group)
#ifdef AFS
&& errno != EPERM
#endif
)
{
error (0, errno, "%s", dirpath);
error (0, errno, "cannot chown %s", dirpath);
retval = 1;
}
/* chown may have turned off some permission bits we wanted. */
if ((mode & 07000) != 0 && chmod (dirpath, mode))
if ((mode & 07000) != 0 && chmod (basename_dir, mode))
{
error (0, errno, "%s", dirpath);
error (0, errno, "cannot chmod %s", dirpath);
retval = 1;
}
}
CLEANUP_CWD;
/* If the mode for leading directories didn't include owner "wx"
privileges, we have to reset their protections to the correct
value. */
@@ -263,10 +342,11 @@ make_path (argpath, mode, parent_mode, owner, group, preserve_existing,
{
/* We get here if the entire path already exists. */
const char *dirpath = argpath;
if (!S_ISDIR (stats.st_mode))
{
error (0, 0, "`%s' exists but is not a directory", dirpath);
umask (oldmask);
return 1;
}
@@ -296,6 +376,5 @@ make_path (argpath, mode, parent_mode, owner, group, preserve_existing,
}
}
umask (oldmask);
return retval;
}

View File

@@ -1,5 +1,5 @@
/* Copyright (C) 1991, 1993 Free Software Foundation, Inc.
Based on strlen implemention by Torbjorn Granlund (tege@sics.se),
/* Copyright (C) 1991, 1993, 1997 Free Software Foundation, Inc.
Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
with help from Dan Sahlin (dan@sics.se) and
commentary by Jim Blandy (jimb@ai.mit.edu);
adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),

View File

@@ -369,5 +369,3 @@ memcmp (s1, s2, len)
#undef bcmp
weak_alias (memcmp, bcmp)
#endif

View File

@@ -1,11 +1,29 @@
/* Copy LEN bytes starting at SRCADDR to DESTADDR. Result undefined
if the source overlaps with the destination.
Return DESTADDR. */
/* Copyright (C) 1995, 1997 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>. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
/* Copy LEN bytes starting at SRCADDR to DESTADDR. Result undefined
if the source overlaps with the destination.
Return DESTADDR. */
char *
memcpy (destaddr, srcaddr, len)
char *destaddr;

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
Contributed by Paul Eggert (eggert@twinsun.com).
NOTE: The canonical source of this file is maintained with the GNU C
@@ -26,6 +26,12 @@
#include <config.h>
#endif
#ifdef _LIBC
# define HAVE_LIMITS_H 1
# define HAVE_LOCALTIME_R 1
# define STDC_HEADERS 1
#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. */
@@ -36,13 +42,13 @@
#include <sys/types.h> /* Some systems define `time_t' here. */
#include <time.h>
#if __STDC__ || __GNU_LIBRARY__ || STDC_HEADERS
#if HAVE_LIMITS_H
#include <limits.h>
#endif
#if DEBUG
#include <stdio.h>
#if __STDC__ || __GNU_LIBRARY__ || STDC_HEADERS
#if STDC_HEADERS
#include <stdlib.h>
#endif
/* Make it work even if the system's libc has its own mktime routine. */
@@ -69,8 +75,10 @@
#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))
/* The outer cast to time_t works around a bug in Cray C 5.0.3.0. */
#define TIME_T_MIN ((time_t) \
(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)
@@ -101,10 +109,10 @@ time_t __mktime_internal __P ((struct tm *,
time_t *));
#if ! HAVE_LOCALTIME_R && ! defined (localtime_r)
#ifdef _LIBC
#define localtime_r __localtime_r
#else
#if ! HAVE_LOCALTIME_R && ! defined (localtime_r)
/* 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 *));
@@ -119,8 +127,8 @@ localtime_r (t, tp)
*tp = *l;
return tp;
}
#endif /* ! _LIBC */
#endif /* ! HAVE_LOCALTIME_R && ! defined (localtime_r) */
#endif /* ! _LIBC */
/* Yield the difference between (YEAR-YDAY HOUR:MIN:SEC) and (*TP),
@@ -133,11 +141,19 @@ 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;
/* Compute intervening leap days correctly even if year is negative.
Take care to avoid int overflow. time_t overflow is OK, since
only the low order bits of the correct time_t answer are needed.
Don't convert to time_t until after all divisions are done, since
time_t might be unsigned. */
int a4 = (year >> 2) + (TM_YEAR_BASE >> 2) - ! (year & 3);
int b4 = (tp->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (tp->tm_year & 3);
int a100 = a4 / 25 - (a4 % 25 < 0);
int b100 = b4 / 25 - (b4 % 25 < 0);
int a400 = a100 >> 2;
int b400 = b100 >> 2;
int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400);
time_t years = year - (time_t) tp->tm_year;
time_t days = (365 * years + intervening_leap_days
+ (yday - tp->tm_yday));
return (60 * (60 * (24 * days + (hour - tp->tm_hour))
@@ -146,12 +162,20 @@ ydhms_tm_diff (year, yday, hour, min, sec, tp)
}
static time_t localtime_offset;
/* Convert *TP to a time_t value. */
time_t
mktime (tp)
struct tm *tp;
{
static time_t localtime_offset;
#ifdef _LIBC
/* POSIX.1 8.1.1 requires that whenever mktime() is called, the
time zone names contained in the external variable `tzname' shall
be set as if the tzset() function had been called. */
__tzset ();
#endif
return __mktime_internal (tp, localtime_r, &localtime_offset);
}

View File

@@ -1,5 +1,5 @@
/* modechange.c -- file mode manipulation
Copyright (C) 1989, 1990 Free Software Foundation, Inc.
Copyright (C) 1989, 1990, 1997 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
@@ -236,6 +236,33 @@ invalid:
return MODE_INVALID;
}
/* Return a file mode change operation that sets permissions to match those
of REF_FILE. Return MODE_BAD_REFERENCE if REF_FILE can't be accessed. */
struct mode_change *
mode_create_from_ref (ref_file)
const char *ref_file;
{
struct mode_change *change; /* the only change element */
struct stat ref_stats;
if (stat (ref_file, &ref_stats))
return MODE_BAD_REFERENCE;
change = talloc (struct mode_change);
if (change == NULL)
return MODE_MEMORY_EXHAUSTED;
change->op = '=';
change->flags = 0;
change->affected = 07777;
change->value = ref_stats.st_mode;
change->next = NULL;
return change;
}
/* Return file mode OLDMODE, adjusted as indicated by the list of change
operations CHANGES. If OLDMODE is a directory, the type `X'
change affects it even if no execute bits were set in OLDMODE.

View File

@@ -1,5 +1,5 @@
/* modechange.h -- definitions for file mode manipulation
Copyright (C) 1989, 1990 Free Software Foundation, Inc.
Copyright (C) 1989, 1990, 1997 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -39,10 +39,12 @@ struct mode_change
#define MODE_MASK_EQUALS 1
#define MODE_MASK_PLUS 2
#define MODE_MASK_MINUS 4
#define MODE_MASK_ALL (MODE_MASK_EQUALS | MODE_MASK_PLUS | MODE_MASK_MINUS)
/* Error return values for mode_compile. */
#define MODE_INVALID (struct mode_change *) 0
#define MODE_MEMORY_EXHAUSTED (struct mode_change *) 1
#define MODE_BAD_REFERENCE (struct mode_change *) 2
#ifndef __P
# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
@@ -53,5 +55,6 @@ struct mode_change
#endif
struct mode_change *mode_compile __P ((const char *, unsigned));
struct mode_change *mode_create_from_ref __P ((const char *));
unsigned short mode_adjust __P ((unsigned, const struct mode_change *));
void mode_free __P ((struct mode_change *));

View File

@@ -1,5 +1,5 @@
/* mountlist.c -- return a list of mounted filesystems
Copyright (C) 1991, 1992 Free Software Foundation, Inc.
Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
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>
@@ -24,14 +24,14 @@
#include "mountlist.h"
#ifdef STDC_HEADERS
#include <stdlib.h>
# include <stdlib.h>
#else
void free ();
#endif
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
#include <string.h>
# include <string.h>
#else
#include <strings.h>
# include <strings.h>
#endif
char *strstr ();
@@ -41,62 +41,73 @@ char *xstrdup ();
void error ();
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
# include <sys/param.h>
#endif
#if defined (MOUNTED_GETFSSTAT) /* __alpha running OSF_1 */
# include <sys/mount.h>
# include <sys/fs_types.h>
# include <sys/mount.h>
# include <sys/fs_types.h>
#endif /* MOUNTED_GETFSSTAT */
#ifdef MOUNTED_GETMNTENT1 /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */
#include <mntent.h>
#if !defined(MOUNTED)
# include <mntent.h>
# if !defined(MOUNTED)
# if defined(MNT_MNTTAB) /* HP-UX. */
# define MOUNTED MNT_MNTTAB
# define MOUNTED MNT_MNTTAB
# endif
# if defined(MNTTABNAME) /* Dynix. */
# define MOUNTED MNTTABNAME
# define MOUNTED MNTTABNAME
# endif
#endif
# endif
#endif
#ifdef MOUNTED_GETMNTINFO /* 4.4BSD. */
#include <sys/mount.h>
# include <sys/mount.h>
#endif
#ifdef MOUNTED_GETMNT /* Ultrix. */
#include <sys/mount.h>
#include <sys/fs_types.h>
# include <sys/mount.h>
# include <sys/fs_types.h>
#endif
#ifdef MOUNTED_FREAD /* SVR2. */
#include <mnttab.h>
# include <mnttab.h>
#endif
#ifdef MOUNTED_FREAD_FSTYP /* SVR3. */
#include <mnttab.h>
#include <sys/fstyp.h>
#include <sys/statfs.h>
# include <mnttab.h>
# include <sys/fstyp.h>
# include <sys/statfs.h>
#endif
#ifdef MOUNTED_LISTMNTENT
#include <mntent.h>
# include <mntent.h>
#endif
#ifdef MOUNTED_GETMNTENT2 /* SVR4. */
#include <sys/mnttab.h>
# include <sys/mnttab.h>
#endif
#ifdef MOUNTED_VMOUNT /* AIX. */
#include <fshelp.h>
#include <sys/vfs.h>
# include <fshelp.h>
# include <sys/vfs.h>
#endif
#ifdef DOLPHIN
/* So special that it's not worth putting this in autoconf. */
#undef MOUNTED_FREAD_FSTYP
#define MOUNTED_GETMNTTBL
# undef MOUNTED_FREAD_FSTYP
# define MOUNTED_GETMNTTBL
#endif
#ifdef HAVE_SYS_MNTENT_H
/* This is to get MNTOPT_IGNORE on e.g. SVR4. */
# include <sys/mntent.h>
#endif
#if defined (MNTOPT_IGNORE) && defined (HAVE_HASMNTOPT)
# define MNT_IGNORE(M) hasmntopt ((M), MNTOPT_IGNORE)
#else
# define MNT_IGNORE(M) 0
#endif
#ifdef MOUNTED_GETMNTENT1 /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */
@@ -127,97 +138,97 @@ xatoi (cp)
}
#endif /* MOUNTED_GETMNTENT1. */
#if defined (MOUNTED_GETMNTINFO) && !defined (__NetBSD__)
#if defined (MOUNTED_GETMNTINFO) && !defined (__NetBSD__) && !defined (__OpenBSD__)
static char *
fstype_to_string (t)
short t;
{
switch (t)
{
#ifdef MOUNT_PC
# ifdef MOUNT_PC
case MOUNT_PC:
return "pc";
#endif
#ifdef MOUNT_MFS
# endif
# ifdef MOUNT_MFS
case MOUNT_MFS:
return "mfs";
#endif
#ifdef MOUNT_LO
# endif
# ifdef MOUNT_LO
case MOUNT_LO:
return "lo";
#endif
#ifdef MOUNT_TFS
# endif
# ifdef MOUNT_TFS
case MOUNT_TFS:
return "tfs";
#endif
#ifdef MOUNT_TMP
# endif
# ifdef MOUNT_TMP
case MOUNT_TMP:
return "tmp";
#endif
#ifdef MOUNT_UFS
# endif
# ifdef MOUNT_UFS
case MOUNT_UFS:
return "ufs" ;
#endif
#ifdef MOUNT_NFS
# endif
# ifdef MOUNT_NFS
case MOUNT_NFS:
return "nfs" ;
#endif
#ifdef MOUNT_MSDOS
# endif
# ifdef MOUNT_MSDOS
case MOUNT_MSDOS:
return "msdos" ;
#endif
#ifdef MOUNT_LFS
# endif
# ifdef MOUNT_LFS
case MOUNT_LFS:
return "lfs" ;
#endif
#ifdef MOUNT_LOFS
# endif
# ifdef MOUNT_LOFS
case MOUNT_LOFS:
return "lofs" ;
#endif
#ifdef MOUNT_FDESC
# endif
# ifdef MOUNT_FDESC
case MOUNT_FDESC:
return "fdesc" ;
#endif
#ifdef MOUNT_PORTAL
# endif
# ifdef MOUNT_PORTAL
case MOUNT_PORTAL:
return "portal" ;
#endif
#ifdef MOUNT_NULL
# endif
# ifdef MOUNT_NULL
case MOUNT_NULL:
return "null" ;
#endif
#ifdef MOUNT_UMAP
# endif
# ifdef MOUNT_UMAP
case MOUNT_UMAP:
return "umap" ;
#endif
#ifdef MOUNT_KERNFS
# endif
# ifdef MOUNT_KERNFS
case MOUNT_KERNFS:
return "kernfs" ;
#endif
#ifdef MOUNT_PROCFS
# endif
# ifdef MOUNT_PROCFS
case MOUNT_PROCFS:
return "procfs" ;
#endif
#ifdef MOUNT_AFS
# endif
# ifdef MOUNT_AFS
case MOUNT_AFS:
return "afs" ;
#endif
#ifdef MOUNT_CD9660
# endif
# ifdef MOUNT_CD9660
case MOUNT_CD9660:
return "cd9660" ;
#endif
#ifdef MOUNT_UNION
# endif
# ifdef MOUNT_UNION
case MOUNT_UNION:
return "union" ;
#endif
#ifdef MOUNT_DEVFS
# endif
# ifdef MOUNT_DEVFS
case MOUNT_DEVFS:
return "devfs" ;
#endif
#ifdef MOUNT_EXT2FS
# endif
# ifdef MOUNT_EXT2FS
case MOUNT_EXT2FS:
return "ext2fs" ;
#endif
# endif
default:
return "?";
}
@@ -345,11 +356,11 @@ read_filesystem_list (need_fs_type, all_fs)
me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
me->me_devname = xstrdup (fsp->f_mntfromname);
me->me_mountdir = xstrdup (fsp->f_mntonname);
#ifdef __NetBSD__
# if defined (__NetBSD__) || defined (__OpenBSD__)
me->me_type = xstrdup (fsp->f_fstypename);
#else
# else
me->me_type = fstype_to_string (fsp->f_type);
#endif
# endif
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
me->me_next = NULL;
@@ -436,17 +447,17 @@ read_filesystem_list (need_fs_type, all_fs)
while (fread (&mnt, sizeof mnt, 1, fp) > 0)
{
me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
#ifdef GETFSTYP /* SVR3. */
# ifdef GETFSTYP /* SVR3. */
me->me_devname = xstrdup (mnt.mt_dev);
#else
# else
me->me_devname = xmalloc (strlen (mnt.mt_dev) + 6);
strcpy (me->me_devname, "/dev/");
strcpy (me->me_devname + 5, mnt.mt_dev);
#endif
# endif
me->me_mountdir = xstrdup (mnt.mt_filsys);
me->me_dev = (dev_t) -1; /* Magic; means not known yet. */
me->me_type = "";
#ifdef GETFSTYP /* SVR3. */
# ifdef GETFSTYP /* SVR3. */
if (need_fs_type)
{
struct statfs fsd;
@@ -456,7 +467,7 @@ read_filesystem_list (need_fs_type, all_fs)
&& sysfs (GETFSTYP, fsd.f_fstyp, typebuf) != -1)
me->me_type = xstrdup (typebuf);
}
#endif
# endif
me->me_next = NULL;
/* Add to the linked list. */
@@ -502,6 +513,10 @@ read_filesystem_list (need_fs_type, all_fs)
while ((ret = getmntent (fp, &mnt)) == 0)
{
/* Don't show automounted filesystems twice on e.g., Solaris. */
if (!all_fs && MNT_IGNORE (&mnt))
continue;
me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
me->me_devname = xstrdup (mnt.mnt_special);
me->me_mountdir = xstrdup (mnt.mnt_mountp);

View File

@@ -1,19 +1,23 @@
/* obstack.c - subroutines used implicitly by object stack macros
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 file is part of the GNU C Library. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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.
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. */
#include "obstack.h"
@@ -52,7 +56,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Determine default alignment. */
struct fooalign {char x; double d;};
#define DEFAULT_ALIGNMENT \
((PTR_INT_TYPE) ((char *)&((struct fooalign *) 0)->d - (char *)0))
((PTR_INT_TYPE) ((char *) &((struct fooalign *) 0)->d - (char *) 0))
/* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT.
But in fact it might be less smart and round addresses to as much as
DEFAULT_ROUNDING. So we prepare for it to do that. */
@@ -67,6 +71,28 @@ union fooround {long x; double d;};
#define COPYING_UNIT int
#endif
/* The functions allocating more room by calling `obstack_chunk_alloc'
jump to the handler pointed to by `obstack_alloc_failed_handler'.
This variable by default points to the internal function
`print_and_abort'. */
#if defined (__STDC__) && __STDC__
static void print_and_abort (void);
void (*obstack_alloc_failed_handler) (void) = print_and_abort;
#else
static void print_and_abort ();
void (*obstack_alloc_failed_handler) () = print_and_abort;
#endif
/* Exit value used when `print_and_abort' is used. */
#if defined (__STDC__) && __STDC__
#include <stdlib.h>
#endif
#ifndef EXIT_FAILURE
#define EXIT_FAILURE 1
#endif
int obstack_exit_failure = EXIT_FAILURE;
/* The non-GNU-C macros copy the obstack into this global variable
to avoid multiple evaluation. */
@@ -78,6 +104,20 @@ struct obstack *_obstack;
For free, do not use ?:, since some compilers, like the MIPS compilers,
do not allow (expr) ? void : void. */
#if defined (__STDC__) && __STDC__
#define CALL_CHUNKFUN(h, size) \
(((h) -> use_extra_arg) \
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
: (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size)))
#define CALL_FREEFUN(h, old_chunk) \
do { \
if ((h) -> use_extra_arg) \
(*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
else \
(*(void (*) (void *)) (h)->freefun) ((old_chunk)); \
} while (0)
#else
#define CALL_CHUNKFUN(h, size) \
(((h) -> use_extra_arg) \
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
@@ -90,6 +130,7 @@ struct obstack *_obstack;
else \
(*(void (*) ()) (h)->freefun) ((old_chunk)); \
} while (0)
#endif
/* Initialize an obstack H for use. Specify chunk size SIZE (0 means default).
@@ -106,10 +147,15 @@ _obstack_begin (h, size, alignment, chunkfun, freefun)
struct obstack *h;
int size;
int alignment;
#if defined (__STDC__) && __STDC__
POINTER (*chunkfun) (long);
void (*freefun) (void *);
#else
POINTER (*chunkfun) ();
void (*freefun) ();
#endif
{
register struct _obstack_chunk* chunk; /* points to new chunk */
register struct _obstack_chunk *chunk; /* points to new chunk */
if (alignment == 0)
alignment = DEFAULT_ALIGNMENT;
@@ -130,25 +176,27 @@ _obstack_begin (h, size, alignment, chunkfun, freefun)
size = 4096 - extra;
}
#if defined (__STDC__) && __STDC__
h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun;
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
#else
h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
h->freefun = freefun;
#endif
h->chunk_size = size;
h->alignment_mask = alignment - 1;
h->use_extra_arg = 0;
chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
if (!chunk)
{
h->alloc_failed = 1;
return 0;
}
h->alloc_failed = 0;
(*obstack_alloc_failed_handler) ();
h->next_free = h->object_base = chunk->contents;
h->chunk_limit = chunk->limit
= (char *) chunk + h->chunk_size;
chunk->prev = 0;
/* The initial chunk now contains no empty object. */
h->maybe_empty_object = 0;
h->alloc_failed = 0;
return 1;
}
@@ -157,11 +205,16 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
struct obstack *h;
int size;
int alignment;
#if defined (__STDC__) && __STDC__
POINTER (*chunkfun) (POINTER, long);
void (*freefun) (POINTER, POINTER);
#else
POINTER (*chunkfun) ();
void (*freefun) ();
#endif
POINTER arg;
{
register struct _obstack_chunk* chunk; /* points to new chunk */
register struct _obstack_chunk *chunk; /* points to new chunk */
if (alignment == 0)
alignment = DEFAULT_ALIGNMENT;
@@ -182,8 +235,13 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
size = 4096 - extra;
}
#if defined(__STDC__) && __STDC__
h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun;
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
#else
h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
h->freefun = freefun;
#endif
h->chunk_size = size;
h->alignment_mask = alignment - 1;
h->extra_arg = arg;
@@ -191,17 +249,14 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
if (!chunk)
{
h->alloc_failed = 1;
return 0;
}
h->alloc_failed = 0;
(*obstack_alloc_failed_handler) ();
h->next_free = h->object_base = chunk->contents;
h->chunk_limit = chunk->limit
= (char *) chunk + h->chunk_size;
chunk->prev = 0;
/* The initial chunk now contains no empty object. */
h->maybe_empty_object = 0;
h->alloc_failed = 0;
return 1;
}
@@ -216,8 +271,8 @@ _obstack_newchunk (h, length)
struct obstack *h;
int length;
{
register struct _obstack_chunk* old_chunk = h->chunk;
register struct _obstack_chunk* new_chunk;
register struct _obstack_chunk *old_chunk = h->chunk;
register struct _obstack_chunk *new_chunk;
register long new_size;
register int obj_size = h->next_free - h->object_base;
register int i;
@@ -231,11 +286,7 @@ _obstack_newchunk (h, length)
/* Allocate and initialize the new chunk. */
new_chunk = CALL_CHUNKFUN (h, new_size);
if (!new_chunk)
{
h->alloc_failed = 1;
return;
}
h->alloc_failed = 0;
(*obstack_alloc_failed_handler) ();
h->chunk = new_chunk;
new_chunk->prev = old_chunk;
new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size;
@@ -290,14 +341,14 @@ _obstack_allocated_p (h, obj)
struct obstack *h;
POINTER obj;
{
register struct _obstack_chunk* lp; /* below addr of any objects in this chunk */
register struct _obstack_chunk* plp; /* point to previous chunk if any */
register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
register struct _obstack_chunk *plp; /* point to previous chunk if any */
lp = (h)->chunk;
/* We use >= rather than > since the object cannot be exactly at
the beginning of the chunk but might be an empty object exactly
at the end of an adjacent chunk. */
while (lp != 0 && ((POINTER)lp >= obj || (POINTER)(lp)->limit < obj))
at the end of an adjacent chunk. */
while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj))
{
plp = lp->prev;
lp = plp;
@@ -318,14 +369,14 @@ _obstack_free (h, obj)
struct obstack *h;
POINTER obj;
{
register struct _obstack_chunk* lp; /* below addr of any objects in this chunk */
register struct _obstack_chunk* plp; /* point to previous chunk if any */
register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
register struct _obstack_chunk *plp; /* point to previous chunk if any */
lp = h->chunk;
/* We use >= because there cannot be an object at the beginning of a chunk.
But there can be an empty object at that address
at the end of another chunk. */
while (lp != 0 && ((POINTER)lp >= obj || (POINTER)(lp)->limit < obj))
while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj))
{
plp = lp->prev;
CALL_FREEFUN (h, lp);
@@ -336,7 +387,7 @@ _obstack_free (h, obj)
}
if (lp)
{
h->object_base = h->next_free = (char *)(obj);
h->object_base = h->next_free = (char *) (obj);
h->chunk_limit = lp->limit;
h->chunk = lp;
}
@@ -352,14 +403,14 @@ obstack_free (h, obj)
struct obstack *h;
POINTER obj;
{
register struct _obstack_chunk* lp; /* below addr of any objects in this chunk */
register struct _obstack_chunk* plp; /* point to previous chunk if any */
register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
register struct _obstack_chunk *plp; /* point to previous chunk if any */
lp = h->chunk;
/* We use >= because there cannot be an object at the beginning of a chunk.
But there can be an empty object at that address
at the end of another chunk. */
while (lp != 0 && ((POINTER)lp >= obj || (POINTER)(lp)->limit < obj))
while (lp != 0 && ((POINTER) lp >= obj || (POINTER) (lp)->limit < obj))
{
plp = lp->prev;
CALL_FREEFUN (h, lp);
@@ -370,7 +421,7 @@ obstack_free (h, obj)
}
if (lp)
{
h->object_base = h->next_free = (char *)(obj);
h->object_base = h->next_free = (char *) (obj);
h->chunk_limit = lp->limit;
h->chunk = lp;
}
@@ -379,6 +430,39 @@ obstack_free (h, obj)
abort ();
}
int
_obstack_memory_used (h)
struct obstack *h;
{
register struct _obstack_chunk* lp;
register int nbytes = 0;
for (lp = h->chunk; lp != 0; lp = lp->prev)
{
nbytes += lp->limit - (char *) lp;
}
return nbytes;
}
/* Define the error handler. */
#ifndef _
# ifdef HAVE_LIBINTL_H
# include <libintl.h>
# ifndef _
# define _(Str) gettext (Str)
# endif
# else
# define _(Str) (Str)
# endif
#endif
static void
print_and_abort ()
{
fputs (_("memory exhausted\n"), stderr);
exit (obstack_exit_failure);
}
#if 0
/* These are now turned off because the applications do not use it
and it uses bcopy via obstack_grow, which causes trouble on sysV. */
@@ -417,6 +501,13 @@ int (obstack_room) (obstack)
return obstack_room (obstack);
}
int (obstack_make_room) (obstack, length)
struct obstack *obstack;
int length;
{
return obstack_make_room (obstack, length);
}
void (obstack_grow) (obstack, pointer, length)
struct obstack *obstack;
POINTER pointer;

View File

@@ -1,19 +1,23 @@
/* obstack.h - object stack macros
Copyright (C) 1988,89,90,91,92,93,94,96 Free Software Foundation, Inc.
Copyright (C) 1988,89,90,91,92,93,94,96,97 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. Its master source is NOT part of
the C library, however. The master source lives in /gd/gnu/lib.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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.
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. */
/* Summary:
@@ -102,26 +106,17 @@ 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
/* 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. */
#ifndef __PTR_TO_INT
#define __PTR_TO_INT(P) ((P) - (char *)0)
#define __PTR_TO_INT(P) ((P) - (char *) 0)
#endif
#ifndef __INT_TO_PTR
#define __INT_TO_PTR(P) ((P) + (char *)0)
#define __INT_TO_PTR(P) ((P) + (char *) 0)
#endif
/* We need the type of the resulting object. In ANSI C it is ptrdiff_t
@@ -141,18 +136,23 @@ 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 defined (_LIBC) || defined (HAVE_STRING_H)
#include <string.h>
#define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
#else
#ifdef memcpy
#define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
#else
#define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N))
#endif
#endif
struct _obstack_chunk /* Lives at front of each chunk. */
{
char *limit; /* 1 past end of this chunk */
@@ -163,7 +163,7 @@ struct _obstack_chunk /* Lives at front of each chunk. */
struct obstack /* control current object in current chunk */
{
long chunk_size; /* preferred size to allocate chunks in */
struct _obstack_chunk* chunk; /* address of current struct obstack_chunk */
struct _obstack_chunk *chunk; /* address of current struct obstack_chunk */
char *object_base; /* address of object we are building */
char *next_free; /* where to add next char to current object */
char *chunk_limit; /* address of char after current chunk */
@@ -175,7 +175,7 @@ struct obstack /* control current object in current chunk */
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 */
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. */
@@ -186,7 +186,9 @@ struct obstack /* control current object in current chunk */
chunk contains a zero-length object. This
prevents freeing the chunk if we allocate
a bigger chunk to replace it. */
unsigned alloc_failed:1; /* chunk alloc func returned 0 */
unsigned alloc_failed:1; /* No longer used, as we now call the failed
handler on error, but retained for binary
compatibility. */
};
/* Declare the external functions we use; they are in obstack.c. */
@@ -199,11 +201,13 @@ extern int _obstack_begin (struct obstack *, int, int,
extern int _obstack_begin_1 (struct obstack *, int, int,
void *(*) (void *, long),
void (*) (void *, void *), void *);
extern int _obstack_memory_used (struct obstack *);
#else
extern void _obstack_newchunk ();
extern void _obstack_free ();
extern int _obstack_begin ();
extern int _obstack_begin_1 ();
extern int _obstack_memory_used ();
#endif
#if defined (__STDC__) && __STDC__
@@ -234,6 +238,7 @@ void * obstack_finish (struct obstack *obstack);
int obstack_object_size (struct obstack *obstack);
int obstack_room (struct obstack *obstack);
void obstack_make_room (struct obstack *obstack, int size);
void obstack_1grow_fast (struct obstack *obstack, int data_char);
void obstack_ptr_grow_fast (struct obstack *obstack, void *data);
void obstack_int_grow_fast (struct obstack *obstack, int data);
@@ -243,17 +248,30 @@ void * obstack_base (struct obstack *obstack);
void * obstack_next_free (struct obstack *obstack);
int obstack_alignment_mask (struct obstack *obstack);
int obstack_chunk_size (struct obstack *obstack);
int obstack_memory_used (struct obstack *obstack);
#endif /* __STDC__ */
/* Non-ANSI C cannot really support alternative functions for these macros,
so we do not declare them. */
/* Error handler called when `obstack_chunk_alloc' failed to allocate
more memory. This can be set to a user defined function. The
default action is to print a message and abort. */
#if defined (__STDC__) && __STDC__
extern void (*obstack_alloc_failed_handler) (void);
#else
extern void (*obstack_alloc_failed_handler) ();
#endif
/* Exit value used when `print_and_abort' is used. */
extern int obstack_exit_failure;
/* Pointer to beginning of object being allocated or to be allocated next.
Note that this might not be the final address of the object
because a new chunk might be needed to hold the final size. */
#define obstack_base(h) ((h)->alloc_failed ? 0 : (h)->object_base)
#define obstack_base(h) ((h)->object_base)
/* Size for allocating ordinary chunks. */
@@ -261,7 +279,7 @@ int obstack_chunk_size (struct obstack *obstack);
/* Pointer to next byte not yet allocated in current chunk. */
#define obstack_next_free(h) ((h)->alloc_failed ? 0 : (h)->next_free)
#define obstack_next_free(h) ((h)->next_free)
/* Mask specifying low bits that should be clear in address of an object. */
@@ -273,19 +291,19 @@ int obstack_chunk_size (struct obstack *obstack);
#define obstack_init(h) \
_obstack_begin ((h), 0, 0, \
(void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
(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)
(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))
(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))
(void *(*) (long)) (chunkfun), (void (*) (void *)) (freefun), (arg))
#define obstack_chunkfun(h, newchunkfun) \
((h) -> chunkfun = (struct _obstack_chunk *(*)(long)) (newchunkfun))
@@ -322,6 +340,8 @@ int obstack_chunk_size (struct obstack *obstack);
#define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = achar)
#define obstack_blank_fast(h,n) ((h)->next_free += (n))
#define obstack_memory_used(h) _obstack_memory_used (h)
#if defined (__GNUC__) && defined (__STDC__) && __STDC__
/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
@@ -339,7 +359,6 @@ int obstack_chunk_size (struct obstack *obstack);
#define obstack_object_size(OBSTACK) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
__o->alloc_failed ? 0 : \
(unsigned) (__o->next_free - __o->object_base); })
#define obstack_room(OBSTACK) \
@@ -347,17 +366,22 @@ int obstack_chunk_size (struct obstack *obstack);
({ struct obstack *__o = (OBSTACK); \
(unsigned) (__o->chunk_limit - __o->next_free); })
#define obstack_make_room(OBSTACK,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
if (__o->chunk_limit - __o->next_free < __len) \
_obstack_newchunk (__o, __len); \
(void) 0; })
#define obstack_grow(OBSTACK,where,length) \
__extension__ \
({ struct obstack *__o = (OBSTACK); \
int __len = (length); \
if (__o->next_free + __len > __o->chunk_limit) \
_obstack_newchunk (__o, __len); \
if (!__o->alloc_failed) \
{ \
bcopy ((char *) (where), __o->next_free, __len); \
__o->next_free += __len; \
} \
_obstack_memcpy (__o->next_free, (char *) (where), __len); \
__o->next_free += __len; \
(void) 0; })
#define obstack_grow0(OBSTACK,where,length) \
@@ -366,12 +390,9 @@ __extension__ \
int __len = (length); \
if (__o->next_free + __len + 1 > __o->chunk_limit) \
_obstack_newchunk (__o, __len + 1); \
if (!__o->alloc_failed) \
{ \
bcopy ((char *) (where), __o->next_free, __len); \
__o->next_free += __len; \
*(__o->next_free)++ = 0; \
} \
_obstack_memcpy (__o->next_free, (char *) (where), __len); \
__o->next_free += __len; \
*(__o->next_free)++ = 0; \
(void) 0; })
#define obstack_1grow(OBSTACK,datum) \
@@ -379,8 +400,7 @@ __extension__ \
({ struct obstack *__o = (OBSTACK); \
if (__o->next_free + 1 > __o->chunk_limit) \
_obstack_newchunk (__o, 1); \
if (!__o->alloc_failed) \
*(__o->next_free)++ = (datum); \
*(__o->next_free)++ = (datum); \
(void) 0; })
/* These assume that the obstack alignment is good enough for pointers or ints,
@@ -392,8 +412,7 @@ __extension__ \
({ struct obstack *__o = (OBSTACK); \
if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
_obstack_newchunk (__o, sizeof (void *)); \
if (!__o->alloc_failed) \
*((void **)__o->next_free)++ = ((void *)datum); \
*((void **)__o->next_free)++ = ((void *)datum); \
(void) 0; })
#define obstack_int_grow(OBSTACK,datum) \
@@ -401,12 +420,11 @@ __extension__ \
({ struct obstack *__o = (OBSTACK); \
if (__o->next_free + sizeof (int) > __o->chunk_limit) \
_obstack_newchunk (__o, sizeof (int)); \
if (!__o->alloc_failed) \
*((int *)__o->next_free)++ = ((int)datum); \
*((int *)__o->next_free)++ = ((int)datum); \
(void) 0; })
#define obstack_ptr_grow_fast(h,aptr) (*((void **)(h)->next_free)++ = (void *)aptr)
#define obstack_int_grow_fast(h,aint) (*((int *)(h)->next_free)++ = (int)aint)
#define obstack_ptr_grow_fast(h,aptr) (*((void **) (h)->next_free)++ = (void *)aptr)
#define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
#define obstack_blank(OBSTACK,length) \
__extension__ \
@@ -414,8 +432,7 @@ __extension__ \
int __len = (length); \
if (__o->chunk_limit - __o->next_free < __len) \
_obstack_newchunk (__o, __len); \
if (!__o->alloc_failed) \
__o->next_free += __len; \
__o->next_free += __len; \
(void) 0; })
#define obstack_alloc(OBSTACK,length) \
@@ -442,21 +459,16 @@ __extension__ \
__extension__ \
({ struct obstack *__o1 = (OBSTACK); \
void *value; \
if (__o1->alloc_failed) \
value = 0; \
else \
{ \
value = (void *) __o1->object_base; \
if (__o1->next_free == value) \
__o1->maybe_empty_object = 1; \
__o1->next_free \
= __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\
& ~ (__o1->alignment_mask)); \
if (__o1->next_free - (char *)__o1->chunk \
> __o1->chunk_limit - (char *)__o1->chunk) \
__o1->next_free = __o1->chunk_limit; \
__o1->object_base = __o1->next_free; \
} \
value = (void *) __o1->object_base; \
if (__o1->next_free == value) \
__o1->maybe_empty_object = 1; \
__o1->next_free \
= __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\
& ~ (__o1->alignment_mask)); \
if (__o1->next_free - (char *)__o1->chunk \
> __o1->chunk_limit - (char *)__o1->chunk) \
__o1->next_free = __o1->chunk_limit; \
__o1->object_base = __o1->next_free; \
value; })
#define obstack_free(OBSTACK, OBJ) \
@@ -470,7 +482,7 @@ __extension__ \
#else /* not __GNUC__ or not __STDC__ */
#define obstack_object_size(h) \
(unsigned) ((h)->alloc_failed ? 0 : (h)->next_free - (h)->object_base)
(unsigned) ((h)->next_free - (h)->object_base)
#define obstack_room(h) \
(unsigned) ((h)->chunk_limit - (h)->next_free)
@@ -481,50 +493,49 @@ __extension__ \
Casting the third operand to void was tried before,
but some compilers won't accept it. */
#define obstack_make_room(h,length) \
( (h)->temp = (length), \
(((h)->next_free + (h)->temp > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp), 0) : 0))
#define obstack_grow(h,where,length) \
( (h)->temp = (length), \
(((h)->next_free + (h)->temp > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
((h)->alloc_failed ? 0 : \
(bcopy ((char *) (where), (h)->next_free, (h)->temp), \
(h)->next_free += (h)->temp)))
_obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
(h)->next_free += (h)->temp)
#define obstack_grow0(h,where,length) \
( (h)->temp = (length), \
(((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \
((h)->alloc_failed ? 0 : \
(bcopy ((char *) (where), (h)->next_free, (h)->temp), \
_obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
(h)->next_free += (h)->temp, \
*((h)->next_free)++ = 0)))
*((h)->next_free)++ = 0)
#define obstack_1grow(h,datum) \
( (((h)->next_free + 1 > (h)->chunk_limit) \
? (_obstack_newchunk ((h), 1), 0) : 0), \
((h)->alloc_failed ? 0 : \
(*((h)->next_free)++ = (datum))))
(*((h)->next_free)++ = (datum)))
#define obstack_ptr_grow(h,datum) \
( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \
? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \
((h)->alloc_failed ? 0 : \
(*((char **)(((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *)datum))))
(*((char **) (((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *) datum)))
#define obstack_int_grow(h,datum) \
( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \
? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \
((h)->alloc_failed ? 0 : \
(*((int *)(((h)->next_free+=sizeof(int))-sizeof(int))) = ((int)datum))))
(*((int *) (((h)->next_free+=sizeof(int))-sizeof(int))) = ((int) datum)))
#define obstack_ptr_grow_fast(h,aptr) (*((char **)(h)->next_free)++ = (char *)aptr)
#define obstack_int_grow_fast(h,aint) (*((int *)(h)->next_free)++ = (int)aint)
#define obstack_ptr_grow_fast(h,aptr) (*((char **) (h)->next_free)++ = (char *) aptr)
#define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
#define obstack_blank(h,length) \
( (h)->temp = (length), \
(((h)->chunk_limit - (h)->next_free < (h)->temp) \
? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
((h)->alloc_failed ? 0 : \
((h)->next_free += (h)->temp)))
((h)->next_free += (h)->temp))
#define obstack_alloc(h,length) \
(obstack_blank ((h), (length)), obstack_finish ((h)))
@@ -536,30 +547,29 @@ __extension__ \
(obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))
#define obstack_finish(h) \
( (h)->alloc_failed ? 0 : \
(((h)->next_free == (h)->object_base \
( ((h)->next_free == (h)->object_base \
? (((h)->maybe_empty_object = 1), 0) \
: 0), \
(h)->temp = __PTR_TO_INT ((h)->object_base), \
(h)->next_free \
= __INT_TO_PTR ((__PTR_TO_INT ((h)->next_free)+(h)->alignment_mask) \
& ~ ((h)->alignment_mask)), \
(((h)->next_free - (char *)(h)->chunk \
> (h)->chunk_limit - (char *)(h)->chunk) \
(((h)->next_free - (char *) (h)->chunk \
> (h)->chunk_limit - (char *) (h)->chunk) \
? ((h)->next_free = (h)->chunk_limit) : 0), \
(h)->object_base = (h)->next_free, \
__INT_TO_PTR ((h)->temp)))
__INT_TO_PTR ((h)->temp))
#if defined (__STDC__) && __STDC__
#define obstack_free(h,obj) \
( (h)->temp = (char *)(obj) - (char *) (h)->chunk, \
( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
(((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
? (int) ((h)->next_free = (h)->object_base \
= (h)->temp + (char *) (h)->chunk) \
: (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0)))
#else
#define obstack_free(h,obj) \
( (h)->temp = (char *)(obj) - (char *) (h)->chunk, \
( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
(((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
? (int) ((h)->next_free = (h)->object_base \
= (h)->temp + (char *) (h)->chunk) \

View File

@@ -1,32 +1,32 @@
/* Copyright (C) 1991, 1994 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1994, 1997 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,
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. */
#include <errno.h>
#ifdef HAVE_CONFIG_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
/* Define-away any (possibly conflicting) prototype of putenv.
Many systems omit the `const' attribute on the argument. */
#define putenv _sys_putenv
/* Disable the definition of putenv to rpl_putenv (from config.h) in this
file. Otherwise, we'd get conflicting prototypes for rpl_putenv on
systems like Irix 5.3. */
#undef putenv
#if defined (__GNU_LIBRARY__) || defined (HAVE_STDLIB_H)
# include <stdlib.h>
@@ -38,8 +38,6 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# include <unistd.h>
#endif
#undef putenv
#if !defined (__GNU_LIBRARY__) && !defined (HAVE_STRCHR)
# define strchr index
#endif
@@ -56,7 +54,7 @@ extern char **environ;
/* Put STRING, which is of the form "NAME=VALUE", in the environment. */
int
putenv (string)
rpl_putenv (string)
const char *string;
{
const char *const name_end = strchr (string, '=');

93
lib/readutmp.c Normal file
View File

@@ -0,0 +1,93 @@
/* GNU's read utmp module.
Copyright (C) 92, 93, 94, 95, 96, 1997 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 jla; revised by djm */
#include <config.h>
#include <sys/stat.h>
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
# include <string.h>
#else
# include <strings.h>
#endif /* STDC_HEADERS || HAVE_STRING_H */
#include "readutmp.h"
char *xmalloc ();
/* Copy UT->ut_name into storage obtained from malloc. Then remove any
trailing spaces from the copy, NUL terminate it, and return the copy. */
char *
extract_trimmed_name (ut)
const STRUCT_UTMP *ut;
{
char *p, *trimmed_name;
trimmed_name = xmalloc (sizeof (ut->ut_name) + 1);
strncpy (trimmed_name, ut->ut_name, sizeof (ut->ut_name));
/* Append a trailing space character. Some systems pad names shorter than
the maximum with spaces, others pad with NULs. Remove any spaces. */
trimmed_name[sizeof (ut->ut_name)] = ' ';
p = strchr (trimmed_name, ' ');
if (p != NULL)
*p = '\0';
return trimmed_name;
}
/* Read the utmp file FILENAME into *UTMP_BUF, set *N_ENTRIES to the
number of entries read, and return zero. If there is any error,
return non-zero and don't modify the parameters. */
int
read_utmp (filename, n_entries, utmp_buf)
const char *filename;
int *n_entries;
STRUCT_UTMP **utmp_buf;
{
FILE *utmp;
struct stat file_stats;
size_t n_read;
size_t size;
STRUCT_UTMP *buf;
utmp = fopen (filename, "r");
if (utmp == NULL)
return 1;
fstat (fileno (utmp), &file_stats);
size = file_stats.st_size;
if (size > 0)
buf = (STRUCT_UTMP *) xmalloc (size);
else
{
fclose (utmp);
return 1;
}
/* Use < instead of != in case the utmp just grew. */
n_read = fread (buf, 1, size, utmp);
if (ferror (utmp) || fclose (utmp) == EOF
|| n_read < size)
return 1;
*n_entries = size / sizeof (STRUCT_UTMP);
*utmp_buf = buf;
return 0;
}

85
lib/readutmp.h Normal file
View File

@@ -0,0 +1,85 @@
/* Declarations for GNU's read utmp module.
Copyright (C) 92, 93, 94, 95, 96, 1997 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 jla; revised by djm */
#ifndef __READUTMP_H__
# define __READUTMP_H__
# include <stdio.h>
# include <sys/types.h>
# ifdef HAVE_UTMPX_H
# include <utmpx.h>
# define UTMP_STRUCT_NAME utmpx
# define UT_TIME_MEMBER(UT_PTR) ((UT_PTR)->ut_tv.tv_sec)
# else
# include <utmp.h>
# define UTMP_STRUCT_NAME utmp
# define UT_TIME_MEMBER(UT_PTR) ((UT_PTR)->ut_time)
# endif
typedef struct UTMP_STRUCT_NAME STRUCT_UTMP;
# include <time.h>
# ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
# endif
# include <errno.h>
# ifndef errno
extern int errno;
# endif
# if !defined (UTMP_FILE) && defined (_PATH_UTMP)
# define UTMP_FILE _PATH_UTMP
# endif
# if !defined (WTMP_FILE) && defined (_PATH_WTMP)
# define WTMP_FILE _PATH_WTMP
# endif
# ifdef UTMPX_FILE /* Solaris, SysVr4 */
# undef UTMP_FILE
# define UTMP_FILE UTMPX_FILE
# endif
# ifdef WTMPX_FILE /* Solaris, SysVr4 */
# undef WTMP_FILE
# define WTMP_FILE WTMPX_FILE
# endif
# ifndef UTMP_FILE
# define UTMP_FILE "/etc/utmp"
# endif
# ifndef WTMP_FILE
# define WTMP_FILE "/etc/wtmp"
# endif
# undef PARAMS
# if defined (__STDC__) && __STDC__
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
extern char *extract_trimmed_name PARAMS ((const STRUCT_UTMP *ut));
extern int read_utmp PARAMS ((const char *filename,
int *n_entries, STRUCT_UTMP **utmp_buf));
#endif /* __READUTMP_H__ */

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +1,33 @@
/* Definitions for data structures and routines for the regular
expression library, version 0.12.
Copyright (C) 1985,89,90,91,92,93,95,96,97 Free Software Foundation, Inc.
Copyright (C) 1985, 89, 90, 91, 92, 93, 95 Free Software Foundation, Inc.
the C library, however. The master source lives in /gd/gnu/lib.
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.
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 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 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.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
This 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.
#ifndef __REGEXP_LIBRARY_H__
#define __REGEXP_LIBRARY_H__
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 _REGEX_H
#define _REGEX_H 1
/* Allow the use in C++ code. */
#ifdef __cplusplus
extern "C" {
#endif
/* POSIX says that <sys/types.h> must be included (by the caller) before
<regex.h>. */
@@ -29,17 +38,23 @@
#include <stddef.h>
#endif
/* The following two types have to be signed and unsigned integer type
wide enough to hold a value of a pointer. For most ANSI compilers
ptrdiff_t and size_t should be likely OK. Still size of these two
types is 2 for Microsoft C. Ugh... */
typedef long int s_reg_t;
typedef unsigned long int active_reg_t;
/* The following bits are used to determine the regexp syntax we
recognize. The set/not-set meanings are chosen so that Emacs syntax
remains the value 0. The bits are given in alphabetical order, and
the definitions shifted by one from the previous bit; thus, when we
add or remove a bit, only one other definition need change. */
typedef unsigned reg_syntax_t;
typedef unsigned long int reg_syntax_t;
/* If this bit is not set, then \ inside a bracket expression is literal.
If set, then such a \ quotes the following character. */
#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
#define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
/* If this bit is not set, then + and ? are operators, and \+ and \? are
literals.
@@ -134,6 +149,18 @@ typedef unsigned reg_syntax_t;
without further backtracking. */
#define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
/* If this bit is set, do not process the GNU regex operators.
If not set, then the GNU regex operators are recognized. */
#define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)
/* If this bit is set, turn on internal regex debugging.
If not set, and debugging was on, turn it off.
This only works if regex.c is compiled -DDEBUG.
We define this bit always, so that all that's needed to turn on
debugging is to recompile regex.c; the calling code can always have
this bit set, and it won't affect anything in the normal case. */
#define RE_DEBUG (RE_NO_GNU_OPS << 1)
/* This global variable defines the particular regexp syntax to use (for
some interfaces). When a regexp is compiled, the syntax used is
stored in the pattern buffer, so changing this does not affect
@@ -147,13 +174,19 @@ extern reg_syntax_t re_syntax_options;
#define RE_SYNTAX_EMACS 0
#define RE_SYNTAX_AWK \
(RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
| RE_UNMATCHED_RIGHT_PAREN_ORD)
(RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
| RE_NO_BK_PARENS | RE_NO_BK_REFS \
| RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
| RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \
| RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
#define RE_SYNTAX_GNU_AWK \
((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \
& ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS))
#define RE_SYNTAX_POSIX_AWK \
(RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS)
(RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
| RE_INTERVALS | RE_NO_GNU_OPS)
#define RE_SYNTAX_GREP \
(RE_BK_PLUS_QM | RE_CHAR_CLASSES \
@@ -209,7 +242,8 @@ extern reg_syntax_t re_syntax_options;
#ifdef RE_DUP_MAX
#undef RE_DUP_MAX
#endif
#define RE_DUP_MAX ((1 << 15) - 1)
/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */
#define RE_DUP_MAX (0x7fff)
/* POSIX `cflags' bits (i.e., information for `regcomp'). */
@@ -292,10 +326,10 @@ struct re_pattern_buffer
unsigned char *buffer;
/* Number of bytes to which `buffer' points. */
unsigned long allocated;
unsigned long int allocated;
/* Number of bytes actually used in `buffer'. */
unsigned long used;
unsigned long int used;
/* Syntax setting with which the pattern was compiled. */
reg_syntax_t syntax;
@@ -410,7 +444,7 @@ extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
and syntax given by the global `re_syntax_options', into the buffer
BUFFER. Return NULL if successful, and an error string if not. */
extern const char *re_compile_pattern
_RE_ARGS ((const char *pattern, int length,
_RE_ARGS ((const char *pattern, size_t length,
struct re_pattern_buffer *buffer));
@@ -469,10 +503,12 @@ extern void re_set_registers
unsigned num_regs, regoff_t *starts, regoff_t *ends));
#ifdef _REGEX_RE_COMP
#ifndef _CRAY
/* 4.2 bsd compatibility. */
extern char *re_comp _RE_ARGS ((const char *));
extern int re_exec _RE_ARGS ((const char *));
#endif
#endif
/* POSIX compatibility. */
extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
@@ -484,7 +520,12 @@ extern size_t regerror
size_t errbuf_size));
extern void regfree _RE_ARGS ((regex_t *preg));
#endif /* not __REGEXP_LIBRARY_H__ */
#ifdef __cplusplus
}
#endif /* C++ */
#endif /* regex.h */
/*
Local variables:

View File

@@ -1,22 +1,22 @@
/* rpmatch - determine whether string value is affirmation or negative
response according to current locale's data
Copyright (C) 1996 Free Software Foundation, Inc.
/* 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 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. */
#ifdef HAVE_CONFIG_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
@@ -30,7 +30,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#endif
#include <sys/types.h>
#ifdef WITH_REGEX
#if WITH_REGEX
# include <regex.h>
#else
# include <rx.h>

View File

@@ -14,8 +14,8 @@ for more details.
You should have received a copy of the GNU Library General Public
License along with this software; see the file COPYING.LIB. If not,
write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA
02139, USA. */
write to the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* NOTE!!! AIX is so losing it requires this to be the first thing in the
* file.

View File

@@ -17,8 +17,8 @@ for more details.
You should have received a copy of the GNU Library General Public
License along with this software; see the file COPYING.LIB. If not,
write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA
02139, USA. */
write to the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* t. lord Wed Sep 23 18:20:57 1992 */

View File

@@ -1,5 +1,5 @@
/* save-cwd.c -- Save and restore current working directory.
Copyright (C) 1995 Free Software Foundation, Inc.
Copyright (C) 1995, 1997 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
@@ -38,7 +38,7 @@
#endif
#include <errno.h>
# ifndef errno
#ifndef errno
extern int errno;
#endif
@@ -96,7 +96,7 @@ save_cwd (cwd)
}
# endif /* __sun__ || sun */
#else
#define fchdir(x) (abort (), 0)
# define fchdir(x) (abort (), 0)
have_working_fchdir = 0;
#endif
}
@@ -152,4 +152,3 @@ free_cwd (cwd)
if (cwd->name)
free (cwd->name);
}

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 1991 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1994, 1996, 1997 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,11 +14,11 @@
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
#if HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_STRING_H
#if HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
@@ -27,7 +27,7 @@
# endif
#endif
/* Return the length of the maximum inital segment of S
/* Return the length of the maximum initial segment of S
which contains no characters from REJECT. */
int
strcspn (s, reject)

View File

@@ -1,21 +1,22 @@
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
@@ -139,7 +140,7 @@ extern int __tz_compute __P ((time_t timer, const struct tm *tm));
# if ! HAVE_LOCALTIME_R
# if ! HAVE_TM_GMTOFF
/* Approximate gmtime_r as best we can in its absence. */
# define gmtime_r my_gmtime_r
# define gmtime_r my_gmtime_r
static struct tm *gmtime_r __P ((const time_t *, struct tm *));
static struct tm *
gmtime_r (t, tp)
@@ -176,11 +177,12 @@ localtime_r (t, tp)
/* Some systems lack the `memset' function and we don't want to
introduce additional dependencies. */
static const char spaces[16] = " ";
static const char zeroes[16] = "0000000000000000";
# define memset_space(P, Len) \
do { \
int _len = (Len); \
\
\
do \
{ \
int _this = _len > 16 ? 16 : _len; \
@@ -190,11 +192,26 @@ static const char spaces[16] = " ";
} \
while (_len > 0); \
} while (0)
# define memset_zero(P, Len) \
do { \
int _len = (Len); \
\
do \
{ \
int _this = _len > 16 ? 16 : _len; \
memcpy ((P), zeroes, _this); \
(P) += _this; \
_len -= _this; \
} \
while (_len > 0); \
} while (0)
#else
# define memset_space(P, Len) memset ((P), ' ', (Len))
# define memset_space(P, Len) (memset ((P), ' ', (Len)), (P) += (Len))
# define memset_zero(P, Len) (memset ((P), '0', (Len)), (P) += (Len))
#endif
#define add(n, f) \
#define add(n, f) \
do \
{ \
int _n = (n); \
@@ -205,14 +222,19 @@ static const char spaces[16] = " ";
if (p) \
{ \
if (_delta > 0) \
memset_space (p, _delta); \
{ \
if (pad == '0') \
memset_zero (p, _delta); \
else \
memset_space (p, _delta); \
} \
f; \
p += _n; \
} \
i += _incr; \
} while (0)
#define cpy(n, s) \
#define cpy(n, s) \
add ((n), \
if (to_lowcase) \
memcpy_lowcase (p, (s), _n); \
@@ -349,11 +371,11 @@ static char const month_name[][10] =
# ifdef strftime
# undef strftime
# endif
# define strftime _strftime_copytm
# define strftime(S, Maxsize, Format, Tp) \
_strftime_copytm (S, Maxsize, Format, Tp)
#endif
/* Write information from TP into S according to the format
string FORMAT, writing no more that MAXSIZE characters
(including the terminating '\0') and returning number of

View File

@@ -1,5 +1,5 @@
/* strtol - Convert string representation of a number into an integer value.
Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc.
Copyright (C) 1991, 92, 94, 95, 96, 97 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.
@@ -201,7 +201,10 @@ INTERNAL (strtol) (nptr, endptr, base, group)
#endif
if (base < 0 || base == 1 || base > 36)
base = 10;
{
__set_errno (EINVAL);
return 0;
}
save = s = nptr;
@@ -309,6 +312,8 @@ INTERNAL (strtol) (nptr, endptr, base, group)
? -((unsigned LONG int) (LONG_MIN + 1)) + 1
: (unsigned LONG int) LONG_MAX))
overflow = 1;
#else
overflow |= negative;
#endif
if (overflow)

111
lib/strverscmp.c Normal file
View File

@@ -0,0 +1,111 @@
/* Compare strings while treating digits characters numerically.
Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jean-Francois Bignolles <bignolle@ecoledoc.ibp.fr>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <string.h>
#include <ctype.h>
/* states: S_N: normal, S_I: comparing integral part, S_F: comparing
Fractional parts, S_Z: idem but with leading Zeroes only */
#define S_N 0x0
#define S_I 0x4
#define S_F 0x8
#define S_Z 0xC
/* result_type: CMP: return diff; LEN: compare using len_diff/diff */
#define CMP 2
#define LEN 3
/* Compare S1 and S2 as strings holding indices/version numbers,
returning less than, equal to or greater than zero if S1 is less than,
equal to or greater than S2 (for more info, see the texinfo doc).
*/
int
strverscmp (s1, s2)
const char *s1;
const char *s2;
{
const unsigned char *p1 = (const unsigned char *) s1;
const unsigned char *p2 = (const unsigned char *) s2;
unsigned char c1, c2;
int state;
int diff;
/* Symbol(s) 0 [1-9] others (padding)
Transition (10) 0 (01) d (00) x (11) - */
static const unsigned int next_state[] =
{
/* state x d 0 - */
/* S_N */ S_N, S_I, S_Z, S_N,
/* S_I */ S_N, S_I, S_I, S_I,
/* S_F */ S_N, S_F, S_F, S_F,
/* S_Z */ S_N, S_F, S_Z, S_Z
};
static const int result_type[] =
{
/* state x/x x/d x/0 x/- d/x d/d d/0 d/-
0/x 0/d 0/0 0/- -/x -/d -/0 -/- */
/* S_N */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP,
CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP,
/* S_I */ CMP, -1, -1, CMP, +1, LEN, LEN, CMP,
+1, LEN, LEN, CMP, CMP, CMP, CMP, CMP,
/* S_F */ CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP,
CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP,
/* S_Z */ CMP, +1, +1, CMP, -1, CMP, CMP, CMP,
-1, CMP, CMP, CMP
};
if (p1 == p2)
return 0;
c1 = *p1++;
c2 = *p2++;
/* Hint: '0' is a digit too. */
state = S_N | ((c1 == '0') + (isdigit (c1) != 0));
while ((diff = c1 - c2) == 0 && c1 != '\0')
{
state = next_state[state];
c1 = *p1++;
c2 = *p2++;
state |= (c1 == '0') + (isdigit (c1) != 0);
}
state = result_type[state << 2 | ((c2 == '0') + (isdigit (c2) != 0))];
switch (state)
{
case CMP:
return diff;
case LEN:
while (isdigit (*p1++))
if (!isdigit (*p2++))
return 1;
return isdigit (*p2) ? -1 : diff;
default:
return state;
}
}

8
lib/strverscmp.h Normal file
View File

@@ -0,0 +1,8 @@
/* strverscmp.h -- compare strings holding indices/version numbers */
#ifndef STRVERSCMP_H_
# define STRVERSCMP_H_
int strverscmp (const char*, const char*);
#endif /* not STRVERSCMP_H_ */

View File

@@ -1,5 +1,5 @@
/* userspec.c -- Parse a user and group string.
Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
Copyright (C) 1989, 1990, 1991, 1992, 1997 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,9 +16,9 @@
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
#ifdef __GNUC__
@@ -28,7 +28,7 @@
# include <alloca.h>
# else
# ifdef _AIX
#pragma alloca
# pragma alloca
# else
char *alloca ();
# endif
@@ -40,7 +40,7 @@ char *alloca ();
#include <pwd.h>
#include <grp.h>
#ifdef HAVE_STRING_H
#if HAVE_STRING_H
# include <string.h>
#else
# include <strings.h>
@@ -49,11 +49,11 @@ char *alloca ();
# endif
#endif
#ifdef STDC_HEADERS
#if STDC_HEADERS
# include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
@@ -247,7 +247,7 @@ parse_user_spec (spec_arg, uid, gid, username_arg, groupname_arg)
#ifdef TEST
#define NULL_CHECK(s) ((s) == NULL ? "(null)" : (s))
# define NULL_CHECK(s) ((s) == NULL ? "(null)" : (s))
int
main (int argc, char **argv)

View File

@@ -1,6 +1,7 @@
#! /bin/sh
# ylwrap - wrapper for lex/yacc invocations.
# Written by Tom Tromey <tromey@cygnus.com>, Aug 11 1996
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# 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
@@ -17,8 +18,9 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Usage:
# ylwrap PROG [OUTPUT DESIRED]... -- [ARGS]...
# * PROG is program to run.
# ylwrap PROGRAM INPUT [OUTPUT DESIRED]... -- [ARGS]...
# * PROGRAM is program to run.
# * INPUT is the input file
# * OUTPUT is file PROG generates
# * DESIRED is file we actually want
# * ARGS are passed to PROG
@@ -28,6 +30,21 @@
prog="$1"
shift
# The input.
input="$1"
shift
case "$input" in
/*)
# Absolute path; do nothing.
;;
*)
# Relative path. Make it absolute. Why? Because otherwise any
# debugging info in the generated file will point to the wrong
# place. This is really gross.
input="`pwd`/$input"
;;
esac
pairlist=
while test "$#" -ne 0; do
if test "$1" = "--"; then
@@ -37,26 +54,48 @@ while test "$#" -ne 0; do
shift
done
$prog ${1+"$@"} || exit $?
# FIXME: add hostname here for parallel makes that run commands on
# other machines. But that might take us over the 14-char limit.
dirname=ylwrap$$
trap "cd `pwd`; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15
mkdir $dirname || exit 1
set X $pairlist
shift
status=0
first=yes
while test "$#" -ne 0; do
if test -f "$1"; then
mv "$1" "$2" || status=$?
else
# A missing file is only an error for the first file. This is a
# blatant hack to let us support using "yacc -d". If -d is not
# specified, we don't want an error when the header file is
# "missing".
if test $first = yes; then
status=1
cd $dirname
$prog ${1+"$@"} "$input"
status=$?
if test $status -eq 0; then
set X $pairlist
shift
first=yes
while test "$#" -ne 0; do
if test -f "$1"; then
# If $2 is an absolute path name, then just use that,
# otherwise prepend `../'.
case "$2" in
/*) target="$2";;
*) target="../$2";;
esac
mv "$1" "$target" || status=$?
else
# A missing file is only an error for the first file. This
# is a blatant hack to let us support using "yacc -d". If -d
# is not specified, we don't want an error when the header
# file is "missing".
if test $first = yes; then
status=1
fi
fi
fi
shift
shift
first=no
done
shift
shift
first=no
done
else
status=$?
fi
# Remove the directory.
cd ..
rm -rf $dirname
exit $status

View File

@@ -4,8 +4,5 @@
# find . -type f -name '*.m4' -printf '%f\n'|sort |fmt |tr '\012' @ \
# |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012'
EXTRA_DIST = README \
ccstdc.m4 dmalloc.m4 error.m4 getgroups.m4 getline.m4 getloadavg.m4 \
gettext.m4 header.m4 init.m4 install.m4 jm-mktime.m4 jm-winsz1.m4 \
jm-winsz2.m4 lcmessage.m4 lispdir.m4 maintainer.m4 memcmp.m4 mktime.m4 \
obstack.m4 progtest.m4 protos.m4 ptrdiff.m4 regex.m4 sanity.m4 strftime.m4 \
strtod.m4 termios.m4 uptime.m4 winsz.m4
chown.m4 getgroups.m4 getline.m4 getloadavg.m4 jm-mktime.m4 jm-winsz1.m4 \
jm-winsz2.m4 memcmp.m4 putenv.m4 strftime.m4 uptime.m4

View File

@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.1l from Makefile.am
# Makefile.in generated automatically by automake 1.2 from Makefile.am
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
@@ -36,41 +36,75 @@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
RANLIB = @RANLIB@
GENCAT = @GENCAT@
PERL = @PERL@
GMSGFMT = @GMSGFMT@
NORMAL_INSTALL = true
PRE_INSTALL = true
POST_INSTALL = true
NORMAL_UNINSTALL = true
PRE_UNINSTALL = true
POST_UNINSTALL = true
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
CPP = @CPP@
DATADIRNAME = @DATADIRNAME@
DF_PROG = @DF_PROG@
GENCAT = @GENCAT@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
LIBOBJS = @LIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
MVDIR_PROG = @MVDIR_PROG@
PACKAGE = @PACKAGE@
PERL = @PERL@
POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
U = @U@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
YACC = @YACC@
l = @l@
EXTRA_DIST = README \
ccstdc.m4 dmalloc.m4 error.m4 getgroups.m4 getline.m4 getloadavg.m4 \
gettext.m4 header.m4 init.m4 install.m4 jm-mktime.m4 jm-winsz1.m4 \
jm-winsz2.m4 lcmessage.m4 lispdir.m4 maintainer.m4 memcmp.m4 mktime.m4 \
obstack.m4 progtest.m4 protos.m4 ptrdiff.m4 regex.m4 sanity.m4 strftime.m4 \
strtod.m4 termios.m4 uptime.m4 winsz.m4
chown.m4 d-ino.m4 getgroups.m4 getline.m4 getloadavg.m4 \
jm-mktime.m4 jm-winsz1.m4 jm-winsz2.m4 memcmp.m4 putenv.m4 \
strftime.m4 uptime.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
DIST_COMMON = README Makefile.am Makefile.in README
CONFIG_CLEAN_FILES =
DIST_COMMON = README Makefile.am Makefile.in
PACKAGE = @PACKAGE@
VERSION = @VERSION@
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) \
$(TEXINFOS) $(MANS) $(EXTRA_DIST)
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
default: all
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL)
cd $(top_srcdir) && automake --gnu m4/Makefile
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnits m4/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
@@ -83,7 +117,12 @@ TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = m4
distdir: $(DISTFILES)
here=`cd $(top_builddir) && pwd`; \
top_distdir=`cd $(top_distdir) && pwd`; \
cd $(top_srcdir) \
&& $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnits m4/Makefile
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
@@ -95,21 +134,21 @@ dvi:
check: all
$(MAKE)
installcheck:
install-exec:
$(NORMAL_INSTALL)
install-exec:
@$(NORMAL_INSTALL)
install-data:
$(NORMAL_INSTALL)
install-data:
@$(NORMAL_INSTALL)
install: install-exec install-data all
@:
uninstall:
uninstall:
all: Makefile
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
@@ -121,7 +160,7 @@ clean-generic:
distclean-generic:
rm -f Makefile $(DISTCLEANFILES)
rm -f config.cache config.log stamp-h
rm -f config.cache config.log stamp-h stamp-h[0-9]*
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:

View File

@@ -1,61 +0,0 @@
## ----------------------------------------- ##
## ANSIfy the C compiler whenever possible. ##
## From Franc,ois Pinard ##
## ----------------------------------------- ##
# serial 1
# @defmac AC_PROG_CC_STDC
# @maindex PROG_CC_STDC
# @ovindex CC
# If the C compiler in not in ANSI C mode by default, try to add an option
# to output variable @code{CC} to make it so. This macro tries various
# options that select ANSI C on some system or another. It considers the
# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
# handles function prototypes correctly.
#
# If you use this macro, you should check after calling it whether the C
# compiler has been set to accept ANSI C; if not, the shell variable
# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
# code in ANSI C, you can make an un-ANSIfied copy of it by using the
# program @code{ansi2knr}, which comes with Ghostscript.
# @end defmac
AC_DEFUN(AM_PROG_CC_STDC,
[AC_REQUIRE([AC_PROG_CC])
AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
AC_CACHE_VAL(am_cv_prog_cc_stdc,
[am_cv_prog_cc_stdc=no
ac_save_CC="$CC"
# Don't try gcc -ansi; that turns off useful extensions and
# breaks some systems' header files.
# AIX -qlanglvl=ansi
# Ultrix and OSF/1 -std1
# HP-UX -Aa -D_HPUX_SOURCE
# SVR4 -Xc -D__EXTENSIONS__
for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
AC_TRY_COMPILE(
[#if !defined(__STDC__) || __STDC__ != 1
choke me
#endif
/* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/stat.h>
#endif
], [
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};],
[am_cv_prog_cc_stdc="$ac_arg"; break])
done
CC="$ac_save_CC"
])
AC_MSG_RESULT($am_cv_prog_cc_stdc)
case "x$am_cv_prog_cc_stdc" in
x|xno) ;;
*) CC="$CC $am_cv_prog_cc_stdc" ;;
esac
])

40
m4/chown.m4 Normal file
View File

@@ -0,0 +1,40 @@
#serial 1
dnl From Jim Meyering.
dnl If you use this macro in a package, you should
dnl add the following two lines to acconfig.h:
dnl /* Define to rpl_chown if the replacement function should be used. */
dnl #undef chown
dnl
AC_DEFUN(jm_FUNC_CHOWN,
[AC_REQUIRE([AC_TYPE_UID_T])dnl
test -z "$ac_cv_header_unistd_h" \
&& AC_CHECK_HEADERS(unistd.h)
AC_CACHE_CHECK([for working chown], jm_cv_func_working_chown,
[AC_TRY_RUN([
# include <sys/types.h>
# include <fcntl.h>
# ifdef HAVE_UNISTD_H
# include <unistd.h>
# endif
int
main ()
{
char *f = "conftestchown";
if (creat (f, 0600) < 0)
exit (1);
exit (chown (f, (gid_t) -1, (uid_t) -1) == -1 ? 1 : 0);
}
],
jm_cv_func_working_chown=yes,
jm_cv_func_working_chown=no,
dnl When crosscompiling, assume chown is broken.
jm_cv_func_working_chown=no)
])
if test $jm_cv_func_working_chown = no; then
LIBOBJS="$LIBOBJS chown.o"
AC_DEFINE_UNQUOTED(chown, rpl_chown)
fi
])

40
m4/d-ino.m4 Normal file
View File

@@ -0,0 +1,40 @@
#serial 1
dnl From Jim Meyering.
dnl
dnl Check whether struct dirent has a member named d_ino.
dnl
AC_DEFUN(jm_STRUCT_DIRENT_D_INO,
[AC_REQUIRE([AC_HEADER_DIRENT])dnl
AC_CACHE_CHECK([for d_ino member in directory struct],
jm_cv_struct_dirent_d_ino,
[AC_TRY_LINK(dnl
[
#include <sys/types.h>
#ifdef HAVE_DIRENT_H
# include <dirent.h>
#else /* not HAVE_DIRENT_H */
# define dirent direct
# ifdef HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif /* HAVE_SYS_NDIR_H */
# ifdef HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif /* HAVE_SYS_DIR_H */
# ifdef HAVE_NDIR_H
# include <ndir.h>
# endif /* HAVE_NDIR_H */
#endif /* HAVE_DIRENT_H */
],
[struct dirent dp; dp.d_ino = 0;],
jm_cv_struct_dirent_d_ino=yes,
jm_cv_struct_dirent_d_ino=no)
]
)
if test $jm_cv_struct_dirent_d_ino = yes; then
AC_DEFINE(D_INO_IN_DIRENT)
fi
]
)

View File

@@ -1,21 +0,0 @@
## ----------------------------------- ##
## Check if --with-dmalloc was given. ##
## From Franc,ois Pinard ##
## ----------------------------------- ##
# serial 1
AC_DEFUN(AM_WITH_DMALLOC,
[AC_MSG_CHECKING(if malloc debugging is wanted)
AC_ARG_WITH(dmalloc,
[ --with-dmalloc use dmalloc, as in
ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz],
[if test "$withval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(WITH_DMALLOC)
LIBS="$LIBS -ldmalloc"
LDFLAGS="$LDFLAGS -g"
else
AC_MSG_RESULT(no)
fi], [AC_MSG_RESULT(no)])
])

View File

@@ -1,13 +0,0 @@
dnl From Jim Meyering. Use this if you use the GNU error.[ch].
dnl FIXME: Migrate into libit
AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
[AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
am_cv_lib_error_at_line=yes,
am_cv_lib_error_at_line=no)])
if test $am_cv_lib_error_at_line = no; then
LIBOBJS="$LIBOBJS error.o"
fi
AC_SUBST(LIBOBJS)dnl
])

View File

@@ -1,286 +0,0 @@
# Macro to add for using GNU gettext.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
# serial 1
AC_DEFUN(AM_WITH_NLS,
[AC_MSG_CHECKING([whether NLS is requested])
dnl Default is enabled NLS
AC_ARG_ENABLE(nls,
[ --disable-nls do not use Native Language Support],
USE_NLS=$enableval, USE_NLS=yes)
AC_MSG_RESULT($USE_NLS)
AC_SUBST(USE_NLS)
USE_INCLUDED_LIBINTL=no
dnl If we use NLS figure out what method
if test "$USE_NLS" = "yes"; then
AC_DEFINE(ENABLE_NLS)
AC_MSG_CHECKING([whether included gettext is requested])
AC_ARG_WITH(included-gettext,
[ --with-included-gettext use the GNU gettext library included here],
nls_cv_force_use_gnu_gettext=$withval,
nls_cv_force_use_gnu_gettext=no)
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
dnl User does not insist on using GNU NLS library. Figure out what
dnl to use. If gettext or catgets are available (in this order) we
dnl use this. Else we have to fall back to GNU NLS library.
dnl catgets is only used if permitted by option --with-catgets.
nls_cv_header_intl=
nls_cv_header_libgt=
CATOBJEXT=NONE
AC_CHECK_HEADER(libintl.h,
[AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
[AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
if test "$gt_cv_func_gettext_libc" != "yes"; then
AC_CHECK_LIB(intl, bindtextdomain,
[AC_CACHE_CHECK([for gettext in libintl],
gt_cv_func_gettext_libintl,
[AC_TRY_LINK([], [return (int) gettext ("")],
gt_cv_func_gettext_libintl=yes,
gt_cv_func_gettext_libintl=no)])])
fi
if test "$gt_cv_func_gettext_libc" = "yes" \
|| test "$gt_cv_func_gettext_libintl" = "yes"; then
AC_DEFINE(HAVE_GETTEXT)
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
if test "$MSGFMT" != "no"; then
AC_CHECK_FUNCS(dcgettext)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr],
[CATOBJEXT=.gmo
DATADIRNAME=share],
[CATOBJEXT=.mo
DATADIRNAME=lib])
INSTOBJEXT=.mo
fi
fi
])
if test "$CATOBJEXT" = "NONE"; then
AC_MSG_CHECKING([whether catgets can be used])
AC_ARG_WITH(catgets,
[ --with-catgets use catgets functions if available],
nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
AC_MSG_RESULT($nls_cv_use_catgets)
if test "$nls_cv_use_catgets" = "yes"; then
dnl No gettext in C library. Try catgets next.
AC_CHECK_LIB(i, main)
AC_CHECK_FUNC(catgets,
[AC_DEFINE(HAVE_CATGETS)
INTLOBJS="\$(CATOBJS)"
AC_PATH_PROG(GENCAT, gencat, no)dnl
if test "$GENCAT" != "no"; then
AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
if test "$GMSGFMT" = "no"; then
AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
fi
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.cat
INSTOBJEXT=.cat
DATADIRNAME=lib
INTLDEPS="../intl/libintl.a"
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi])
fi
fi
if test "$CATOBJEXT" = "NONE"; then
dnl Neither gettext nor catgets in included in the C library.
dnl Fall back on GNU gettext library.
nls_cv_use_gnu_gettext=yes
fi
fi
if test "$nls_cv_use_gnu_gettext" = "yes"; then
dnl Mark actions used to generate GNU NLS library.
INTLOBJS="\$(GETTOBJS)"
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
AC_SUBST(MSGFMT)
USE_INCLUDED_LIBINTL=yes
CATOBJEXT=.gmo
INSTOBJEXT=.mo
DATADIRNAME=share
INTLDEPS="../intl/libintl.a"
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
dnl Test whether we really found GNU xgettext.
if test "$XGETTEXT" != ":"; then
dnl If it is no GNU xgettext we define it as : so that the
dnl Makefiles still can work.
if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
: ;
else
AC_MSG_RESULT(
[found xgettext programs is not GNU xgettext; ignore it])
XGETTEXT=":"
fi
fi
# We need to process the po/ directory.
POSUB=po
else
DATADIRNAME=share
nls_cv_header_intl=intl/libintl.h
nls_cv_header_libgt=intl/libgettext.h
fi
# If this is used in GNU gettext we have to set USE_NLS to `yes'
# because some of the sources are only built for this goal.
if test "$PACKAGE" = gettext; then
USE_NLS=yes
USE_INCLUDED_LIBINTL=yes
fi
dnl These rules are solely for the distribution goal. While doing this
dnl we only have to keep exactly one list of the available catalogs
dnl in configure.in.
for lang in $ALL_LINGUAS; do
GMOFILES="$GMOFILES $lang.gmo"
POFILES="$POFILES $lang.po"
done
dnl Make all variables we use known to autoconf.
AC_SUBST(USE_INCLUDED_LIBINTL)
AC_SUBST(CATALOGS)
AC_SUBST(CATOBJEXT)
AC_SUBST(DATADIRNAME)
AC_SUBST(GMOFILES)
AC_SUBST(INSTOBJEXT)
AC_SUBST(INTLDEPS)
AC_SUBST(INTLLIBS)
AC_SUBST(INTLOBJS)
AC_SUBST(POFILES)
AC_SUBST(POSUB)
])
AC_DEFUN(AM_GNU_GETTEXT,
[AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_C_CONST])dnl
AC_REQUIRE([AC_C_INLINE])dnl
AC_REQUIRE([AC_TYPE_OFF_T])dnl
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
AC_REQUIRE([AC_FUNC_MMAP])dnl
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
unistd.h values.h])
AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
__argz_count __argz_stringify __argz_next])
if test "${ac_cv_func_stpcpy+set}" != "set"; then
AC_CHECK_FUNCS(stpcpy)
fi
if test "${ac_cv_func_stpcpy}" = "yes"; then
AC_DEFINE(HAVE_STPCPY)
fi
AM_LC_MESSAGES
AM_WITH_NLS
if test "x$CATOBJEXT" != "x"; then
if test "x$ALL_LINGUAS" = "x"; then
LINGUAS=
else
AC_MSG_CHECKING(for catalogs to be installed)
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
*$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
esac
done
LINGUAS=$NEW_LINGUAS
AC_MSG_RESULT($LINGUAS)
fi
dnl Construct list of names of catalog files to be constructed.
if test -n "$LINGUAS"; then
for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
fi
fi
dnl Determine which catalog format we have (if any is needed)
dnl For now we know about two different formats:
dnl Linux libc-5 and the normal X/Open format
test -d intl || mkdir intl
if test "$CATOBJEXT" = ".cat"; then
AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
dnl Transform the SED scripts while copying because some dumb SEDs
dnl cannot handle comments.
sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
fi
dnl po2tbl.sed is always needed.
sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
$srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
dnl In the intl/Makefile.in we have a special dependency which makes
dnl only sense for gettext. We comment this out for non-gettext
dnl packages.
if test "$PACKAGE" = "gettext"; then
GT_NO="#NO#"
GT_YES=
else
GT_NO=
GT_YES="#YES#"
fi
AC_SUBST(GT_NO)
AC_SUBST(GT_YES)
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
dnl Try to locate is.
MKINSTALLDIRS=
if test $ac_aux_dir; then
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
fi
if test -z $MKINSTALLDIRS; then
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
fi
AC_SUBST(MKINSTALLDIRS)
dnl Generate list of files to be processed by xgettext which will
dnl be included in po/Makefile.
test -d po || mkdir po
if test "x$srcdir" != "x."; then
if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
posrcprefix="$srcdir/"
else
posrcprefix="../$srcdir/"
fi
else
posrcprefix="../"
fi
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
< $srcdir/po/POTFILES.in > po/POTFILES
])

View File

@@ -1,12 +0,0 @@
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
[AC_PREREQ([2.12])
AC_CONFIG_HEADER([$1])
dnl When config.status generates a header, we must update the stamp-h file.
dnl This file resides in the same directory as the config header
dnl that is generated. We must strip everything past the first ":",
dnl and everything past the last "/".
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl
changequote([,]))])

View File

@@ -1,20 +0,0 @@
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
# serial 1
dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version)
AC_DEFUN(AM_INIT_AUTOMAKE,
[AC_REQUIRE([AM_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
VERSION=[$2]
AC_SUBST(VERSION)
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AM_SANITY_CHECK
AC_ARG_PROGRAM
AC_PROG_MAKE_SET])

View File

@@ -1,13 +0,0 @@
## --------------------------------------------------------- ##
## Use AC_PROG_INSTALL, supplementing it with INSTALL_SCRIPT ##
## substitution. ##
## From Franc,ois Pinard ##
## --------------------------------------------------------- ##
# serial 1
AC_DEFUN(AM_PROG_INSTALL,
[AC_REQUIRE([AC_PROG_INSTALL])
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
AC_SUBST(INSTALL_SCRIPT)dnl
])

View File

@@ -1,14 +0,0 @@
# Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
# serial 1
AC_DEFUN(AM_LC_MESSAGES,
[if test $ac_cv_header_locale_h = yes; then
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
if test $am_cv_val_LC_MESSAGES = yes; then
AC_DEFINE(HAVE_LC_MESSAGES)
fi
fi])

View File

@@ -1,38 +0,0 @@
## ------------------------
## Emacs LISP file handling
## From Ulrich Drepper
## ------------------------
# serial 1
AC_DEFUN(AM_PATH_LISPDIR,
[# If set to t, that means we are running in a shell under Emacs.
# If you have an Emacs named "t", then use the full path.
test "$EMACS" = t && EMACS=
AC_PATH_PROG(EMACS, emacs xemacs, no)
if test $EMACS != "no"; then
AC_MSG_CHECKING([where .elc files should go])
dnl Set default value
lispdir="\$(datadir)/emacs/site-lisp"
if test "x$prefix" = "xNONE"; then
if test -d $ac_default_prefix/share/emacs/site-lisp; then
lispdir="\$(prefix)/share/emacs/site-lisp"
else
if test -d $ac_default_prefix/lib/emacs/site-lisp; then
lispdir="\$(prefix)/lib/emacs/site-lisp"
fi
fi
else
if test -d $prefix/share/emacs/site-lisp; then
lispdir="\$(prefix)/share/emacs/site-lisp"
else
if test -d $prefix/lib/emacs/site-lisp; then
lispdir="\$(prefix)/lib/emacs/site-lisp"
fi
fi
fi
AC_MSG_RESULT($lispdir)
ELCFILES="\$(ELCFILES)"
fi
AC_SUBST(lispdir)
AC_SUBST(ELCFILES)])

View File

@@ -1,22 +0,0 @@
# Add --enable-maintainer-mode option to configure.
# From Jim Meyering
# serial 1
AC_DEFUN(AM_MAINTAINER_MODE,
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default
AC_ARG_ENABLE(maintainer-mode,
[ --enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer],
USE_MAINTAINER_MODE=$enableval,
USE_MAINTAINER_MODE=no)
AC_MSG_RESULT($USE_MAINTAINER_MODE)
if test $USE_MAINTAINER_MODE = yes; then
MAINT=
else
MAINT='#M#'
fi
AC_SUBST(MAINT)dnl
]
)

View File

@@ -1,75 +0,0 @@
#serial 2
dnl From Jim Meyering.
dnl FIXME: this should migrate into libit.
AC_DEFUN(AM_FUNC_MKTIME,
[AC_REQUIRE([AC_HEADER_TIME])dnl
AC_CHECK_HEADERS(sys/time.h)
AC_CACHE_CHECK([for working mktime], am_cv_func_working_mktime,
[AC_TRY_RUN(
changequote(<<, >>)dnl
<</* Test program from Paul Eggert (eggert@twinsun.com)
and Tony Leneis (tony@plaza.ds.adp.com). */
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
static time_t time_t_max;
/* Values we'll use to set the TZ environment variable. */
static const char *const tz_strings[] = {
NULL, "GMT0", "JST-9", "EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
};
#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
static void
mktime_test (now)
time_t now;
{
if (mktime (localtime (&now)) != now)
exit (1);
now = time_t_max - now;
if (mktime (localtime (&now)) != now)
exit (1);
}
int
main ()
{
time_t t, delta;
int i;
for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
continue;
time_t_max--;
delta = time_t_max / 997; /* a suitable prime number */
for (i = 0; i < N_STRINGS; i++)
{
if (tz_strings[i])
putenv (tz_strings[i]);
for (t = 0; t <= time_t_max - delta; t += delta)
mktime_test (t);
mktime_test ((time_t) 60 * 60);
mktime_test ((time_t) 60 * 60 * 24);
}
exit (0);
}
>>,
changequote([, ])dnl
am_cv_func_working_mktime=yes, am_cv_func_working_mktime=no,
dnl When crosscompiling, assume mktime is missing or broken.
am_cv_func_working_mktime=no)
])
if test $am_cv_func_working_mktime = no; then
LIBOBJS="$LIBOBJS mktime.o"
fi
])

View File

@@ -1,15 +0,0 @@
dnl From Jim Meyering.
dnl FIXME: migrate into libit.
AC_DEFUN(AM_FUNC_OBSTACK,
[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
[AC_TRY_LINK([#include "obstack.h"],
[struct obstack *mem;obstack_free(mem,(char *) 0)],
am_cv_func_obstack=yes,
am_cv_func_obstack=no)])
if test $am_cv_func_obstack = yes; then
AC_DEFINE(HAVE_OBSTACK)
else
LIBOBJS="$LIBOBJS obstack.o"
fi
])

View File

@@ -1,42 +0,0 @@
# Search path for a program which passes the given test.
# Ulrich Drepper <drepper@cygnus.com>, 1996.
# serial 1
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
[# Extract the first word of "$2", so it can be a program name with args.
set dummy $2; ac_word=[$]2
AC_MSG_CHECKING([for $ac_word])
AC_CACHE_VAL(ac_cv_path_$1,
[case "[$]$1" in
/*)
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in ifelse([$5], , $PATH, [$5]); do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if [$3]; then
ac_cv_path_$1="$ac_dir/$ac_word"
break
fi
fi
done
IFS="$ac_save_ifs"
dnl If no 4th arg is given, leave the cache variable unset,
dnl so AC_PATH_PROGS will keep looking.
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
])dnl
;;
esac])dnl
$1="$ac_cv_path_$1"
if test -n "[$]$1"; then
AC_MSG_RESULT([$]$1)
else
AC_MSG_RESULT(no)
fi
AC_SUBST($1)dnl
])

View File

@@ -1,25 +0,0 @@
## ------------------------------- ##
## Check for function prototypes. ##
## From Franc,ois Pinard ##
## ------------------------------- ##
# serial 1
AC_DEFUN(AM_C_PROTOTYPES,
[AC_REQUIRE([AM_PROG_CC_STDC])
AC_BEFORE([$0], [AC_C_INLINE])
AC_MSG_CHECKING([for function prototypes])
if test "$am_cv_prog_cc_stdc" != no; then
AC_MSG_RESULT(yes)
AC_DEFINE(PROTOTYPES)
U= ANSI2KNR=
else
AC_MSG_RESULT(no)
U=_ ANSI2KNR=./ansi2knr
# Ensure some checks needed by ansi2knr itself.
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h)
fi
AC_SUBST(U)dnl
AC_SUBST(ANSI2KNR)dnl
])

View File

@@ -1,12 +0,0 @@
# From Ulrich Drepper.
# serial 1
AC_DEFUN(AM_TYPE_PTRDIFF_T,
[AC_CACHE_CHECK([for ptrdiff_t], am_cv_type_ptrdiff_t,
[AC_TRY_COMPILE([#include <stddef.h>], [ptrdiff_t p],
am_cv_type_ptrdiff_t=yes, am_cv_type_ptrdiff_t=no)])
if test $am_cv_type_ptrdiff_t = yes; then
AC_DEFINE(HAVE_PTRDIFF_T)
fi
])

44
m4/putenv.m4 Normal file
View File

@@ -0,0 +1,44 @@
#serial 1
dnl From Jim Meyering.
dnl
dnl Check whether putenv ("FOO") removes FOO from the environment.
dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
dnl
dnl If you use this macro in a package, you should
dnl add the following two lines to acconfig.h:
dnl /* Define to rpl_putenv if the replacement function should be used. */
dnl #undef putenv
dnl
AC_DEFUN(jm_FUNC_PUTENV,
[AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
[AC_TRY_RUN([
int
main ()
{
/* Put it in env. */
if (putenv ("CONFTEST_putenv=val"))
exit (1);
/* Try to remove it. */
if (putenv ("CONFTEST_putenv"))
exit (1);
/* Make sure it was deleted. */
if (getenv ("CONFTEST_putenv") != 0)
exit (1);
exit (0);
}
],
jm_cv_func_svid_putenv=yes,
jm_cv_func_svid_putenv=no,
dnl When crosscompiling, assume putenv is broken.
jm_cv_func_svid_putenv=no)
])
if test $jm_cv_func_svid_putenv = no; then
LIBOBJS="$LIBOBJS putenv.o"
AC_DEFINE_UNQUOTED(putenv, rpl_putenv)
fi
])

View File

@@ -1,37 +0,0 @@
## --------------------------------- ##
## Check if --with-regex was given. ##
## --------------------------------- ##
# serial 1
# The idea is to distribute rx.[hc] and regex.[hc] together, for a while.
# The WITH_REGEX symbol (which should also be documented in acconfig.h)
# is used to decide which of regex.h or rx.h should be included in the
# application. If `./configure --with-regex' is given (the default), the
# package will use gawk's regex. If `./configure --without-regex', a
# check is made to see if rx is already installed, as with newer Linux'es.
# If not found, the package will use the rx from the distribution.
# If found, the package will use the system's rx which, on Linux at least,
# will result in a smaller executable file.
AC_DEFUN(AM_WITH_REGEX,
[AC_MSG_CHECKING(which of GNU rx or gawk's regex is wanted)
AC_ARG_WITH(regex,
[ --without-regex use GNU rx in lieu of gawk's regex for matching],
[test "$withval" = yes && am_with_regex=1],
[am_with_regex=1])
if test -n "$am_with_regex"; then
AC_MSG_RESULT(regex)
AC_DEFINE(WITH_REGEX)
AC_CACHE_CHECK([for GNU regex in libc], am_cv_gnu_regex,
AC_TRY_LINK([], [extern int re_max_failures; re_max_failures = 1],
am_cv_gnu_regex=yes, am_cv_gnu_regex=no))
if test $am_cv_gnu_regex = no; then
LIBOBJS="$LIBOBJS regex.o"
fi
else
AC_MSG_RESULT(rx)
AC_CHECK_FUNC(re_rx_search, , [LIBOBJS="$LIBOBJS rx.o"])
fi
AC_SUBST(LIBOBJS)dnl
])

View File

@@ -1,19 +0,0 @@
#
# Check to make sure that the build environment is sane.
#
AC_DEFUN(AM_SANITY_CHECK,
[AC_MSG_CHECKING([whether build environment is sane])
echo timestamp > conftestfile
# Do this in a subshell so we don't clobber the current shell's
# arguments. FIXME: maybe try `-L' hack like GETLOADAVG test?
if (set X `ls -t $srcdir/configure conftestfile`; test "[$]2" = conftestfile)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
rm -f conftest*
AC_MSG_RESULT(yes)])

View File

@@ -1,69 +0,0 @@
## 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.
## From Jim Meyering.
## serial 1
## @defmac AC_FUNC_STRTOD
## @maindex FUNC_STRTOD
## @ovindex LIBOBJS
## If the @code{strtod} function is not available, or does not work
## correctly (like the one on SunOS 5.4), add @samp{strtod.o} to output
## variable @code{LIBOBJS}.
## @end defmac
AC_DEFUN(AM_FUNC_STRTOD,
[AC_CACHE_CHECK(for working strtod, am_cv_func_strtod,
[AC_TRY_RUN([
double strtod ();
int
main()
{
{
/* Some versions of Linux strtod mis-parse strings with leading '+'. */
char *string = " +69";
char *term;
double value;
value = strtod (string, &term);
if (value != 69 || term != (string + 4))
exit (1);
}
{
/* Under Solaris 2.4, strtod returns the wrong value for the
terminating character under some conditions. */
char *string = "NaN";
char *term;
strtod (string, &term);
if (term != string && *(term - 1) == 0)
exit (1);
}
exit (0);
}
], am_cv_func_strtod=yes, am_cv_func_strtod=no, am_cv_func_strtod=no)])
test $am_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o"
AC_SUBST(LIBOBJS)dnl
am_cv_func_strtod_needs_libm=no
if test $am_cv_func_strtod = no; then
AC_CHECK_FUNCS(pow)
if test $ac_cv_func_pow = no; then
AC_CHECK_LIB(m, pow, [am_cv_func_strtod_needs_libm=yes],
[AC_MSG_WARN(can't find library containing definition of pow)])
fi
fi
])

View File

@@ -1,14 +0,0 @@
dnl From Jim Meyering.
# serial 1
AC_DEFUN(AM_SYS_POSIX_TERMIOS,
[AC_CACHE_CHECK([POSIX termios], am_cv_sys_posix_termios,
[AC_TRY_LINK([#include <sys/types.h>
#include <unistd.h>
#include <termios.h>],
[/* SunOS 4.0.3 has termios.h but not the library calls. */
tcgetattr(0, 0);],
am_cv_sys_posix_termios=yes,
am_cv_sys_posix_termios=no)])
])

View File

@@ -1,35 +0,0 @@
dnl From Jim Meyering.
# serial 1
AC_DEFUN(AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL,
[AC_REQUIRE([AM_SYS_POSIX_TERMIOS])
AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
am_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
[am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
gwinsz_in_termios_h=no
if test $am_cv_sys_posix_termios = yes; then
AC_EGREP_CPP([yes],
[#include <sys/types.h>
# include <termios.h>
# ifdef TIOCGWINSZ
yes
# endif
], gwinsz_in_termios_h=yes)
fi
if test $gwinsz_in_termios_h = no; then
AC_EGREP_CPP([yes],
[#include <sys/types.h>
# include <sys/ioctl.h>
# ifdef TIOCGWINSZ
yes
# endif
], am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
fi
])
if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
fi
])

View File

@@ -1,3 +1,387 @@
1997-07-28 Jim Meyering <meyering@na-net.ornl.gov>
* configure.in (AC_OUTPUT): Remove tests/ls/Makefile.
Add tests/cp/Makefile and tests/mkdir/Makefile.
* lib/modechange.c (mode_create_from_ref): Don't use umask.
Don't use MODE_X_IF_ANY_X.
* src/install.c (main): New option --preserve-timestamps (-p).
(install_file_in_file): Preserve timestamps if requested.
(change_timestamps): New function.
(usage): Describe --preserve-timestamps.
Correct --mode description.
From Galen Hazelwood.
* src/install.c: Declare pointer parameters const as appropriate.
1997-07-13 Jim Meyering <meyering@na-net.ornl.gov>
* doc/Makefile.am (EXTRA_DIST): Remove explicit mention of texinfo.texi.
Now, automake includes it automatically.
1997-07-09 Jim Meyering <meyering@na-net.ornl.gov>
* tests/mkdir: New directory and associated files.
* tests/cp: New directory and associated files.
* tests/Makefile.am (SUBDIRS): Add cp and mkdir.
* lib/makepath.c (make_path): Chdir to `/' before starting if necessary.
Call save_cwd before while loop rather than from first iteration
inside it.
* lib/strverscmp.c (strverscmp): Add `parenentheses around arithmetic
in operand of |' as suggested by gcc -Wall.
1997-07-06 Jim Meyering <meyering@na-net.ornl.gov>
* lib/idcache.c (getuidbyname): Declare parameter to be const.
(getgidbyname): Declare parameter to be const.
1997-07-06 Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>
* lib/modechange.h (mode_create_from_ref): Add prototype.
(MODE_MASK_ALL): New define.
(MODE_BAD_REFERENCE): New define.
* lib/modechange.c (mode_create_from_ref): New function.
* lib/strverscmp.c: New file.
* lib/strverscmp.h: New file.
* lib/Makefile.am (noinst_HEADERS): Add strverscmp.h.
* configure.in (AC_REPLACE_FUNCS): Add strverscmp.
* src/ls.c: Add new option: --sort=version (-v).
* src/chgrp.c: Add new option: --reference=FILE.
* src/chown.c: Add new option: --reference=FILE.
* src/chmod.c: Add new option: --reference=FILE.
1997-07-06 Jim Meyering <meyering@na-net.ornl.gov>
* lib/idcache.c (getuser): Return NULL (rather than stringified uid)
upon lookup failure.
(getgroup): Likewise.
(getuidbyname) [NOT_USED]: #ifdef-out unused function.
(getgidbyname) [NOT_USED]: #ifdef-out unused function.
Suggested by François Pinard.
* src/ls.c (print_long_format): Reflect changes in semantics of
getuser, getgroup.
1997-07-04 Jim Meyering <meyering@na-net.ornl.gov>
* Makefile.am (aclocal-files): Look in source directory, not build dir.
From Andreas Schwab.
1997-07-03 Jim Meyering <meyering@na-net.ornl.gov>
* src/mv.c (apply_attributes): New function.
(copy_reg): Use apply_attributes instead of open-coding the pieces.
Now, failure to preserve file attributes does not cause mv to change
its exit status, and such failures elicit warning diagnostics. This
behavior is required by POSIX. Before, failure to preserve ownership
due to insufficient access was diagnosed only for root.
Prompted by a report from Bengt Martensson.
Tue Jul 1 06:42:17 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/makepath.c (make_path): Reorder stat-then-mkdir-if-missing
calls so that mkdir is called first. Before make_path would first
`stat' a directory, then call mkdir if it didn't exist. But if
some other process created the directory between the stat & mkdir,
the mkdir would fail with EEXIST. Diagnosis and suggestion from
Greg McGary.
Sun Jun 29 17:19:30 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/dd.c (copy): Add FIXME comment.
* src/mv.c (copy_reg): New parameter, SOURCE_STATS.
(do_move): Update caller.
Sun Jun 22 08:32:46 1997 Jim Meyering <meyering@na-net.ornl.gov>
Use variable width columns when printing in multi-column mode.
* src/ls.c: (init_col_info): New function.
(print_current_files): Call init_col_info if format is
`many_per_line' or `horizontal'.
(print_many_per_line): Calculate and apply optimum column widths.
(print_horizontal): Likewise.
From Ulrich Drepper.
* src/mv.c (movefile): Take new boolean parameter, DEST_IS_DIR,
to save a stat per moved file when the destination is a directory.
(main): Call movefile with additional argument.
(strip_trailing_slashes_2): New function.
(movefile): Remove trailing slashes from dest. Otherwise, stat ("b/")
fails with ENOTDIR on systems including Linux w/libc 2.0.30.
Reproduce with `rm -rf a b; mkdir a; touch b; ./mv a b/'.
(do_move): Fix misleading comment.
Sat Jun 21 21:26:57 1997 Jim Meyering <meyering@na-net.ornl.gov>
* configure.in: Remove now-unused definitions of LN, MV, RM.
Sun Jun 15 07:04:29 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/full-write.c (full_write): Add comment regarding failure due
to bug in Linux Slackware 1.2.13 kernel.
* lib/makepath.c: Rewrite using save-cwd.c and chdir to remove
quadratic component of complexity. Before, it processed O(n^2)
directory name components via stat and mkdir. Now it's O(n).
This makes mkdir -p a lot more efficient when creating directories
with very many components. On a Linux 2.0.30 ext2fs filesystem
this command: mkdir -p `perl -e 'print "a/" x 500'` now runs in
0.77 seconds (user+sys). Contrast that with the 9.5(!) seconds
it took before.
Sat Jun 14 11:40:17 1997 Jim Meyering <meyering@na-net.ornl.gov>
* man/Makefile.am: (EXTRA_DIST): Put man_MANS here so they are
distributed. This is necessary for automake-1.1p.
Tue Jun 3 15:00:00 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/fileblocks.c [HAVE_UNISTD_H]: Include unistd.h.
John Gatewood Ham reported that this is necessary for DJGPP/Win95.
Wed May 28 06:35:56 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/mountlist.c (read_filesystem_list): Add `|| defined (__OpenBSD__)'
to the NetBSD #if so OpenBSD also uses the f_fstypename member.
(fstype_to_string): Add `&& !defined (__OpenBSD__)' to the NetBSD #if
expression to exclude this function definition. OpenBSD 2.1 beta
doesn't need it. Patch from Hugh Daniel <hugh@ecotone.xanadu.com>
Tue May 27 04:35:17 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/cp.c: Use base_name, not basename.
* src/dircolors.c: Likewise.
* src/install.c: Likewise.
* src/ln.c: Likewise.
* src/mv.c: Likewise.
* src/mvdir.c: Likewise.
* src/rm.c: Likewise.
* configure.in: Add AC_SYS_LONG_FILE_NAMES.
Check for pathconf.
Don't replace basename. Now we use only base_name.
Clean up kludge that worked around a bug (now-fixed) in automake.
* lib/argmatch.h Change dcl of program_name so it doesn't conflict
with the ubiquitous char* one.
* lib/addext.c: New file.
* lib/Makefile.am (libfu_a_SOURCES): Add addext.c.
Remove getversion.c; get_version is now in backupfile.c.
Add basename.c since it's no longer replacible.
* lib/getopt.c: Update from glibc via patch-2.2.93.
* lib/getopt1.c: Likewise.
* lib/getopt.h: Likewise.
* lib/argmatch.h: Update from FSF via patch-2.2.93.
* lib/argmatch.c: Likewise.
* lib/backupfile.c: Likewise.
* lib/backupfile.h: Likewise.
* lib/basename.c: Likewise.
Sun May 25 09:21:01 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/copy.c (copy_internal): When preserving symlinks
(--no-dereference) and the destination file is a symlink,
use stat (not xstat) to see if it points back to the source.
Reported by James <james@albion.glarp.com>.
* src/du.c: Remove global variable opt_human_readable.
(enum Output_units): Rename from output_size.
Rename size_* to Unit_*.
Add Unit_variable to correspond to --human-readable.
(convert_blocks): Remove now-unused definition.
(human_readable): Rename paramater n_bytes to n_blocks.
Adjust conversions to reflect fact that input is now number of
512-byte blocks, not bytes.
(print_size): New function.
(du_files): Use print_size instead of open coding it.
(count_entry): Always count in units of 512-byte blocks to delay.
This lets du accumulate totals corresponding to a terabyte before
overflowing 32-bit long int.
Use print_size instead of open coding it.
Tue Feb 4 11:58:49 1997 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* src/du.c (convert_blocks): Remove now-unnecessary #undef.
(du_files): Pass output_size unchanged to convert_blocks. No need
to test output_size for size_bytes, convert_blocks handles that
correctly.
(count_entry): Likewise.
* src/system.h (convert_blocks): Remove definition.
* src/ls.c (convert_blocks): Add definition.
Sun May 25 09:11:17 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/du.c [AIX]: Remove unused #pragma alloca.
Sat May 24 09:20:12 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/rmdir.c: New options: --ignore-fail-on-non-empty and --verbose.
(remove_parents): Implement new options.
(main): Likewise.
* lib/mountlist.c (read_filesystem_list): Show automount-related
duplicate filesystems only when --all specified. With suggestions
from Stuart Kemp. Also indent cpp directives.
* configure.in (AC_CHECK_FUNCS): Add hasmntopt.
(AC_CHECK_HEADERS): Add sys/mntent.h.
(ALL_LINGUAS): Add Czech (cs).
Wed Mar 26 23:43:57 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/du.c (main): Implement new --max-depth=N option.
Based on the idea and a patch from Torbjorn Lindgren.
(du_files): Likewise.
(count_entry): Likewise.
Sat Mar 22 20:29:10 1997 Jim Meyering <meyering@na-net.ornl.gov>
* missing: New file -- from the automake-1.1m distribution.
Fri Mar 21 23:58:12 1997 Jim Meyering <meyering@na-net.ornl.gov>
* Makefile.am (AUTOMAKE_OPTIONS): Require automake-1.1l.
(aclocal.m4): Use aclocal's new -I option.
Thu Mar 13 21:27:36 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/mktime.c: (TIME_T_MIN): Work around a bug in Cray C 5.0.3.0.
Wed Mar 12 23:11:11 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/chgrp.c (change_file_group): Use uid of -1 to indicate
we don't want to change the file's user ID.
* m4/gettext.m4: Update from gettext-0.10.27.
* acconfig.h (chown): Add #undef.
* configure.in (ALL_LINGUAS): Add ko.
Use jm_FUNC_CHOWN.
* m4/chown.m4: New file.
* m4/Makefile.am (EXTRA_DIST): Add chown.m4.
* lib/chown.c: New file.
* lib/Makefile.am (EXTRA_DIST): Add chown.c.
Sun Mar 9 22:46:41 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/ls.c (decode_switches): Ignore value of COLUMNS envionment
variable when it is the empty string. Suggestion from Ulrich Drepper.
This makes it easier on people using shells (which?) with which it
is not easy to unset environment variables.
Wed Feb 26 23:46:39 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/getdate.y: (tYEAR_UNIT): Increase yyRelYear by $1, not just by 1.
From Andreas Schwab.
* src/copy.c (copy_internal): When there is any potential for
ambiguity in a diagnostic, give explanatory diagnostic in addition
to file name.
* src/cp.c (re_protect): Likewise.
Sat Feb 22 14:10:25 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/getdate.y
(tMONTH_UNIT): Increase yyRelMonth by $1, not just by 1.
(tDAY_UNIT): Likewise for yyRelDay.
(tHOUR_UNIT): Likewise for yyRelHour.
(tMINUTE_UNIT): Likewise for yyRelMinutes.
(tSEC_UNIT): Likewise for yyRelSeconds.
Matthew S. Levine reported that touch -d yesterday didn't work.
Thu Feb 20 20:16:59 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/mktime.c: Update from libc.
* lib/strtol.c: Update from libc.
Wed Feb 19 22:06:32 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/ls.c (main): Remove trailing slashes from command line arguments.
Otherwise, running `mkdir x; chmod 644 x; ls -d x/' (note the trailing
slash) makes ls fail with permission denied on at least Linux 1.2.13
and 2.0.14 systems.
Wed Feb 5 21:54:17 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/ls.c (quote_filename): Allocate two more bytes (for quotes)
when using --quote-name (-Q).
Feb 2 change wasn't complete. Patch from Mark Harris.
Mon Feb 3 21:49:55 1997 Jim Meyering <meyering@na-net.ornl.gov>
* po/POTFILES.in: Add copy.c and cp-hash.c. Remove cp-aux.c.
Sun Feb 2 09:40:37 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/system.h [__GNUC__]: Don't define alloca to __builtin_alloca.
* Makefile.am (SUBDIRS): Add tests.
* configure.in (AC_OUTPUT): Add tests/Makefile and tests/ls/Makefile.
* tests: New directory.
* tests/ls: New directory.
* src/ls.c (quote_filename): Don't backslash-escape double quotes.
This fixes a problem whereby columns weren't aligned when some files
contained double quote characters and ls's --escape (-b) option was
used. Reported by Mark Harris.
* src/cp-hash.c (struct entry): Move dcl to this file from cp.h.
(struct htab): Likewise.
No longer include cp.h. Instead, include the things it used to
include.
(hash_insert2): Make function static. Move this function to precede
the sole function from which it is called.
* src/Makefile.am (noinst_HEADERS): Add copy.h, cp-hash.h.
Remove cp.h.
(EXTRA_DIST): Remove cp-aux.c and cp-hash.c.
(cp_SOURCES): Remove cp-aux.c. Add cp-hash.c.
* src/cp-aux.c: Remove file.
* src/cp.h: Remove file.
* src/du.c (hash_insert2): Rename local HTAB to HT to avoid shadowing
global.
* src/dircolors.c [obstack_chunk_alloc]: Define to malloc, not xmalloc
to work better with new obstack functions.
* src/ls.c (obstack_chunk_alloc): Likewise.
* src/df.c (main): Rename local I to C to avoid shadowing and to
be more consistent. Declare I in inner scopes.
* po/Makefile.in.in (POTFILES): Redirect to an intermediate file
and write-protect POTFILES.
Fri Jan 31 21:13:04 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/chown.c (usage): Make the parenthetical note on --no-dereference
a little more general.
* src/*.c: Compare getopt_long return value against -1, not EOF.
Use NULL, not `(int *) 0' as last parameter in getopt_long call.
(usage): Bracket bug-reporting address with <> and append a period.
1997-01-27 Paul Eggert <eggert@twinsun.com>
* src/ls.c (print_long_format): Fix off-by-one problem in size
being passed to strftime.
Sun Jan 26 20:17:50 1997 Jim Meyering <meyering@na-net.ornl.gov>
* Version 3.16.
* acconfig.h (strftime): Add #undef. From Marcus Daniels.
Sat Jan 25 00:34:39 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/du.c (count_entry): Fix blatant bug (typo?) that made
@@ -5037,7 +5421,5 @@ Mon Feb 5 17:29:20 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
* Version 1.0 released.
Local Variables:
mode: indented-text
left-margin: 8
version-control: never
End:

View File

@@ -1,5 +1,15 @@
Changes in release 3.17:
[3.16a]
* install accepts new option, --preserver-timestamps
* du --megabytes --total now shows total in megabytes
* touch -d DATE now works on Unicos
* du accepts new option --max-depth=N
* rmdir accepts new options: --ignore-fail-on-non-empty and --verbose
* du now overflows its accumulator for 1 terabyte directories, not 2GB.
* df now works with OpenBSD 2.1 beta
* cp -d FILE SYMLINK-TO-FILE doesn't erase FILE. Now it gives an error.
Changes in release 3.16:
[3.15a]
* du --megabytes (-m) works
* ls -l works even on systems with non-POSIX strftime in their C library

View File

@@ -1,3 +1,321 @@
1997-08-02 Jim Meyering <meyering@na-net.ornl.gov>
* src/Makefile.am (bin_PROGRAMS): Add pinky.
* src/pinky.c: New file. From Kaveh Ghazi.
1997-07-19 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* src/date.c (show_date): Don't hang if strftime produces an empty
string.
1997-07-16 Jim Meyering <meyering@na-net.ornl.gov>
* src/groups.sh: Exit with status from subsidiary `id' command.
Don't print `$name : $groups' if id fails.
Reported by Austin Donnelly.
1997-07-15 Jim Meyering <meyering@na-net.ornl.gov>
* lib/getloadavg.c: Merge in changes from FSF.
1997-07-13 Jim Meyering <meyering@na-net.ornl.gov>
* doc/Makefile.am (EXTRA_DIST): Remove explicit mention of texinfo.texi.
Now, automake includes it automatically.
1997-07-12 Jim Meyering <meyering@na-net.ornl.gov>
* po/Makefile.in.in (DISTFILES): Remove ChangeLog.
* po/POTFILES.in: Add who.c, users.c, uptime.c.
Remove who-users.c.
* src/who.c: Rename lots of `this' locals.
Make some parameters `const'.
(who): Update read_utmp caller.
(search_entries): Take additional param: utmp_buf.
Update read_utmp caller.
(who_am_i): Update read_utmp caller.
* src/users.c (users): Update read_utmp caller.
* src/uptime.c (uptime): Update read_utmp caller.
* lib/readutmp.h (PARAMS): Update prototype.
(utmp_contents): Remove dcl.
* lib/readutmp.c (read_utmp): Take new params: count and buffer.
Return boolean indicating failure.
Now, caller must give diagnostic upon.
1997-07-12 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* lib/readutmp.c, lib/readutmp.h: New files implementing shared
functionality from src/who-users.c.
* lib/Makefile.am (libsu_a_SOURCES): Add readutmp.c.
(noinst_HEADERS): Add readutmp.h.
* src/who.c, src/users.c, src/uptime.c: Split these so they no
longer derive from the template source file who-users.c. Use
shared functionality from lib/readutmp.c instead.
* src/Makefile.am: Remove rules to build who.c, users.c and
uptime.c from template source file who-users.c. Handle these
files as stand-alone sources.
* src/who-users.c: Remove file. It is no longer used.
1997-07-12 Jim Meyering <meyering@na-net.ornl.gov>
* src/date.c (MAYBE_SET_TZ_UTC0): New macro.
(set_tz): New function.
(batch_convert): If necessary, save the initial value of TZ and
for each date in the file, restore it before each call to get_date,
then set it to UTC0 before each show_date call.
(main): Don't set TZ before calling get_date.
Set TZ after get_date call and before show_date call.
Reported by Matthew Braun.
* tests/date/Test.pm: Add new tests for this bug.
Add tests based on new examples in documentation.
* stpcpy.c: New file.
* configure.in (AC_REPLACE_FUNCS): Add stpcpy.c
1997-07-05 Jim Meyering <meyering@na-net.ornl.gov>
* src/Makefile.am (EXTRA_PROGRAMS): Add su here.
(bin_PROGRAMS): Remove su here.
(install-exec-local): Rewrite rule so that su is installed only if
it can be made setuid root. Before it was always installed and then
removed if it could *not* be made setuid root. That had the potential
undesirable side effect of removing (and not replacing) a working
version of su.
(all_local): New target. Dependend on su. Required now that su is
no longer in bin_PROGRAMS.
(uninstall-local): Remove su only if it comes from the GNU sh-utils.
* src/su.c: Redefine/undef getusershell around inclusion of <unistd.h>
(via system.h) so Cray's int-returning prototype doesn't conflict
with our char*-returning one. Reported by Johan Danielsson.
1997-07-04 Jim Meyering <meyering@na-net.ornl.gov>
* tests/Makefile.am.in (Makefile.am): Clean up and enable rule to
generate tests/*/Makefile.am.
* configure.in (ALL_LINGUAS): Add Norwegian (no).
* tests/date/mk-script.pl (validate): Create test files in $(srcdir),
not in build dir.
* tests/Makefile.am.in ($x-tests): Create $x-tests in $(srcdir),
not in build dir.
* Makefile.am (aclocal-files): Look in source directory, not build dir.
From Andreas Schwab.
1997-07-03 Jim Meyering <meyering@na-net.ornl.gov>
* tests/date/Test.pm (test_vector): Remove bogus TZ=GMT environment
setting.
Wed Jul 2 11:05:09 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/printf.c (STRTOX): Convert function header in macro definition
to K&R-style. Otherwise, ansi2knr would fail to convert the function
definitions to K&R for old style compilers. From Kaveh Ghazi.
Tue Jul 1 06:28:00 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/putenv.c [putenv]: Undefine before including system headers.
Otherwise, the declaration of *rpl_putenv* conflicts with the system
prototype on at least Irix5.3. From Marcus Daniels.
Sun Jun 29 07:18:25 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/putenv.c (rpl_putenv): Renamed from putenv.
[putenv]: Remove definition and subsequent #undef hack that avoided
conflicts with system prototypes. That didn't let the definition of
putenv to rpl_putenv from config.h get through.
Suggestion from Marcus Daniels.
* configure.in (LIB_CRYPT): AC_SUBST new variable. Use it to add
crypt-related library (-lufc or -lcrypt) only for the program that
needs it (su), rather than to all executables.
* src/Makefile.am (su_LDADD): Set to `$(LDADD) @LIB_CRYPT@'.
Suggestion from Ulrich Drepper.
* tests/date/mk-script.pl: Set and export LANGUAGE, LC_ALL, and LANG
so tests get english strings. From Ulrich Drepper.
Mon Jun 16 11:06:57 1997 Jim Meyering <meyering@na-net.ornl.gov>
* m4/putenv.m4 (jm_FUNC_PUTENV): New file and macro.
* configure.in (jm_FUNC_PUTENV): Use it.
* acconfig.h (putenv): Add #undef.
* lib/Makefile.am (EXTRA_DIST): Add putenv.c.
(libsu_a_SOURCES): Remove putenv.c.
* m4/Makefile.am (EXTRA_DIST): Add putenv.m4.
Thu Jun 12 06:48:23 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/expr.c (eval6): Accept new unary operator, quote.
From Karl Heuer.
Wed Jun 11 15:13:56 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/expr.c (docolon): Test (re_buffer.re_nsub > 0) rather than
searching for `\(' to determine whether to return 0 or the empty
string. Before it would improperly return '' if the pattern
contained a substring like this: `\\('. From Karl Heuer.
For example, running expr c : '\\(' should print `0'.
Sun Jun 1 12:00:10 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/getdate.y (OtherTable): Interpret `next' as 1 (not 2) units.
Patch from Richard Sharman <rsharman@magmacom.com>.
* tests/date/Test.pm: Add tests using `next'.
Tue May 27 06:08:06 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/basename.c: Don't include backupfile.h.
* lib/Makefile.am (noinst_HEADERS): Add backupfile.h.
* src/basename.c: Use base_name, not basename.
* src/su.c: Use base_name, not basename.
* configure.in: Don't replace basename. Now it's always required.
* lib/Makefile.am (libsu_a_SOURCES): Add basename.c.
* lib/getopt.c: Update from glibc via patch-2.2.93.
* lib/getopt1.c: Likewise.
* lib/getopt.h: Likewise.
* lib/basename.c: Likewise.
Sat May 24 13:26:04 1997 Jim Meyering <meyering@na-net.ornl.gov>
* man/Makefile.am (EXTRA_DIST): Put man_MANS here so they are
distributed. This seems to be necessary for automake-1.1p.
Thu May 1 00:10:11 1997 Jim Meyering <meyering@na-net.ornl.gov>
* ansi2knr.c echo.c factor.c hostname.c id.c nice.c pathchk.c
spline.c test.c uname.c: Indent cpp-directives.
* src/system.h (N_): Define.
Sun Apr 27 18:30:53 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/printf.c: (cfcc_msg): File-scope constant.
(STRTOX): Use new constant as error message format string in macro.
Suggestion from Andreas Schwab.
(STRTOX): Don't fail because of extra character(s) following a
character constant. Give the *warning* only if !POSIXLY_CORRECT.
Sun Apr 6 14:29:14 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/printf.c: Reorder functions to obviate forward decls.
Change most char* dcls to const char*.
(STRTOX): New macro to eliminate code duplication.
(xstrtod, xstrtol, xstrtoul): Remove functions.
Use the STRTOX instead.
* src/printf.c: (STRTOX): Interpret arguments like 'a and "a
as POSIX requires. Derived from a patch by Dennis Henriksen.
Sun Mar 23 15:20:17 1997 Jim Meyering <meyering@na-net.ornl.gov>
* configure.in (ALL_LINGUAS): Add polish (pl).
Sat Mar 22 00:03:02 1997 Jim Meyering <meyering@na-net.ornl.gov>
* Makefile.am (AUTOMAKE_OPTIONS): Require automake-1.1l.
(aclocal.m4): Use aclocal's new -I option.
* missing: New file -- from the automake-1.1m distribution.
Thu Mar 20 21:10:44 1997 Jim Meyering <meyering@na-net.ornl.gov>
* m4/ccstdc.m4: Remove file.
* m4/init.m4: Likewise.
* m4/sanity.m: Likewise.
* m4/protos.m: Likewise.
* m4/dmalloc.m4: Likewise.
* m4/error.m4: Likewise.
* m4/header.m4: Likewise.
* m4/install.m4: Likewise.
* m4/lispdir.m4: Likewise.
* m4/maintainer.m4: Likewise.
* m4/obstack.m4: Likewise.
* m4/ptrdiff.m4: Likewise.
* m4/regex.m4: Likewise.
* m4/strtod.m4: Likewise.
* m4/termios.m4: Likewise.
* m4/winsz.m4: Likewise.
Tue Mar 18 06:46:54 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/su.c: Indent cpp-directives to reflect nesting.
Change a few #ifdef to #if.
Remove 3 spurious #ifdef that were guarding an #undef each.
* src/seq.c (check_format): Rename local, FORMAT_STRING, to avoid
shadowing global.
(print_numbers): Likewise.
* src/who-users.c (idle_string): Rename local, IDLE, to avoid
shadowing global.
* src/su.c (log_su): Resort to getpwuid if getlogin fails.
If no tty name is found, use `none' in the log message.
Based on a patch from Galen Hazelwood.
Thu Mar 13 21:27:36 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/mktime.c: (TIME_T_MIN): Work around a bug in Cray C 5.0.3.0.
Wed Feb 19 23:06:46 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/factor.c (factor): Rewrite inner loop to be more efficient.
Patch from Torbjorn Granlund.
Tue Feb 18 21:18:04 1997 Jim Meyering <meyering@na-net.ornl.gov>
* tests/date/Test.pm: Add tests for %U, %V, and %W and for a bug
fixed on 1996-03-05.
Remove misleading `-' from leap-1 test.
* tests/Makefile.am (SUBDIRS): Add factor.
* tests/factor: New directory.
* configure.in (AC_OUTPUT): Add tests/factor/Makefile.
Tue Feb 4 22:03:13 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/stty.c: Bracket inclusion of termios.h with #if HAVE_TERMIOS_H.
Masami Takikawa reported that NeXTStep 3.0 doesn't have termios.h.
* configure.in (AC_CHECK_HEADERS): Add termios.h.
Fri Jan 31 21:13:13 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/*.c (usage): Bracket bug-reporting address with <> and append
a period.
* src/*.sh: Likewise.
* src/*.c: Compare getopt_long return value against -1, not EOF.
Use NULL, not `(int *) 0' as last parameter in getopt_long call.
Mon Jan 27 21:43:50 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/chroot.c (usage): Remove one space in message to make
colons line up.
Sun Jan 26 12:51:05 1997 Jim Meyering <meyering@na-net.ornl.gov>
* Version 1.16.
* src/who-users.c (usage): Fix typo (--writeable -> --writable)
in help output. From Galen Hazelwood.
Sat Jan 25 21:01:13 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/factor.c (print_factors): Reflect changes to xstrtoul interface.

View File

@@ -1,6 +1,25 @@
Changes in release 1.17
* pinky: new lightweight finger-style program
[1.16d]
* the groups script now exits non-zero and doesn't print anything more
when `id' fails
[1.16c]
* date -u -d DATE now prints the correct date
* don't remove already-installed su unless it is possible to install the
new one setuid root.
[1.16b]
[1.16a]
* expr accepts new unary operator, quote.
* expr now returns 0 for failed matches where pattern contained e.g., `\\('
* date -d DATE now works on Unicos systems
* add tests for factor and more for date.
* factor runs a lot faster for large 64-bit inputs
* date works with relative offsets involving the `next' keyword
Changes in release 1.16
1.15a
* stty -tabs works properly
* add tests for date
* date --date "02/29/1996 - 1 year" now works properly
Changes in release 1.15
* nice works with very recently-changed GNU libc getopt

View File

@@ -1,3 +1,196 @@
1997-07-21 Jim Meyering <meyering@na-net.ornl.gov>
* src/tail.c (parse_obsolescent_option): #ifdef-out portability warning.
1997-07-19 Jim Meyering <meyering@na-net.ornl.gov>
* src/sort.c (checkfp): Print the `disorder' message. Include both
the number and the contents of the first out-of-order line, in addition
to the file name. Change meaning of return value.
(check): Don't print disorder message here.
Adjust test of checkfp's return value.
Feature suggestion from Karl Heuer.
1997-07-13 Jim Meyering <meyering@na-net.ornl.gov>
* doc/Makefile.am (EXTRA_DIST): Remove explicit mention of texinfo.texi.
Now, automake includes it automatically.
* src/head.c: Include xstrtoul.h.
Remove global variable, unit_size.
(atou): Remove now-unused function.
(parse_unit): Likewise.
(string_to_ull): New function.
(head): Take new parameter, count_lines. Use it instead of unit_size.
Update callers.
(head_file): Likewise.
(main): Use string_to_ull, not atou/parse_unit.
The problem was that overflow wasn't detected, so `head -c 4096m'
was treated just like `head -c 0'.
Reported by Jerome Abela.
* tests/wc: New directory.
* tests/head: New directory.
* tests/Makefile.am (SUBDIRS): Add head and wc.
* configure.in (AC_OUTPUT): Add tests/head/Makefile and
tests/wc/Makefile.
1997-07-05 Jim Meyering <meyering@na-net.ornl.gov>
* src/tail.c (parse_obsolescent_option): If POSIXLY_CORRECT is set, give
a diagnostic and fail when there are two or more non-option arguments.
1997-07-04 Jim Meyering <meyering@na-net.ornl.gov>
* tests/tac/mk-script.pl: Redirect output of cmp to /dev/null.
* configure.in (ALL_LINGUAS): Add Norwegian (no).
* Makefile.am (aclocal-files): Look in source directory, not build dir.
From Andreas Schwab.
Sun Jun 15 06:36:41 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/pr.c (init_header) [T_BUF_FMT]: Output the 4-digit year (not the
2-digit abbreviation) in each page header. Reported by Noah Friedman.
Sat Jun 14 12:29:12 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/cut.c (cut_fields): Detect when the input is empty and handle
that special case. Before `cut -f1 < /dev/null' would improperly
output a single newline. Reported by Phil Richards.
Sun Apr 27 15:10:58 1997 Jim Meyering <meyering@na-net.ornl.gov>
* man/Makefile.am (DISTFILES): Add $(man_MANS).
* configure.in (ALL_LINGUAS): Add Czech (cs) and Swedish (sv).
Thu Apr 3 21:14:02 1997 Jim Meyering <meyering@na-net.ornl.gov>
* m4/Makefile.am (EXTRA_DIST): Update file list.
* tests/cut-test/Test.pm: Add test from Phil Richards.
Sat Mar 22 20:29:10 1997 Jim Meyering <meyering@na-net.ornl.gov>
* missing: New file -- from the automake-1.1m distribution.
Fri Mar 21 23:56:41 1997 Jim Meyering <meyering@na-net.ornl.gov>
* Makefile.am (AUTOMAKE_OPTIONS): Require automake-1.1l.
(aclocal.m4): Use aclocal's new -I option.
Thu Mar 13 21:46:04 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/tr.c (main): Make sure c1 is not -1 before using it as an
array index. Patch from Greg McGary. Although this is truly a
bug, I believe it would not cause tr to misbehave on most systems.
I could not construct a test case with which this bug causes tr
to generate invalid output.
* tests/pr-test/Test.pm: Add test that -o 0 works.
* src/pr.c (main): Allow use of 0 (zero) as the margin offset
argument to the -o option. Patch from Gary Anderson.
Fri Feb 28 22:32:51 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/uniq.c (usage): Fix typo in --help output. From Andreas Schwab.
Tue Feb 25 20:34:51 1997 Jim Meyering <meyering@na-net.ornl.gov>
* lib/Makefile.am (noinst_HEADERS): Add obstack.h.
(libtu_a_SOURCES): Add obstack.c.
Sun Feb 16 08:30:29 1997 Jim Meyering <meyering@na-net.ornl.gov>
* tests/Makefile.am (SUBDIRS): Add tac.
* tests/tac: New directory.
* configure.in (AC_OUTPUT): Add tests/tac/Makefile.
* tests/pr-test/{tt-0FF, tt-bl, tta3-0FF, ttb3-0FF, tt-FF, tt-t,
tta3-FF, ttb3-FF}: New files. Renamed (s/T/tt/) to avoid name clashes
on case-independent filesystems.
* tests/pr-test/Test.pm (Tests '7.*'): Reflect file-renaming.
* src/tail.c (parse_obsolescent_option): Reverse order of args in
diagnostic. Remove `' quotes in diagnostic.
(parse_options): Remove `' quotes in diagnostic.
Sat Feb 8 22:43:45 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/tail.c (parse_obsolescent_option): Give warning diagnostic for
(but now accept) obsolescent usage with more than one file argument.
Sun Feb 2 23:06:59 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/join.c: Move alloca-related preprocessor code into system.h.
* src/od.c: Remove alloca-related preprocessor code.
* src/system.h: Add alloca-related preprocessor code.
Sat Feb 1 07:21:43 1997 Jim Meyering <meyering@na-net.ornl.gov>
* tests/pr-test/*: Rename files to avoid exceeding 14-character limit.
* tests/pr-test/Test.pm: Reflect renamings.
* tests/pr-test/mk-script.pl (spec_to_list): Warn about all filenames
that exceed max-length before dying.
* src/pr.c (init_parameters): For compatibility: use default
separator `TAB' with full length lines. From Roland Huebner.
Fri Jan 31 19:53:54 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/tac.c: Rename globals buffer and buffer_size to have G_ prefix
to avoid shadowing local variables.
* lib/long-options.c (parse_long_options): Compare getopt_long return
value against -1, not EOF. Use NULL, not `(int *) 0' as last parameter
in getopt_long call.
* src/pr.c (add_line_number): Rename from `number' to avoid shadowing
local variables.
* src/*.c: Compare getopt_long return value against -1, not EOF.
Use NULL, not `(int *) 0' as last parameter in getopt_long call.
(usage): Bracket bug-reporting address with <> and append a period.
Wed Jan 29 20:54:24 1997 Jim Meyering <meyering@na-net.ornl.gov>
* tests/tr-test/Test.pm: Do each test twice: get input via REDIR
and PIPE.
* tests/tail/Test.pm (test_vector): Do each (non-stdin-requiring)
test three times.
* tests/pr-test/Test.pm: Remove common_option_prefix flag.
(test_vector): Prepend the common option here instead.
* tests/md5sum-test/Test.pm: Remove input_via_stdin flag.
Do each test twice: get input via REDIR and PIPE.
* tests/cut-test/Test.pm: Do each test three times.
* tests/cut-test/mk-script.pl: Allow each test to be run any or all
of three different ways. Program input may be specified via a file
or files listed on the command line, via input redirection (if there's
only one file), or via a pipe.
Tue Jan 28 20:54:06 1997 Jim Meyering <meyering@na-net.ornl.gov>
* tests/cut-test/mk-script.pl: Remove `t' prefix on all generated
test file names.
Change suffixes from (.in, .exp, .out, .err) to (.I, .X, .O, .E).
Ensure that no test file (generated or maintainer-supplied) has a
name longer than 14 characters.
Sun Jan 26 12:49:50 1997 Jim Meyering <meyering@na-net.ornl.gov>
* Version 1.22.
* src/tail.c (parse_options): Add quotes to make messages identical.
Sat Jan 25 00:12:29 1997 Jim Meyering <meyering@na-net.ornl.gov>
* src/tail.c (parse_obsolescent_option): Comment.
@@ -3988,7 +4181,5 @@ Sat Dec 16 15:15:50 1989 David J. MacKenzie (djm at hobbes.ai.mit.edu)
Local Variables:
mode: indented-text
left-margin: 8
version-control: never
End:

View File

@@ -1,3 +1,17 @@
Changes in release 1.23
[1.22a]
* sort -c reports both the number and the contents of the first out-of-order
line, in addition to the file name.
* `head -c 4096m' is no longer treated just like `head -c 0'
now it gets a diagnostic about 4096m being too large.
* pr: For compatibility (also more POSIX compliant): Include default
separator `TAB' when merging lines of full length.
* When POSIXLY_CORRECT is not set, tail -N now accepts more than one file
argument (but warns that it's not portable), to be consistent with the
way head -N works. If POSIXLY_CORRECT is set, using two or more file
arguments with the obsolescent form (-N) evokes an error. To avoid the
warning or failure, use the POSIX -n N option or the GNU --lines=N option.
Changes in release 1.22
[1.21a]
* Fix a bug in tail when invoked with an argument like `+NUMBERc'

View File

@@ -1,5 +1,5 @@
# Makefile for program source directory in GNU NLS utilities package.
# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
# Copyright (C) 1995, 1996, 1997 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
@@ -55,7 +55,7 @@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
SOURCES = cat-id-tbl.c
POFILES = @POFILES@
GMOFILES = @GMOFILES@
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
DISTFILES = Makefile.in.in POTFILES.in $(PACKAGE).pot \
stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
POTFILES = \
@@ -207,6 +207,7 @@ distclean: clean
maintainer-clean: distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
rm -f $(GMOFILES)
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
dist distdir: update-po $(DISTFILES)
@@ -240,9 +241,12 @@ POTFILES: POTFILES.in
else \
posrcprefix="../"; \
fi; \
sed -e '/^#/d' -e '/^[ ]*$$/d' \
rm -f $@-t $@ \
&& sed -e '/^#/d' -e '/^[ ]*$$/d' \
-e "s@.*@ $$posrcprefix& \\\\@" \
-e '$$s/\(.*\) \\/\1/' < $(srcdir)/POTFILES.in > POTFILES )
-e '$$s/\(.*\) \\/\1/' < $(srcdir)/$@.in > $@-t \
&& chmod a-w $@-t \
&& mv $@-t $@ )
Makefile: Makefile.in.in ../config.status POTFILES
cd .. \

View File

@@ -1,19 +1,36 @@
.TH ANSI2KNR 1 "31 December 1990"
.TH ANSI2KNR 1 "19 Jan 1996"
.SH NAME
ansi2knr \- convert ANSI C to Kernighan & Ritchie C
.SH SYNOPSIS
.I ansi2knr
input_file output_file
[--varargs] input_file [output_file]
.SH DESCRIPTION
If no output_file is supplied, output goes to stdout.
.br
There are no error messages.
.sp
.I ansi2knr
recognizes functions by seeing a non-keyword identifier at the left margin, followed by a left parenthesis, with a right parenthesis as the last character on the line. It will recognize a multi-line header if the last character on each line but the last is a left parenthesis or comma. These algorithms ignore whitespace and comments, except that the function name must be the first thing on the line.
recognizes function definitions by seeing a non-keyword identifier at the left
margin, followed by a left parenthesis, with a right parenthesis as the last
character on the line, and with a left brace as the first token on the
following line (ignoring possible intervening comments). It will recognize a
multi-line header provided that no intervening line ends with a left or right
brace or a semicolon. These algorithms ignore whitespace and comments, except
that the function name must be the first thing on the line.
.sp
The following constructs will confuse it:
.br
- Any other construct that starts at the left margin and follows the above syntax (such as a macro or function call).
- Any other construct that starts at the left margin and follows the
above syntax (such as a macro or function call).
.br
- Macros that tinker with the syntax of the function header.
- Some macros that tinker with the syntax of the function header.
.sp
The --varargs switch is obsolete, and is recognized only for
backwards compatibility. The present version of
.I ansi2knr
will always attempt to convert a ... argument to va_alist and va_dcl.
.SH AUTHOR
L. Peter Deutsch <ghost@aladdin.com> wrote the original ansi2knr and
continues to maintain the current version; most of the code in the current
version is his work. ansi2knr also includes contributions by Francois
Pinard <pinard@iro.umontreal.ca> and Jim Avera <jima@netcom.com>.

View File

@@ -1,5 +1,3 @@
/* Copyright (C) 1989, 1991, 1993, 1994, 1995 Aladdin Enterprises. All rights reserved. */
/* ansi2knr.c */
/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
@@ -34,22 +32,30 @@ program under the GPL.
*
* ansi2knr recognizes function definitions by seeing a non-keyword
* identifier at the left margin, followed by a left parenthesis,
* with a right parenthesis as the last character on the line.
* It will recognize a multi-line header provided that the last character
* of the last line of the header is a right parenthesis,
* and no intervening line ends with a left or right brace or a semicolon.
* with a right parenthesis as the last character on the line,
* and with a left brace as the first token on the following line
* (ignoring possible intervening comments).
* It will recognize a multi-line header provided that no intervening
* line ends with a left or right brace or a semicolon.
* These algorithms ignore whitespace and comments, except that
* the function name must be the first thing on the line.
* The following constructs will confuse it:
* - Any other construct that starts at the left margin and
* follows the above syntax (such as a macro or function call).
* - Macros that tinker with the syntax of the function header.
* - Some macros that tinker with the syntax of the function header.
*/
/*
* The original and principal author of ansi2knr is L. Peter Deutsch
* <ghost@aladdin.com>. Other authors are noted in the change history
* that follows (in reverse chronological order):
lpd 96-01-21 added code to cope with not HAVE_CONFIG_H and with
compilers that don't understand void, as suggested by
Tom Lane
lpd 96-01-15 changed to require that the first non-comment token
on the line following a function header be a left brace,
to reduce sensitivity to macros, as suggested by Tom Lane
<tgl@sss.pgh.pa.us>
lpd 95-06-22 removed #ifndefs whose sole purpose was to define
undefined preprocessor symbols as 0; changed all #ifdefs
for configuration symbols to #ifs
@@ -70,7 +76,7 @@ program under the GPL.
*/
/* Most of the conditionals here are to make ansi2knr work with */
/* the GNU configure machinery. */
/* or without the GNU configure machinery. */
#if HAVE_CONFIG_H
# include <config.h>
@@ -94,12 +100,17 @@ program under the GPL.
#else /* not HAVE_CONFIG_H */
/*
Without AC_CONFIG_HEADER, merely use <string.h> as in the original
Ghostscript distribution. This loses on older BSD systems.
*/
/* Otherwise do it the hard way */
# include <string.h>
# ifdef BSD
# include <strings.h>
# else
# ifdef VMS
extern int strlen(), strncmp();
# else
# include <string.h>
# endif
# endif
#endif /* not HAVE_CONFIG_H */
@@ -110,8 +121,18 @@ program under the GPL.
malloc and free should be declared in stdlib.h,
but if you've got a K&R compiler, they probably aren't.
*/
char *malloc();
void free();
# ifdef MSDOS
# include <malloc.h>
# else
# ifdef VMS
extern char *malloc();
extern void free();
# else
extern char *malloc();
extern int free();
# endif
# endif
#endif
/*
@@ -139,7 +160,7 @@ void free();
/* Forward references */
char *skipspace();
void writeblanks();
int writeblanks();
int test1();
int convert1();
@@ -152,6 +173,7 @@ main(argc, argv)
#define bufsize 5000 /* arbitrary size */
char *buf;
char *line;
char *more;
/*
* In previous versions, ansi2knr recognized a --varargs switch.
* If this switch was supplied, ansi2knr would attempt to convert
@@ -173,50 +195,81 @@ main(argc, argv)
exit(1);
}
}
switch ( argc )
if (argc < 2 || argc > 3)
{
default:
printf("Usage: ansi2knr input_file [output_file]\n");
exit(0);
case 2:
out = stdout;
break;
case 3:
out = fopen(argv[2], "w");
if ( out == NULL )
{ fprintf(stderr, "Cannot open output file %s\n", argv[2]);
exit(1);
}
}
in = fopen(argv[1], "r");
if ( in == NULL )
{ fprintf(stderr, "Cannot open input file %s\n", argv[1]);
{
fprintf(stderr, "Cannot open input file %s\n", argv[1]);
exit(1);
}
if (argc == 3)
{
out = fopen(argv[2], "w");
if ( out == NULL )
{
fprintf(stderr, "Cannot open output file %s\n", argv[2]);
exit(1);
}
}
else
{
out = stdout;
}
fprintf(out, "#line 1 \"%s\"\n", argv[1]);
buf = malloc(bufsize);
line = buf;
while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
{ switch ( test1(buf) )
{
test: line += strlen(line);
switch ( test1(buf) )
{
case 2: /* a function header */
convert1(buf, out, 1, convert_varargs);
break;
case 1: /* a function */
convert1(buf, out, 0, convert_varargs);
/* Check for a { at the start of the next line. */
more = ++line;
f: if ( line >= buf + (bufsize - 1) ) /* overflow check */
goto wl;
if ( fgets(line, (unsigned)(buf + bufsize - line), in) == NULL )
goto wl;
switch ( *skipspace(more, 1) )
{
case '{':
/* Definitely a function header. */
convert1(buf, out, 0, convert_varargs);
fputs(more, out);
break;
case 0:
/* The next line was blank or a comment: */
/* keep scanning for a non-comment. */
line += strlen(line);
goto f;
default:
/* buf isn't a function header, but */
/* more might be. */
fputs(buf, out);
strcpy(buf, more);
line = buf;
goto test;
}
break;
case -1: /* maybe the start of a function */
line = buf + strlen(buf);
if ( line != buf + (bufsize - 1) ) /* overflow check */
continue;
continue;
/* falls through */
default: /* not a function */
fputs(buf, out);
wl: fputs(buf, out);
break;
}
line = buf;
}
if ( line != buf ) fputs(buf, out);
if ( line != buf )
fputs(buf, out);
free(buf);
fclose(out);
fclose(in);
@@ -229,11 +282,14 @@ skipspace(p, dir)
register char *p;
register int dir; /* 1 for forward, -1 for backward */
{ for ( ; ; )
{ while ( is_space(*p) ) p += dir;
if ( !(*p == '/' && p[dir] == '*') ) break;
{ while ( is_space(*p) )
p += dir;
if ( !(*p == '/' && p[dir] == '*') )
break;
p += dir; p += dir;
while ( !(*p == '*' && p[dir] == '/') )
{ if ( *p == 0 ) return p; /* multi-line comment?? */
{ if ( *p == 0 )
return p; /* multi-line comment?? */
p += dir;
}
p += dir; p += dir;
@@ -245,13 +301,15 @@ skipspace(p, dir)
* Write blanks over part of a string.
* Don't overwrite end-of-line characters.
*/
void
int
writeblanks(start, end)
char *start;
char *end;
{ char *p;
for ( p = start; p < end; p++ )
if ( *p != '\r' && *p != '\n' ) *p = ' ';
if ( *p != '\r' && *p != '\n' )
*p = ' ';
return 0;
}
/*
@@ -274,25 +332,27 @@ test1(buf)
char *bend;
char *endfn;
int contin;
if ( !isidfirstchar(*p) )
return 0; /* no name at left margin */
return 0; /* no name at left margin */
bend = skipspace(buf + strlen(buf) - 1, -1);
switch ( *bend )
{
case ';': contin = 0 /*2*/; break;
case ')': contin = 1; break;
case '{': return 0; /* not a function */
case '}': return 0; /* not a function */
default: contin = -1;
case ';': contin = 0 /*2*/; break;
case ')': contin = 1; break;
case '{': return 0; /* not a function */
case '}': return 0; /* not a function */
default: contin = -1;
}
while ( isidchar(*p) ) p++;
while ( isidchar(*p) )
p++;
endfn = p;
p = skipspace(p, 1);
if ( *p++ != '(' )
return 0; /* not a function */
return 0; /* not a function */
p = skipspace(p, 1);
if ( *p == ')' )
return 0; /* no parameters */
return 0; /* no parameters */
/* Check that the apparent function name isn't a keyword. */
/* We only need to check for keywords that could be followed */
/* by a left parenthesis (which, unfortunately, is most of them). */
@@ -306,9 +366,10 @@ test1(buf)
char **key = words;
char *kp;
int len = endfn - buf;
while ( (kp = *key) != 0 )
{ if ( strlen(kp) == len && !strncmp(kp, buf, len) )
return 0; /* name is a keyword */
return 0; /* name is a keyword */
key++;
}
}
@@ -324,15 +385,21 @@ convert1(buf, out, header, convert_varargs)
int convert_varargs; /* Boolean */
{ char *endfn;
register char *p;
/*
* The breaks table contains pointers to the beginning and end
* of each argument.
*/
char **breaks;
unsigned num_breaks = 2; /* for testing */
char **btop;
char **bp;
char **ap;
char *vararg = 0;
/* Pre-ANSI implementations don't agree on whether strchr */
/* is called strchr or index, so we open-code it here. */
for ( endfn = buf; *(endfn++) != '('; ) ;
for ( endfn = buf; *(endfn++) != '('; )
;
top: p = endfn;
breaks = (char **)malloc(sizeof(char *) * num_breaks * 2);
if ( breaks == 0 )
@@ -349,6 +416,7 @@ top: p = endfn;
char *lp = NULL;
char *rp;
char *end = NULL;
if ( bp >= btop )
{ /* Filled up break table. */
/* Allocate a bigger one and start over. */
@@ -361,21 +429,21 @@ top: p = endfn;
for ( ; end == NULL; p++ )
{ switch(*p)
{
case ',':
case ',':
if ( !level ) end = p;
break;
case '(':
case '(':
if ( !level ) lp = p;
level++;
break;
case ')':
case ')':
if ( --level < 0 ) end = p;
else rp = p;
break;
case '/':
case '/':
p = skipspace(p, 1) - 1;
break;
default:
default:
;
}
}
@@ -390,26 +458,27 @@ top: p = endfn;
{ p = skipspace(p - 1, -1);
switch ( *p )
{
case ']': /* skip array dimension(s) */
case ')': /* skip procedure args OR name */
case ']': /* skip array dimension(s) */
case ')': /* skip procedure args OR name */
{ int level = 1;
while ( level )
switch ( *--p )
{
case ']': case ')': level++; break;
case '[': case '(': level--; break;
case '/': p = skipspace(p, -1) + 1; break;
default: ;
case ']': case ')': level++; break;
case '[': case '(': level--; break;
case '/': p = skipspace(p, -1) + 1; break;
default: ;
}
}
if ( *p == '(' && *skipspace(p + 1, 1) == '*' )
{ /* We found the name being declared */
while ( !isidfirstchar(*p) )
p = skipspace(p, 1) + 1;
p = skipspace(p, 1) + 1;
goto found;
}
break;
default: goto found;
default:
goto found;
}
}
found: if ( *p == '.' && p[-1] == '.' && p[-2] == '.' )

View File

@@ -1,5 +1,5 @@
/* basename -- strip directory and suffix from filenames
Copyright (C) 90, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
Copyright (C) 90,91,92,93,94,95,96,1997 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -33,8 +33,8 @@
#include "long-options.h"
#include "error.h"
extern char *basename ();
extern void strip_trailing_slashes ();
char *base_name ();
void strip_trailing_slashes ();
/* The name this program was run with. */
char *program_name;
@@ -59,7 +59,7 @@ If specified, also remove a trailing SUFFIX.\n\
--help display this help and exit\n\
--version output version information and exit\n\
"));
puts (_("\nReport bugs to sh-utils-bugs@gnu.ai.mit.edu"));
puts (_("\nReport bugs to <sh-utils-bugs@gnu.ai.mit.edu>."));
}
exit (status);
}
@@ -104,7 +104,7 @@ main (int argc, char **argv)
strip_trailing_slashes (argv[1]);
name = basename (argv[1]);
name = base_name (argv[1]);
if (argc == 3)
remove_suffix (name, argv[2]);

View File

@@ -1,5 +1,5 @@
/* cat -- concatenate files and print on the standard output.
Copyright (C) 88, 90, 91, 95, 1996 Free Software Foundation, Inc.
Copyright (C) 88, 90, 91, 95, 96, 1997 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
@@ -104,7 +104,7 @@ Concatenate FILE(s), or standard input, to standard output.\n\
\n\
With no FILE, or when FILE is -, read standard input.\n\
"));
puts (_("\nReport bugs to textutils-bugs@gnu.ai.mit.edu"));
puts (_("\nReport bugs to <textutils-bugs@gnu.ai.mit.edu>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
@@ -512,8 +512,7 @@ main (int argc, char **argv)
/* Parse command line options. */
while ((c = getopt_long (argc, argv, "benstuvAET", long_options, (int *) 0))
!= EOF)
while ((c = getopt_long (argc, argv, "benstuvAET", long_options, NULL)) != -1)
{
switch (c)
{

View File

@@ -1,5 +1,5 @@
/* chgrp -- change group ownership of files
Copyright (C) 89, 90, 91, 95, 1996 Free Software Foundation, Inc.
Copyright (C) 89, 90, 91, 95, 96, 1997 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
@@ -88,6 +88,10 @@ static int changes_only;
/* The name of the group to which ownership of the files is being given. */
static const char *groupname;
/* The argument to the --reference option. Use the group ID of this file.
This file must exist. */
static char *reference_file;
/* If nonzero, display usage information and exit. */
static int show_help;
@@ -101,6 +105,7 @@ static struct option const long_options[] =
{"no-dereference", no_argument, 0, 'h'},
{"silent", no_argument, 0, 'f'},
{"quiet", no_argument, 0, 'f'},
{"reference", required_argument, 0, 12},
{"verbose", no_argument, 0, 'v'},
{"help", no_argument, &show_help, 1},
{"version", no_argument, &show_version, 1},
@@ -178,9 +183,9 @@ change_file_group (const char *file, int group)
describe_change (file, 1);
if (change_symlinks)
fail = LCHOWN (file, file_stats.st_uid, group);
fail = LCHOWN (file, (uid_t) -1, group);
else
fail = chown (file, file_stats.st_uid, group);
fail = chown (file, (uid_t) -1, group);
if (fail)
{
@@ -207,10 +212,13 @@ change_file_group (const char *file, int group)
}
}
else if (verbose && changes_only == 0)
describe_change (file, 0);
{
describe_change (file, 0);
}
if (recurse && S_ISDIR (file_stats.st_mode))
errors |= change_dir_group (file, group, &file_stats);
return errors;
}
@@ -274,20 +282,25 @@ usage (int status)
program_name);
else
{
printf (_("Usage: %s [OPTION]... GROUP FILE...\n"), program_name);
printf (_("\
Usage: %s [OPTION]... GROUP FILE...\n\
or: %s [OPTION]... --reference=RFILE FILE...\n\
"),
program_name, program_name);
printf (_("\
Change the group membership of each FILE to GROUP.\n\
\n\
-c, --changes like verbose but report only when a change is made\n\
-h, --no-dereference affect symbolic links instead of any referenced file\n\
(available only on systems with lchown system call)\n\
-f, --silent, --quiet suppress most error messages\n\
-R, --recursive change files and directories recursively\n\
-v, --verbose output a diagnostic for every file processed\n\
--help display this help and exit\n\
--version output version information and exit\n\
-c, --changes like verbose but report only when a change is made\n\
-h, --no-dereference affect symbolic links instead of any referenced file\n\
(available only on systems with lchown system call)\n\
-f, --silent, --quiet suppress most error messages\n\
--reference=RFILE use RFILE's group instead of using a GROUP value\n\
-R, --recursive change files and directories recursively\n\
-v, --verbose output a diagnostic for every file processed\n\
--help display this help and exit\n\
--version output version information and exit\n\
"));
puts (_("\nReport bugs to fileutils-bugs@gnu.ai.mit.edu"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.ai.mit.edu>."));
}
exit (status);
}
@@ -306,13 +319,15 @@ main (int argc, char **argv)
recurse = force_silent = verbose = changes_only = 0;
while ((optc = getopt_long (argc, argv, "Rcfhv", long_options, (int *) 0))
!= EOF)
while ((optc = getopt_long (argc, argv, "Rcfhv", long_options, NULL)) != -1)
{
switch (optc)
{
case 0:
break;
case 12:
reference_file = optarg;
break;
case 'R':
recurse = 1;
break;
@@ -343,7 +358,7 @@ main (int argc, char **argv)
if (show_help)
usage (0);
if (argc - optind <= 1)
if (argc - optind + (reference_file ? 1 : 0) <= 1)
{
error (0, 0, _("too few arguments"));
usage (1);
@@ -356,7 +371,16 @@ main (int argc, char **argv)
}
#endif
parse_group (argv[optind++], &group);
if (reference_file)
{
struct stat ref_stats;
if (stat (reference_file, &ref_stats))
error (1, errno, "%s", reference_file);
group = ref_stats.st_gid;
}
else
parse_group (argv[optind++], &group);
for (; optind < argc; ++optind)
errors |= change_file_group (argv[optind], group);

View File

@@ -1,5 +1,5 @@
/* chmod -- change permission modes of files
Copyright (C) 89, 90, 91, 95, 1996 Free Software Foundation, Inc.
Copyright (C) 89, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,13 +15,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Options:
-R Recursively change modes of directory contents.
-c Verbosely describe only files whose modes actually change.
-f Do not print error messages about files.
-v Verbosely describe changed modes.
David MacKenzie <djm@gnu.ai.mit.edu> */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu> */
#include <config.h>
#include <stdio.h>
@@ -54,6 +48,10 @@ static int force_silent;
/* If nonzero, describe the modes we set. */
static int verbose;
/* The argument to the --reference option. Use the owner and group IDs
of this file. This file must exist. */
static char *reference_file;
/* If nonzero, describe only modes that change. */
static int changes_only;
@@ -69,6 +67,7 @@ static struct option const long_options[] =
{"changes", no_argument, 0, 'c'},
{"silent", no_argument, 0, 'f'},
{"quiet", no_argument, 0, 'f'},
{"reference", required_argument, 0, 12},
{"verbose", no_argument, 0, 'v'},
{"help", no_argument, &show_help, 1},
{"version", no_argument, &show_version, 1},
@@ -217,13 +216,15 @@ usage (int status)
printf (_("\
Usage: %s [OPTION]... MODE[,MODE]... FILE...\n\
or: %s [OPTION]... OCTAL_MODE FILE...\n\
or: %s [OPTION]... --reference=RFILE FILE...\n\
"),
program_name, program_name);
program_name, program_name, program_name);
printf (_("\
\n\
-c, --changes like verbose but report only when a change is made\n\
-f, --silent, --quiet suppress most error messages\n\
-v, --verbose output a diagnostic for every file processed\n\
--reference=RFILE use RFILE's mode instead of MODE values\n\
-R, --recursive change files and directories recursively\n\
--help display this help and exit\n\
--version output version information and exit\n\
@@ -231,7 +232,7 @@ Usage: %s [OPTION]... MODE[,MODE]... FILE...\n\
Each MODE is one or more of the letters ugoa, one of the symbols +-= and\n\
one or more of the letters rwxXstugo.\n\
"));
puts (_("\nReport bugs to fileutils-bugs@gnu.ai.mit.edu"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.ai.mit.edu>."));
}
exit (status);
}
@@ -259,9 +260,8 @@ main (int argc, char **argv)
{
thisind = optind ? optind : 1;
c = getopt_long (argc, argv, "RcfvrwxXstugoa,+-=", long_options,
(int *) 0);
if (c == EOF)
c = getopt_long (argc, argv, "RcfvrwxXstugoa,+-=", long_options, NULL);
if (c == -1)
break;
switch (c)
@@ -286,6 +286,9 @@ main (int argc, char **argv)
error (1, 0, _("invalid mode"));
modeind = thisind;
break;
case 12:
reference_file = optarg;
break;
case 'R':
recurse = 1;
break;
@@ -312,7 +315,7 @@ main (int argc, char **argv)
if (show_help)
usage (0);
if (modeind == 0)
if (modeind == 0 && reference_file == NULL)
modeind = optind++;
if (optind >= argc)
@@ -321,12 +324,15 @@ main (int argc, char **argv)
usage (1);
}
changes = mode_compile (argv[modeind],
MODE_MASK_EQUALS | MODE_MASK_PLUS | MODE_MASK_MINUS);
changes = (reference_file ? mode_create_from_ref (reference_file)
: mode_compile (argv[modeind], MODE_MASK_ALL));
if (changes == MODE_INVALID)
error (1, 0, _("invalid mode"));
else if (changes == MODE_MEMORY_EXHAUSTED)
error (1, 0, _("virtual memory exhausted"));
else if (changes == MODE_BAD_REFERENCE)
error (1, errno, "%s", reference_file);
for (; optind < argc; ++optind)
{

View File

@@ -1,5 +1,5 @@
/* chown -- change user and group ownership of files
Copyright (C) 89, 90, 91, 95, 1996 Free Software Foundation, Inc.
Copyright (C) 89, 90, 91, 95, 96, 1997 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
@@ -88,6 +88,10 @@ static char *username;
/* The name of the group to which ownership of the files is being given. */
static char *groupname;
/* The argument to the --reference option. Use the owner and group IDs
of this file. This file must exist. */
static char *reference_file;
/* If nonzero, display usage information and exit. */
static int show_help;
@@ -101,6 +105,7 @@ static struct option const long_options[] =
{"no-dereference", no_argument, 0, 'h'},
{"quiet", no_argument, 0, 'f'},
{"silent", no_argument, 0, 'f'},
{"reference", required_argument, 0, 12},
{"verbose", no_argument, 0, 'v'},
{"help", no_argument, &show_help, 1},
{"version", no_argument, &show_version, 1},
@@ -233,16 +238,20 @@ usage (int status)
{
printf (_("\
Usage: %s [OPTION]... OWNER[.[GROUP]] FILE...\n\
or: %s [OPTION]... .[GROUP] FILE...\n\
or: %s [OPTION]... .GROUP FILE...\n\
or: %s [OPTION]... --reference=RFILE FILE...\n\
"),
program_name, program_name);
program_name, program_name, program_name);
printf (_("\
Change the owner and/or group of each FILE to OWNER and/or GROUP.\n\
\n\
-c, --changes be verbose whenever change occurs\n\
-h, --no-dereference affect symbolic links instead of any referenced file\n\
(available only on systems with lchown system call)\n\
(available only on systems that can change the\n\
ownership of a symlink)\n\
-f, --silent, --quiet suppress most error messages\n\
--reference=RFILE use the owner and group of RFILE instead of using\n\
explicit OWNER.GROUP values\n\
-R, --recursive operate on files and directories recursively\n\
-v, --verbose explain what is being done\n\
--help display this help and exit\n\
@@ -251,7 +260,7 @@ Change the owner and/or group of each FILE to OWNER and/or GROUP.\n\
Owner is unchanged if missing. Group is unchanged if missing, but changed\n\
to login group if implied by a period. A colon may replace the period.\n\
"));
puts (_("\nReport bugs to fileutils-bugs@gnu.ai.mit.edu"));
puts (_("\nReport bugs to <fileutils-bugs@gnu.ai.mit.edu>."));
}
exit (status);
}
@@ -272,13 +281,15 @@ main (int argc, char **argv)
recurse = force_silent = verbose = changes_only = 0;
while ((optc = getopt_long (argc, argv, "Rcfhv", long_options, (int *) 0))
!= EOF)
while ((optc = getopt_long (argc, argv, "Rcfhv", long_options, NULL)) != -1)
{
switch (optc)
{
case 0:
break;
case 12:
reference_file = optarg;
break;
case 'R':
recurse = 1;
break;
@@ -309,7 +320,7 @@ main (int argc, char **argv)
if (show_help)
usage (0);
if (optind >= argc - 1)
if (argc - optind + (reference_file ? 1 : 0) <= 1)
{
error (0, 0, _("too few arguments"));
usage (1);
@@ -322,13 +333,28 @@ main (int argc, char **argv)
}
#endif
e = parse_user_spec (argv[optind], &user, &group, &username, &groupname);
if (e)
error (1, 0, "%s: %s", argv[optind], e);
if (username == NULL)
username = "";
if (reference_file)
{
struct stat ref_stats;
for (++optind; optind < argc; ++optind)
if (stat (reference_file, &ref_stats))
error (1, errno, "%s", reference_file);
user = ref_stats.st_uid;
group = ref_stats.st_gid;
}
else
{
e = parse_user_spec (argv[optind], &user, &group, &username, &groupname);
if (e)
error (1, 0, "%s: %s", argv[optind], e);
if (username == NULL)
username = "";
optind++;
}
for (; optind < argc; ++optind)
{
strip_trailing_slashes (argv[optind]);
errors |= change_file_owner (argv[optind], user, group);

View File

@@ -1,5 +1,5 @@
/* chroot -- run command or shell with special root directory
Copyright (C) 1995, 96 Free Software Foundation, Inc.
Copyright (C) 95, 96, 1997 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
@@ -38,7 +38,7 @@ usage (int status)
{
printf (_("\
Usage: %s [OPTION] NEWROOT [COMMAND...]\n\
or: %s OPTION\n\
or: %s OPTION\n\
"), program_name, program_name);
printf (_("\
Run COMMAND with root directory set to NEWROOT.\n\
@@ -48,7 +48,7 @@ Run COMMAND with root directory set to NEWROOT.\n\
\n\
If no command is given, run ``${SHELL} -i'' (default: /bin/sh).\n\
"));
puts (_("\nReport bugs to sh-utils-bugs@gnu.ai.mit.edu"));
puts (_("\nReport bugs to <sh-utils-bugs@gnu.ai.mit.edu>."));
}
exit (status);
}

View File

@@ -1,5 +1,5 @@
/* cksum -- calculate and print POSIX.2 checksums and sizes of files
Copyright (C) 92, 95, 1996 Free Software Foundation, Inc.
Copyright (C) 92, 95, 96, 1997 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
@@ -275,7 +275,7 @@ Print CRC checksum and byte counts of each FILE.\n\
--help display this help and exit\n\
--version output version information and exit\n\
"));
puts (_("\nReport bugs to textutils-bugs@gnu.ai.mit.edu"));
puts (_("\nReport bugs to <textutils-bugs@gnu.ai.mit.edu>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
@@ -293,7 +293,7 @@ main (int argc, char **argv)
have_read_stdin = 0;
while ((c = getopt_long (argc, argv, "", long_options, (int *) 0)) != EOF)
while ((c = getopt_long (argc, argv, "", long_options, NULL)) != -1)
{
switch (c)
{

View File

@@ -1,5 +1,5 @@
/* comm -- compare two sorted files line by line.
Copyright (C) 1986, 1990, 1991, 1995, 1996 Free Software Foundation, Inc.
Copyright (C) 86, 90, 91, 95, 96, 1997 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
@@ -78,7 +78,7 @@ Compare sorted files LEFT_FILE and RIGHT_FILE line by line.\n\
--help display this help and exit\n\
--version output version information and exit\n\
"));
puts (_("\nReport bugs to textutils-bugs@gnu.ai.mit.edu"));
puts (_("\nReport bugs to <textutils-bugs@gnu.ai.mit.edu>."));
}
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
@@ -226,7 +226,7 @@ main (int argc, char **argv)
only_file_2 = 1;
both = 1;
while ((c = getopt_long (argc, argv, "123", long_options, (int *) 0)) != EOF)
while ((c = getopt_long (argc, argv, "123", long_options, NULL)) != -1)
switch (c)
{
case 0:

View File

@@ -4,10 +4,14 @@
#include <config.h>
#include <stdio.h>
#include <assert.h>
#include <sys/types.h>
#include "cp.h"
#include "copy.h"
#include "system.h"
#include "error.h"
#include "backupfile.h"
#include "copy.h"
#include "cp-hash.h"
/* On Linux (from slackware-1.2.13 to 2.0.2?) there is no lchown function.
To change ownership of symlinks, you must run chown with an effective
@@ -22,82 +26,6 @@
But root probably wants to know, e.g. if NFS disallows it. */ \
&& (errno != EPERM || x->myeuid == 0))
/* Control creation of sparse files (files with holes). */
enum Sparse_type
{
/* Never create holes in DEST. */
SPARSE_NEVER,
/* This is the default. Use a crude (and sometimes inaccurate)
heuristic to determine if SOURCE has holes. If so, try to create
holes in DEST. */
SPARSE_AUTO,
/* For every sufficiently long sequence of bytes in SOURCE, try to
create a corresponding hole in DEST. There is a performance penalty
here because CP has to search for holes in SRC. But if the holes are
big enough, that penalty can be offset by the decrease in the amount
of data written to disk. */
SPARSE_ALWAYS
};
struct flag
{
/* If nonzero, copy all files except (directories and, if not dereferencing
them, symbolic links,) as if they were regular files. */
int copy_as_regular;
/* If nonzero, dereference symbolic links (copy the files they point to). */
int dereference;
/* If nonzero, remove existing destination nondirectories. */
int force;
/* If nonzero, create hard links instead of copying files.
Create destination directories as usual. */
int hard_link;
/* If nonzero, query before overwriting existing destinations
with regular files. */
int interactive;
/* If nonzero, when copying recursively, skip any subdirectories that are
on different filesystems from the one we started on. */
int one_file_system;
/* If nonzero, give the copies the original files' permissions,
ownership, and timestamps. */
int preserve;
/* If nonzero, copy directories recursively and copy special files
as themselves rather than copying their contents. */
int recursive;
/* Control creation of sparse files. */
enum Sparse_type sparse_mode;
/* If nonzero, create symbolic links instead of copying files.
Create destination directories as usual. */
int symbolic_link;
/* The bits to preserve in created files' modes. */
int umask_kill;
/* If nonzero, do not copy a nondirectory that has an existing destination
with the same or newer modification time. */
int update;
/* If nonzero, display the names of the files before copying them. */
int verbose;
/* This process's effective user ID. */
uid_t myeuid;
/* A pointer to either lstat or stat, depending on
whether dereferencing of symlinks is done. */
int (*xstat) ();
};
struct dir_list
{
struct dir_list *parent;
@@ -107,6 +35,15 @@ struct dir_list
int full_write ();
int euidaccess ();
char *savedir ();
char *stpcpy ();
char *xmalloc ();
int yesno ();
static int copy_internal __P ((const char *src_path, const char *dst_path,
int new_dst, dev_t device,
struct dir_list *ancestors,
const struct cp_options *x));
/* The invocation name of this program. */
extern char *program_name;
@@ -132,7 +69,7 @@ is_ancestor (const struct stat *sb, const struct dir_list *ancestors)
static int
copy_dir (const char *src_path_in, const char *dst_path_in, int new_dst,
const struct stat *src_sb, struct dir_list *ancestors,
const struct flag *x)
const struct cp_options *x)
{
char *name_space;
char *namep;
@@ -164,7 +101,8 @@ copy_dir (const char *src_path_in, const char *dst_path_in, int new_dst,
stpcpy (stpcpy (stpcpy (src_path, src_path_in), "/"), namep);
stpcpy (stpcpy (stpcpy (dst_path, dst_path_in), "/"), namep);
ret |= copy (src_path, dst_path, new_dst, src_sb->st_dev, ancestors, x);
ret |= copy_internal (src_path, dst_path, new_dst, src_sb->st_dev,
ancestors, x);
/* Free the memory for `src_path'. The memory for `dst_path'
cannot be deallocated, since it is used to create multiple
@@ -371,7 +309,7 @@ ret2:
static int
copy_internal (const char *src_path, const char *dst_path,
int new_dst, dev_t device, struct dir_list *ancestors,
const struct flag *x)
const struct cp_options *x)
{
struct stat src_sb;
struct stat dst_sb;
@@ -425,9 +363,26 @@ copy_internal (const char *src_path, const char *dst_path,
}
else
{
/* The file exists already. */
int same;
if (src_sb.st_ino == dst_sb.st_ino && src_sb.st_dev == dst_sb.st_dev)
/* The destination file exists already. */
same = (src_sb.st_ino == dst_sb.st_ino
&& src_sb.st_dev == dst_sb.st_dev);
/* If we're preserving symlinks (--no-dereference) and the
destination file is a symlink, use stat (not xstat) to
see if it points back to the source. */
if (!same && !x->dereference && S_ISLNK (dst_sb.st_mode))
{
struct stat dst2_sb;
if (stat (dst_path, &dst2_sb) == 0
&& (src_sb.st_ino == dst2_sb.st_ino &&
src_sb.st_dev == dst2_sb.st_dev))
same = 1;
}
if (same)
{
if (x->hard_link)
return 0;
@@ -693,19 +648,19 @@ copy_internal (const char *src_path, const char *dst_path,
{
/* Preserve the owner and group of the just-`copied'
symbolic link, if possible. */
#ifdef HAVE_LCHOWN
# ifdef HAVE_LCHOWN
if (DO_CHOWN (lchown, dst_path, src_sb.st_uid, src_sb.st_gid))
{
error (0, errno, "%s", dst_path);
error (0, errno, _("preserving ownership for %s"), dst_path);
goto un_backup;
}
#else
# ifdef ROOT_CHOWN_AFFECTS_SYMLINKS
# else
# ifdef ROOT_CHOWN_AFFECTS_SYMLINKS
if (x->myeuid == 0)
{
if (DO_CHOWN (chown, dst_path, src_sb.st_uid, src_sb.st_gid))
{
error (0, errno, "%s", dst_path);
error (0, errno, _("preserving ownership for %s"), dst_path);
goto un_backup;
}
}
@@ -714,13 +669,13 @@ copy_internal (const char *src_path, const char *dst_path,
/* FIXME: maybe give a diagnostic: you must be root
to preserve ownership and group of symlinks. */
}
# else
# else
/* Can't preserve ownership of symlinks.
FIXME: maybe give a warning or even error for symlinks
in directories with the sticky bit set -- there, not
preserving owner/group is a potential security problem. */
# endif
# endif
#endif
}
return 0;
@@ -745,13 +700,13 @@ copy_internal (const char *src_path, const char *dst_path,
if (utime (dst_path, &utb))
{
error (0, errno, "%s", dst_path);
error (0, errno, _("preserving times for %s"), dst_path);
return 1;
}
if (DO_CHOWN (chown, dst_path, src_sb.st_uid, src_sb.st_gid))
{
error (0, errno, "%s", dst_path);
error (0, errno, _("preserving ownership for %s"), dst_path);
return 1;
}
}
@@ -761,7 +716,7 @@ copy_internal (const char *src_path, const char *dst_path,
{
if (chmod (dst_path, src_mode & x->umask_kill))
{
error (0, errno, "%s", dst_path);
error (0, errno, _("preserving permissions for %s"), dst_path);
return 1;
}
}
@@ -770,7 +725,7 @@ copy_internal (const char *src_path, const char *dst_path,
/* Reset the temporarily changed mode. */
if (chmod (dst_path, dst_sb.st_mode))
{
error (0, errno, "%s", dst_path);
error (0, errno, _("restoring permissions of %s"), dst_path);
return 1;
}
}
@@ -786,18 +741,31 @@ un_backup:
return 1;
}
static int
valid_options (const struct cp_options *co)
{
assert (co != NULL);
/* FIXME: make sure xstat and dereference are consistent. */
assert (co->xstat);
assert (co->sparse_mode != SPARSE_UNUSED);
return 1;
}
/* Copy the file SRC_PATH to the file DST_PATH. The files may be of
any type. NONEXISTENT_DST should be nonzero if the file DST_PATH is
not to exist (e.g., because its parent directory was just created);
NONEXISTENT_DST should be zero if DST_PATH might already exist.
DEVICE is the device number of the parent directory, or 0 if the
parent of this file is not known. ANCESTORS points to a linked, null
terminated list of devices and inodes of parent directories of SRC_PATH.
any type. NONEXISTENT_DST should be nonzero if the file DST_PATH
is known not to exist (e.g., because its parent directory was just
created); NONEXISTENT_DST should be zero if DST_PATH might already
exist. DEVICE is the device number of the parent directory of
DST_PATH, or 0 if the parent of this file is not known.
OPTIONS is ... FIXME-describe
Return 0 if successful, 1 if an error occurs. */
int
copy (const char *src_path, const char *dst_path, int nonexistent_dst,
const struct flag *x)
copy (const char *src_path, const char *dst_path,
int nonexistent_dst, const struct cp_options *options)
{
copy_internal (src_path, dst_path, ... , x);
assert (valid_options (options));
return copy_internal (src_path, dst_path, nonexistent_dst, 0, NULL, options);
}

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