mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
Compare commits
1129 Commits
FILEUTILS-
...
FILEUTILS-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9eabf6d99a | ||
|
|
8efb6d5f7b | ||
|
|
928b1b8300 | ||
|
|
211a6642e2 | ||
|
|
fd1d1eaa80 | ||
|
|
ad41cbff8a | ||
|
|
71611d94f3 | ||
|
|
9beeae646e | ||
|
|
67450be04d | ||
|
|
84264973d6 | ||
|
|
5239228c17 | ||
|
|
29940657ab | ||
|
|
a5ab9f78c3 | ||
|
|
01bbd27a4d | ||
|
|
df06c5de7b | ||
|
|
706235da55 | ||
|
|
403b4c49eb | ||
|
|
c6014bc847 | ||
|
|
c148112941 | ||
|
|
19b3a9d102 | ||
|
|
7f9c804f7a | ||
|
|
4bdc202a00 | ||
|
|
a80ec26277 | ||
|
|
fcdbd9ff15 | ||
|
|
108694f32a | ||
|
|
59b34eded2 | ||
|
|
622dcc58ee | ||
|
|
770b6c1bb5 | ||
|
|
56c1cbf2e8 | ||
|
|
bd485671ff | ||
|
|
43be299a76 | ||
|
|
1493e0d650 | ||
|
|
592e22d509 | ||
|
|
c8e070ed62 | ||
|
|
ceb3908c6f | ||
|
|
4468f22968 | ||
|
|
eb3dc6a095 | ||
|
|
4a65486da9 | ||
|
|
07872e486f | ||
|
|
5aba961278 | ||
|
|
9be1481d17 | ||
|
|
eda1fa3268 | ||
|
|
633a2ace39 | ||
|
|
c2329c797c | ||
|
|
4d8de6887f | ||
|
|
5b2304d7b4 | ||
|
|
b6863fa3c9 | ||
|
|
c0ba4297c5 | ||
|
|
acc13fdc89 | ||
|
|
ee56fd2719 | ||
|
|
16863fa14e | ||
|
|
c957bbdeae | ||
|
|
c6a4fe00db | ||
|
|
30fc8c55a3 | ||
|
|
98c8115e96 | ||
|
|
d6b863b09c | ||
|
|
c730e2d9e8 | ||
|
|
81268e4b67 | ||
|
|
896a20a2a9 | ||
|
|
455ce0178b | ||
|
|
e268536dba | ||
|
|
e2aae9e166 | ||
|
|
8e4dbf5ab0 | ||
|
|
b7138e1052 | ||
|
|
5775f7e864 | ||
|
|
6deb757ba4 | ||
|
|
a0d25e62aa | ||
|
|
dc38e3a287 | ||
|
|
7b99d77bc6 | ||
|
|
1a79f34996 | ||
|
|
ad3ec0add1 | ||
|
|
a3ffafd3fe | ||
|
|
2d33b67399 | ||
|
|
e7e6c322a0 | ||
|
|
9ea9eed873 | ||
|
|
d882d1d100 | ||
|
|
b6e29912be | ||
|
|
687ef9f9fe | ||
|
|
4e1f4a8496 | ||
|
|
c1485dd854 | ||
|
|
35099b35ba | ||
|
|
2a5fb11132 | ||
|
|
a49513bedd | ||
|
|
fc6a8dcfb2 | ||
|
|
cbb4300cc2 | ||
|
|
deb79403bd | ||
|
|
9f43a52210 | ||
|
|
6bf0f043cd | ||
|
|
3f1cd6f52a | ||
|
|
d1da062806 | ||
|
|
bce88bc1ae | ||
|
|
8740ecf8c0 | ||
|
|
e92e87181b | ||
|
|
902dacb46a | ||
|
|
134bbf752c | ||
|
|
b27dd775ad | ||
|
|
e230d9a62b | ||
|
|
7709a02741 | ||
|
|
aaf9e9a820 | ||
|
|
674fed73ec | ||
|
|
98d1d862d5 | ||
|
|
aaef348f3d | ||
|
|
9bc96fd932 | ||
|
|
7b0658b00f | ||
|
|
f4034df457 | ||
|
|
5856751f41 | ||
|
|
4df9c47ca7 | ||
|
|
354a71cdc2 | ||
|
|
481c79dfac | ||
|
|
5e32f7c19a | ||
|
|
c5b4a727ab | ||
|
|
8c07ff563b | ||
|
|
fa997616ff | ||
|
|
0edd80c0f2 | ||
|
|
cc49da4ddf | ||
|
|
b7b4bec8df | ||
|
|
7aed2f97a5 | ||
|
|
89c7458b53 | ||
|
|
0809f17d77 | ||
|
|
550edf90b2 | ||
|
|
f3aa989205 | ||
|
|
f8a894c567 | ||
|
|
a0439c2405 | ||
|
|
edfabc70d3 | ||
|
|
9e14c22918 | ||
|
|
f3334434ea | ||
|
|
5686f159ab | ||
|
|
b7f12e5291 | ||
|
|
954daed8c2 | ||
|
|
b042ca3c0f | ||
|
|
5d3b5e175a | ||
|
|
1f13191b6f | ||
|
|
5aa665a624 | ||
|
|
85a5e683e8 | ||
|
|
e646037f4a | ||
|
|
536a6dd3ce | ||
|
|
701cc3fe2c | ||
|
|
22fc5f7ac9 | ||
|
|
4dcf0e2c7b | ||
|
|
67aea68e97 | ||
|
|
2320b98d89 | ||
|
|
4f90505509 | ||
|
|
4fcf9133ef | ||
|
|
1f29ee0e02 | ||
|
|
5285933ed8 | ||
|
|
1efbe325bd | ||
|
|
1f678f44f9 | ||
|
|
895cf6e91f | ||
|
|
682bc57d89 | ||
|
|
74ac72a78f | ||
|
|
f324aa68f9 | ||
|
|
88db6b6944 | ||
|
|
387d125c2d | ||
|
|
fd77d94155 | ||
|
|
137c6d5137 | ||
|
|
671567d496 | ||
|
|
aa3ef39ac8 | ||
|
|
b360fa26e5 | ||
|
|
168401bef2 | ||
|
|
9ecf7a54be | ||
|
|
b46b6af7e3 | ||
|
|
318e97ef64 | ||
|
|
9b525d2fe1 | ||
|
|
7a5e723600 | ||
|
|
9a2e78d703 | ||
|
|
b28d611552 | ||
|
|
f39ef82a14 | ||
|
|
c76348c318 | ||
|
|
dd9804a4fe | ||
|
|
f0018a3b9c | ||
|
|
9adb2c7cf1 | ||
|
|
857c948551 | ||
|
|
33cf956fc8 | ||
|
|
66816a3514 | ||
|
|
6417617d33 | ||
|
|
769b95b751 | ||
|
|
de0ebc7eb6 | ||
|
|
d8271b06b4 | ||
|
|
206205c6ee | ||
|
|
3336d7cf69 | ||
|
|
c319b5bf3b | ||
|
|
de577f3440 | ||
|
|
9f0489df43 | ||
|
|
46e7805428 | ||
|
|
d4b4519d8d | ||
|
|
b8d4bfe024 | ||
|
|
7046dfbc47 | ||
|
|
f119221740 | ||
|
|
fe38ed9d90 | ||
|
|
bc9ff8c14d | ||
|
|
a400a0e081 | ||
|
|
3abbefb5e4 | ||
|
|
51d5f8a438 | ||
|
|
e8c1aced2b | ||
|
|
9926b4ec03 | ||
|
|
20b09b0761 | ||
|
|
9d72d71f21 | ||
|
|
937873451a | ||
|
|
b7eb48d4fc | ||
|
|
2f67a24489 | ||
|
|
0fa2ce5716 | ||
|
|
1aef6a3960 | ||
|
|
e41d7c5bee | ||
|
|
37aa98f669 | ||
|
|
5c265cddbf | ||
|
|
da21549918 | ||
|
|
f46fed1458 | ||
|
|
fa9603b6d4 | ||
|
|
0f4de82749 | ||
|
|
46fa2b76aa | ||
|
|
1a8989fd9d | ||
|
|
f4795cc6b3 | ||
|
|
5688e294f7 | ||
|
|
3c1f0042f5 | ||
|
|
ca08f0ea65 | ||
|
|
61b343a3c8 | ||
|
|
ec76cb5726 | ||
|
|
d6c55effc3 | ||
|
|
788bdca00c | ||
|
|
c8b1db11d3 | ||
|
|
24ffc1a3c9 | ||
|
|
2cea3f1b14 | ||
|
|
73a15b2b5f | ||
|
|
3734f30bca | ||
|
|
7862d9f6fc | ||
|
|
7aa3fb3d47 | ||
|
|
6ac10d9b9a | ||
|
|
8c8f0df4f0 | ||
|
|
69e09f0559 | ||
|
|
1a18604b2e | ||
|
|
eae1c2b69c | ||
|
|
4c038111f8 | ||
|
|
a82d4c2b3d | ||
|
|
0cba2d7f5b | ||
|
|
a87ae161be | ||
|
|
275b1879c3 | ||
|
|
66cf2ad8ce | ||
|
|
0966c0f860 | ||
|
|
83a6c55c74 | ||
|
|
3c46adfe19 | ||
|
|
0787040b75 | ||
|
|
bf86c62a33 | ||
|
|
915dacbb85 | ||
|
|
b6b86da148 | ||
|
|
de38d76a18 | ||
|
|
166c00189a | ||
|
|
bca787f7c4 | ||
|
|
258f00968a | ||
|
|
bc40f9fcef | ||
|
|
d81418fd5e | ||
|
|
85ab4b9988 | ||
|
|
f75f8a4b1d | ||
|
|
dfada44550 | ||
|
|
5d4c822ef7 | ||
|
|
55f51356fb | ||
|
|
3f6afc4a7a | ||
|
|
dc87bf344c | ||
|
|
7a41a27413 | ||
|
|
8dc25234e0 | ||
|
|
24ad4ecf29 | ||
|
|
c9f0363bea | ||
|
|
c44bd5683d | ||
|
|
ae8bf0e8f1 | ||
|
|
fbba4d8d5e | ||
|
|
2b64713ac6 | ||
|
|
2464a2cd9d | ||
|
|
96e6715ebe | ||
|
|
72d973cb61 | ||
|
|
39d300f12b | ||
|
|
76f8538bf6 | ||
|
|
71411370e7 | ||
|
|
eb24d1f55c | ||
|
|
608b347584 | ||
|
|
6c4cbe6b5f | ||
|
|
ad31d9b60c | ||
|
|
8e2ee9a689 | ||
|
|
067af316b6 | ||
|
|
c0ab7dc021 | ||
|
|
8233adab59 | ||
|
|
be74434bbd | ||
|
|
bbc027cf8b | ||
|
|
43da73f064 | ||
|
|
ffc1ef87ea | ||
|
|
66e2135f07 | ||
|
|
e6a5c51ed7 | ||
|
|
d952853f74 | ||
|
|
3ebf224b28 | ||
|
|
9be2faa156 | ||
|
|
a8fff5ee1f | ||
|
|
4ab4534292 | ||
|
|
0e81b6b48e | ||
|
|
694c6b3a86 | ||
|
|
9724aab7a6 | ||
|
|
b6ca14a123 | ||
|
|
976f3796be | ||
|
|
1c643649b0 | ||
|
|
3337b5a092 | ||
|
|
b41ab84baa | ||
|
|
af996c06d0 | ||
|
|
2a21b4cf40 | ||
|
|
3614a52150 | ||
|
|
d2be99eb17 | ||
|
|
fca6110993 | ||
|
|
9bb0e5cdb7 | ||
|
|
cf302e3bc9 | ||
|
|
b50fed9980 | ||
|
|
baf047f89a | ||
|
|
a65f9eef4a | ||
|
|
9c149c3b6c | ||
|
|
d64368c699 | ||
|
|
97e76d3e24 | ||
|
|
a157495002 | ||
|
|
3c805daf45 | ||
|
|
8f55fdc385 | ||
|
|
26f88f15c8 | ||
|
|
6820c8729e | ||
|
|
78169b6a2f | ||
|
|
5a795ec749 | ||
|
|
d26ef4e978 | ||
|
|
40d911bc45 | ||
|
|
748db39d02 | ||
|
|
4db97b7a7d | ||
|
|
f8b26d3ade | ||
|
|
5c8eb8ec36 | ||
|
|
64f7bff756 | ||
|
|
040db4c3fe | ||
|
|
34ef74b11c | ||
|
|
de4a3dfb26 | ||
|
|
108881a3b2 | ||
|
|
7d5f893b7f | ||
|
|
8d977c3978 | ||
|
|
73f1bc31d7 | ||
|
|
497d1d9e97 | ||
|
|
764dd3149e | ||
|
|
b2b9bed164 | ||
|
|
9580e7cc87 | ||
|
|
a05267197a | ||
|
|
a90e5f5a69 | ||
|
|
1f47a082c4 | ||
|
|
7b55b7aa13 | ||
|
|
bcc94017bc | ||
|
|
b615d79ac3 | ||
|
|
04f549820f | ||
|
|
ded8b14afb | ||
|
|
4504b81f3b | ||
|
|
222412dbf1 | ||
|
|
71751f757d | ||
|
|
8c8424d0c2 | ||
|
|
e42f27d147 | ||
|
|
d1cca1ee9c | ||
|
|
0654f3206d | ||
|
|
67cf94a857 | ||
|
|
69ed54e544 | ||
|
|
3dabe6b533 | ||
|
|
2845214164 | ||
|
|
6b8102a180 | ||
|
|
570074d6d1 | ||
|
|
72a6d74ab2 | ||
|
|
cd6f0af0ea | ||
|
|
2746cd50c3 | ||
|
|
8a4261c7a5 | ||
|
|
90799b6c68 | ||
|
|
1c6320fe7c | ||
|
|
fecdd2bd2b | ||
|
|
15691fb64f | ||
|
|
cb366955f3 | ||
|
|
82a6fbda1c | ||
|
|
177b2553e2 | ||
|
|
814e63e371 | ||
|
|
2eed25f2ed | ||
|
|
1be9e19c7d | ||
|
|
b7895d0d10 | ||
|
|
8461820956 | ||
|
|
86960ce221 | ||
|
|
6670163eee | ||
|
|
437f8becaa | ||
|
|
5233121102 | ||
|
|
25c2989d30 | ||
|
|
4f96dfa43e | ||
|
|
f559a4afa3 | ||
|
|
b5d4b2c555 | ||
|
|
d8a157a00e | ||
|
|
85a75d3a16 | ||
|
|
d183ecddcd | ||
|
|
e30c09b4cb | ||
|
|
9d5d7f0d50 | ||
|
|
caae4ed5a7 | ||
|
|
a1ca60f4e5 | ||
|
|
ce861b2cb3 | ||
|
|
67ec78d188 | ||
|
|
d661be38ed | ||
|
|
69e30c7f2a | ||
|
|
8973e2b38c | ||
|
|
df52f23ebf | ||
|
|
5edc91fc05 | ||
|
|
8b4ac20908 | ||
|
|
1a0d9ea086 | ||
|
|
e49511faef | ||
|
|
e05c32a868 | ||
|
|
c2f898236f | ||
|
|
501ebc1cba | ||
|
|
77182607c0 | ||
|
|
6769657fa3 | ||
|
|
dab453378b | ||
|
|
aa266c29eb | ||
|
|
6b94589fa4 | ||
|
|
0d849addb3 | ||
|
|
1698b85090 | ||
|
|
a538ba0149 | ||
|
|
41f20fd38f | ||
|
|
1c8189de61 | ||
|
|
525e76fce0 | ||
|
|
d91624bd99 | ||
|
|
1c71127370 | ||
|
|
4f1553c89f | ||
|
|
1b9cb7ea23 | ||
|
|
479aba180c | ||
|
|
8eeae63a74 | ||
|
|
07584e33ec | ||
|
|
33ba435db5 | ||
|
|
73fe66c783 | ||
|
|
cc27b86c60 | ||
|
|
9db47bb808 | ||
|
|
8bf3961df0 | ||
|
|
df7d583cc2 | ||
|
|
271e41850b | ||
|
|
97b58344c5 | ||
|
|
627dac6c07 | ||
|
|
0742bc284e | ||
|
|
acca4638b8 | ||
|
|
05aabec021 | ||
|
|
e996c1bd77 | ||
|
|
b529a77be8 | ||
|
|
4faf0a9a17 | ||
|
|
3e50cea2f5 | ||
|
|
339738f351 | ||
|
|
a48a4d5c63 | ||
|
|
57a0382b5f | ||
|
|
835a8fa634 | ||
|
|
4ff7ab63ab | ||
|
|
d92f4ac85e | ||
|
|
21b8c52ae9 | ||
|
|
7303ca25db | ||
|
|
060fb58f86 | ||
|
|
d185a442b9 | ||
|
|
86046cb32f | ||
|
|
1500316caf | ||
|
|
72454050bb | ||
|
|
b0b9c6fee7 | ||
|
|
4a9feba665 | ||
|
|
afed66de3b | ||
|
|
d33f54f74f | ||
|
|
6d43eca61a | ||
|
|
59a56f4172 | ||
|
|
8cd774b0a3 | ||
|
|
7484a08597 | ||
|
|
3083c30362 | ||
|
|
81ae3684cc | ||
|
|
f8674300d4 | ||
|
|
b65d5875b7 | ||
|
|
7c85357876 | ||
|
|
913052e751 | ||
|
|
5536541dbb | ||
|
|
6fbae8149f | ||
|
|
be56f8286f | ||
|
|
b04a174558 | ||
|
|
1040389220 | ||
|
|
459b44b03d | ||
|
|
297c469d6f | ||
|
|
022f9b7d19 | ||
|
|
de2cfc1a5f | ||
|
|
005c4244f9 | ||
|
|
9b45312c35 | ||
|
|
bd3afcc718 | ||
|
|
d47e7953ba | ||
|
|
9860ca9f9b | ||
|
|
8f9f95b5ec | ||
|
|
2d354c5a2e | ||
|
|
7f5ed2b586 | ||
|
|
8ee842a15b | ||
|
|
7a16e5e6ff | ||
|
|
6cfcd41e1a | ||
|
|
89499f2124 | ||
|
|
e3db837339 | ||
|
|
b499483abd | ||
|
|
944f878a72 | ||
|
|
a1e9a949b4 | ||
|
|
d1680f86e1 | ||
|
|
019bdadfc9 | ||
|
|
7d57b34196 | ||
|
|
c8a0eec3f6 | ||
|
|
3d6852f7fa | ||
|
|
dd82647d0c | ||
|
|
b95b1e3c9a | ||
|
|
1d250b6098 | ||
|
|
b35b7e0553 | ||
|
|
d1703ad194 | ||
|
|
17800b0300 | ||
|
|
c9dcdd0fc5 | ||
|
|
b21c6f8e1e | ||
|
|
846b539b4e | ||
|
|
9a4e9f426c | ||
|
|
4e07d471cc | ||
|
|
5afa8c022e | ||
|
|
6202e79712 | ||
|
|
bd320fe27b | ||
|
|
bf319d9d88 | ||
|
|
1e9f7512fe | ||
|
|
75e63ae6cd | ||
|
|
d6dabd6cbb | ||
|
|
d5b2ff2b99 | ||
|
|
a3e608b76a | ||
|
|
d97f90581b | ||
|
|
5f90e3be67 | ||
|
|
f2f5e30bc2 | ||
|
|
6c1ee8402c | ||
|
|
ff9d584dcc | ||
|
|
aba2a0fd6d | ||
|
|
5baa94d136 | ||
|
|
6447e5b997 | ||
|
|
49d5578b0b | ||
|
|
ed757a3e9d | ||
|
|
e5aacbc6ea | ||
|
|
909f49e651 | ||
|
|
54f2cba1b5 | ||
|
|
880e67d643 | ||
|
|
166bbecf0b | ||
|
|
f94fab125e | ||
|
|
8bbc00b147 | ||
|
|
9ca70467e9 | ||
|
|
16f1ca4c35 | ||
|
|
c7087747a4 | ||
|
|
cdc8ee798f | ||
|
|
caf54306a3 | ||
|
|
cde06a54ea | ||
|
|
40af3c54b6 | ||
|
|
bb56dec673 | ||
|
|
1234569e43 | ||
|
|
82db55924e | ||
|
|
9a99175c0e | ||
|
|
88754c060d | ||
|
|
d3a2ca48d4 | ||
|
|
6adb4780b5 | ||
|
|
6e3bd39c14 | ||
|
|
cf59735d7b | ||
|
|
ff0e0181c9 | ||
|
|
138e17c26e | ||
|
|
2c7002e529 | ||
|
|
88b47ac69f | ||
|
|
f15c4ee154 | ||
|
|
9a25583ef1 | ||
|
|
d32d63e211 | ||
|
|
7daa83a149 | ||
|
|
b73eb2433d | ||
|
|
73ee461623 | ||
|
|
00fba41266 | ||
|
|
7822d5fe7f | ||
|
|
395dc1f7ff | ||
|
|
1f789a22a2 | ||
|
|
0354ab509e | ||
|
|
5b85894325 | ||
|
|
b77cb25935 | ||
|
|
ea9a4e4755 | ||
|
|
69c750af36 | ||
|
|
f2e553b126 | ||
|
|
8a93bbce06 | ||
|
|
965cb80669 | ||
|
|
0e397f0460 | ||
|
|
0ebd6b45a8 | ||
|
|
a8fab3b2eb | ||
|
|
2e9fdf49c5 | ||
|
|
0743fbb426 | ||
|
|
2c6fbbea7a | ||
|
|
3f6da994c0 | ||
|
|
adcacc9417 | ||
|
|
7e2f836a49 | ||
|
|
1bac92811e | ||
|
|
8fc17df678 | ||
|
|
1ff67f6c5c | ||
|
|
eabc99b8a4 | ||
|
|
b3f23e14d2 | ||
|
|
abe849cb76 | ||
|
|
4f9389cf1e | ||
|
|
3ac192dc18 | ||
|
|
39d746aace | ||
|
|
a4aa31ab26 | ||
|
|
fc27d7356d | ||
|
|
427694451d | ||
|
|
81655756c2 | ||
|
|
2cd2cfc95c | ||
|
|
dd55ac2967 | ||
|
|
0a8f8a7f96 | ||
|
|
8fdb4073cb | ||
|
|
6a3804bceb | ||
|
|
7a23da6e17 | ||
|
|
403470bdfb | ||
|
|
565c193a23 | ||
|
|
cd7e157b45 | ||
|
|
bac81b8dd0 | ||
|
|
6e92f27548 | ||
|
|
b3324ca196 | ||
|
|
c90aa4af6c | ||
|
|
2dcd72c77e | ||
|
|
4aba36bd9a | ||
|
|
2ee35792a0 | ||
|
|
782e6319e5 | ||
|
|
95bbe7a4e1 | ||
|
|
5631658518 | ||
|
|
64e75882f4 | ||
|
|
151c87c3df | ||
|
|
0e12cbe0e2 | ||
|
|
6165d7114f | ||
|
|
2edf3e95db | ||
|
|
b2a6e3f614 | ||
|
|
be1e26b2e5 | ||
|
|
185ee08979 | ||
|
|
020235e167 | ||
|
|
445485d9b8 | ||
|
|
0fd7aaf38c | ||
|
|
48a83af35c | ||
|
|
bb73f9b20e | ||
|
|
611fadd9e8 | ||
|
|
f95b33a519 | ||
|
|
73771cb380 | ||
|
|
48da137f84 | ||
|
|
4e378387d0 | ||
|
|
830edd4985 | ||
|
|
770c39a710 | ||
|
|
4e2bc789ab | ||
|
|
da0732da37 | ||
|
|
b3edfeaeee | ||
|
|
e1d09fbef3 | ||
|
|
4d73de7228 | ||
|
|
97a165c61f | ||
|
|
57ebb8d808 | ||
|
|
0aa5a0d85e | ||
|
|
c49c23e608 | ||
|
|
1a6f58ae67 | ||
|
|
49a11aa4d4 | ||
|
|
ebecb3f230 | ||
|
|
be34aaaa35 | ||
|
|
939977073e | ||
|
|
17d7e0206d | ||
|
|
c968981077 | ||
|
|
23357a490e | ||
|
|
c08ca675ac | ||
|
|
25353ae5a7 | ||
|
|
0e4c958fb8 | ||
|
|
8b6603f085 | ||
|
|
a3dcaf6a83 | ||
|
|
f00f8f6a9c | ||
|
|
f472159d99 | ||
|
|
0e1b0b2ea2 | ||
|
|
a46e9f0919 | ||
|
|
22438d75ce | ||
|
|
9b18c35ac9 | ||
|
|
33f1edc571 | ||
|
|
e9e376d85f | ||
|
|
81f10fbd43 | ||
|
|
a44e5341bb | ||
|
|
08b1c573cd | ||
|
|
d858c3c433 | ||
|
|
39b53154ca | ||
|
|
214a8623eb | ||
|
|
e1356e7fe7 | ||
|
|
0760dc7412 | ||
|
|
f3a6e69b4e | ||
|
|
6d722e99e2 | ||
|
|
2cac22f76f | ||
|
|
983cd11143 | ||
|
|
aea44f3fa0 | ||
|
|
f8038b425a | ||
|
|
ff6e48f61e | ||
|
|
a5565c08a3 | ||
|
|
b510774dbb | ||
|
|
e10f361193 | ||
|
|
dfe9af3d61 | ||
|
|
49d7e8c71f | ||
|
|
eb53331d93 | ||
|
|
4d3c9a170d | ||
|
|
ee2d8446f4 | ||
|
|
1021e06a20 | ||
|
|
8dc1b2caf4 | ||
|
|
d19f921653 | ||
|
|
cf83af7c10 | ||
|
|
4bdc0991b0 | ||
|
|
fc1e3ad166 | ||
|
|
901ef41f7f | ||
|
|
50326157d9 | ||
|
|
9e9f0846f8 | ||
|
|
09917b2b9a | ||
|
|
02080dd37e | ||
|
|
039653dde5 | ||
|
|
144bbe26ac | ||
|
|
933e0997e2 | ||
|
|
8f90ed0f42 | ||
|
|
96380f703c | ||
|
|
40709c446a | ||
|
|
c8da0cbba6 | ||
|
|
575f5c2f24 | ||
|
|
662a4f705c | ||
|
|
ae53a3e4da | ||
|
|
a5385f0a5f | ||
|
|
b8e83dda2b | ||
|
|
577627b257 | ||
|
|
7e7943c979 | ||
|
|
1734d51c53 | ||
|
|
8686e2bf77 | ||
|
|
5a6effff70 | ||
|
|
a5810cd3de | ||
|
|
3a1f0aa8d5 | ||
|
|
462d532cd5 | ||
|
|
3adf8ab9c6 | ||
|
|
16b7a20d01 | ||
|
|
f32a1186bc | ||
|
|
2689e0a07c | ||
|
|
9d7b428daa | ||
|
|
f177ed1332 | ||
|
|
ad3a1fbb82 | ||
|
|
82cd6af9bc | ||
|
|
971d190dc4 | ||
|
|
05fc0219ad | ||
|
|
aeb6f5e5f3 | ||
|
|
f055dbe669 | ||
|
|
55408e0307 | ||
|
|
0dd327c851 | ||
|
|
1f60246c8b | ||
|
|
76be42eef0 | ||
|
|
018d1056e0 | ||
|
|
17b6fd61c3 | ||
|
|
03e6d30ae7 | ||
|
|
78abfe5da3 | ||
|
|
ffb5b5a2ad | ||
|
|
12eea70d7d | ||
|
|
9ffd4ae3df | ||
|
|
c487c2b929 | ||
|
|
fe62a85366 | ||
|
|
4b4c8534e6 | ||
|
|
e716f459a5 | ||
|
|
013d63bb67 | ||
|
|
f604c52243 | ||
|
|
e321b0bd06 | ||
|
|
007b5b4ba8 | ||
|
|
c58f8e0f80 | ||
|
|
328bfd1fb7 | ||
|
|
a3f0f65334 | ||
|
|
0a2ef3619c | ||
|
|
5854bc4e0c | ||
|
|
429ea1bad3 | ||
|
|
efde89cc27 | ||
|
|
d4d8f86b15 | ||
|
|
69254ed7d2 | ||
|
|
7b86692737 | ||
|
|
c82dbabbea | ||
|
|
3bd2a88618 | ||
|
|
4c5cf8b144 | ||
|
|
d1033dc2b9 | ||
|
|
a36e91c826 | ||
|
|
e9bcabbf05 | ||
|
|
20d893e3e2 | ||
|
|
3610481c97 | ||
|
|
b4c60a84e1 | ||
|
|
a67cbceb5a | ||
|
|
71a47cd7bb | ||
|
|
8f945ecf3a | ||
|
|
d7bb6bd985 | ||
|
|
37c05b6267 | ||
|
|
37bcdce62a | ||
|
|
52a97ad805 | ||
|
|
cc785dc620 | ||
|
|
0f44320b83 | ||
|
|
3032dfa4ef | ||
|
|
f199ae5181 | ||
|
|
c2c9db2056 | ||
|
|
13a9a251d8 | ||
|
|
f0da6c980d | ||
|
|
6673e992d4 | ||
|
|
141a1086a2 | ||
|
|
f74e9bb483 | ||
|
|
a2bbbeb38f | ||
|
|
f3e058b838 | ||
|
|
9ed4fe029a | ||
|
|
49ac3c60d0 | ||
|
|
d9ef180ae5 | ||
|
|
9d29159931 | ||
|
|
342d5997cc | ||
|
|
e63e45a195 | ||
|
|
6b4ccb9ba3 | ||
|
|
22e86fcb3c | ||
|
|
faf5915f7d | ||
|
|
d538aba94d | ||
|
|
26f187aa36 | ||
|
|
7e87cd0d6e | ||
|
|
a20eb902b8 | ||
|
|
da66e2e769 | ||
|
|
963388111d | ||
|
|
7499ea8154 | ||
|
|
79f359ff8a | ||
|
|
6a19cbc61b | ||
|
|
9e546891f1 | ||
|
|
171aba014f | ||
|
|
ed3d57b572 | ||
|
|
81e231a46d | ||
|
|
0622127ac6 | ||
|
|
a76f632427 | ||
|
|
bf660d1331 | ||
|
|
7bb9c7382f | ||
|
|
6e955cb84a | ||
|
|
f08ced6c34 | ||
|
|
c66278dffc | ||
|
|
ed2d4df754 | ||
|
|
1bc1a37f86 | ||
|
|
674233fb72 | ||
|
|
1f2219cabf | ||
|
|
f0d9306c78 | ||
|
|
28c6609c86 | ||
|
|
43c38af6a1 | ||
|
|
7cbb85937a | ||
|
|
8c61ed9ff1 | ||
|
|
6ba06cf611 | ||
|
|
957f363d1d | ||
|
|
38856139ea | ||
|
|
206ffe5898 | ||
|
|
34b462a936 | ||
|
|
82495b5d26 | ||
|
|
cf806f5d2d | ||
|
|
148e5d1b4d | ||
|
|
8a149d2242 | ||
|
|
b84871a279 | ||
|
|
807e464dec | ||
|
|
1f3a6e1eb8 | ||
|
|
a48426382d | ||
|
|
77ad7205cb | ||
|
|
c599760ff1 | ||
|
|
e563a1a5b5 | ||
|
|
4e329a1473 | ||
|
|
fd717e8d45 | ||
|
|
13e80acf07 | ||
|
|
51e2ffc524 | ||
|
|
379688e35d | ||
|
|
4d2231d02c | ||
|
|
c344de8d9b | ||
|
|
fb5e934c73 | ||
|
|
09ad98374b | ||
|
|
6864ceca11 | ||
|
|
ef43db1c4b | ||
|
|
b9dbd94712 | ||
|
|
9ff69c8035 | ||
|
|
c03498f2e7 | ||
|
|
e45c3dba07 | ||
|
|
bc6477ff72 | ||
|
|
e46f105350 | ||
|
|
6ab7032952 | ||
|
|
a5301cb3e2 | ||
|
|
9bab244d20 | ||
|
|
3b5b337246 | ||
|
|
3b60294bd9 | ||
|
|
7243403b27 | ||
|
|
d478d6efec | ||
|
|
dbfbb93424 | ||
|
|
29a4bf90d3 | ||
|
|
fe5cad6b29 | ||
|
|
39520407ef | ||
|
|
2e4b629e21 | ||
|
|
eaca68c289 | ||
|
|
7e02b6c989 | ||
|
|
32dfed954f | ||
|
|
55f43f7915 | ||
|
|
6cca23cec4 | ||
|
|
0be2660d96 | ||
|
|
a8bf544803 | ||
|
|
c841079462 | ||
|
|
ad06715030 | ||
|
|
66a4baa8a6 | ||
|
|
ae2b7961cf | ||
|
|
6f84766d19 | ||
|
|
fd00df9c4d | ||
|
|
d15557db96 | ||
|
|
b31c11e46b | ||
|
|
bdb5516fdd | ||
|
|
c8c93cfefa | ||
|
|
640221896f | ||
|
|
d73ea5f65a | ||
|
|
d72623052b | ||
|
|
a5b38192d0 | ||
|
|
5681a0705f | ||
|
|
04f6bb2648 | ||
|
|
ad09410b04 | ||
|
|
cc4722e802 | ||
|
|
f8e66794d9 | ||
|
|
e2b45cb9fe | ||
|
|
2170a48956 | ||
|
|
beebc69168 | ||
|
|
daf9d41918 | ||
|
|
105cbe3ea3 | ||
|
|
f14dbb1710 | ||
|
|
ec8df1d330 | ||
|
|
d7232f8ca7 | ||
|
|
c217428f39 | ||
|
|
41939d7bfe | ||
|
|
e7f9f83fa1 | ||
|
|
77eb8604f1 | ||
|
|
f8d8ad4e94 | ||
|
|
52e7fcc46c | ||
|
|
96cde75480 | ||
|
|
55b181511c | ||
|
|
6ce74d5d36 | ||
|
|
588d70c624 | ||
|
|
6a8e993550 | ||
|
|
087520e781 | ||
|
|
8879e63dee | ||
|
|
1a37445686 | ||
|
|
d6ce71fb68 | ||
|
|
65e65dbf30 | ||
|
|
ec00767a8e | ||
|
|
f443264116 | ||
|
|
6292a2bb96 | ||
|
|
2371d8faaf | ||
|
|
2dc45ff0c8 | ||
|
|
d2a170a785 | ||
|
|
2da0b15537 | ||
|
|
9191f089b9 | ||
|
|
5f201a38b6 | ||
|
|
53feb25dd7 | ||
|
|
9726d96742 | ||
|
|
3283bb8b93 | ||
|
|
2b9d8efc91 | ||
|
|
c3da9e25ed | ||
|
|
ab367e6b13 | ||
|
|
8d0687974f | ||
|
|
230bf31c87 | ||
|
|
5f7aed5f78 | ||
|
|
65b0c96d46 | ||
|
|
cb05584160 | ||
|
|
79043436ce | ||
|
|
3584f04f59 | ||
|
|
1f5e4907c2 | ||
|
|
a04e5b9dbc | ||
|
|
ce8d840e83 | ||
|
|
39da0cbc3b | ||
|
|
dffa52e11a | ||
|
|
60c672e7ec | ||
|
|
ace3c90796 | ||
|
|
c2c680ad95 | ||
|
|
e34407ac09 | ||
|
|
bca49a8c12 | ||
|
|
483f907eb8 | ||
|
|
f680954f1f | ||
|
|
e7a17082b4 | ||
|
|
33675b72ce | ||
|
|
7708d86636 | ||
|
|
ff8d7f3d98 | ||
|
|
39e3db9605 | ||
|
|
8619939503 | ||
|
|
aba49610d9 | ||
|
|
4b5edfea53 | ||
|
|
98daab19b9 | ||
|
|
6924fde974 | ||
|
|
cf19019bf9 | ||
|
|
eccfa6b591 | ||
|
|
1778e41773 | ||
|
|
2d3aded1bb | ||
|
|
9d524deb2b | ||
|
|
12079963ab | ||
|
|
30ee9b3006 | ||
|
|
e87dcda480 | ||
|
|
3d929fbda2 | ||
|
|
c0e5ce613e | ||
|
|
59a8abac57 | ||
|
|
89aa821b03 | ||
|
|
eaa53735c2 | ||
|
|
2dfa2338b8 | ||
|
|
a7f53c72b3 | ||
|
|
f6234990b2 | ||
|
|
9eb2ccc113 | ||
|
|
92ae1c7d2a | ||
|
|
31d9a98e82 | ||
|
|
4df3e0f3b9 | ||
|
|
834c4dbfe1 | ||
|
|
3d7a795592 | ||
|
|
1352d5e6ce | ||
|
|
327b8f63c0 | ||
|
|
af49390ea7 | ||
|
|
ac42c1a725 | ||
|
|
5f9e998bca | ||
|
|
16bcaae35b | ||
|
|
315d948fe2 | ||
|
|
3016c52459 | ||
|
|
a6e3bc0ace | ||
|
|
940dc652a5 | ||
|
|
c0d85f7e45 | ||
|
|
fdd7f15c6e | ||
|
|
88fec8763a | ||
|
|
80fe6fbd20 | ||
|
|
ca10098c93 | ||
|
|
e336878a5b | ||
|
|
6f98f91fad | ||
|
|
a2e3399aa2 | ||
|
|
f3643f7edd | ||
|
|
108783401d | ||
|
|
88cd90df1e | ||
|
|
f6c0c0ee16 | ||
|
|
bb4904c751 | ||
|
|
6fdcba1097 | ||
|
|
7ce4ee180b | ||
|
|
84d9e6f35b | ||
|
|
5e333bb8b8 | ||
|
|
7d5c9847aa | ||
|
|
116698bb24 | ||
|
|
93fe4a3b72 | ||
|
|
3a66ad8dcd | ||
|
|
b12b63eced | ||
|
|
5f44c5626b | ||
|
|
829258e77c | ||
|
|
d9a1527093 | ||
|
|
bd5a2dc9e1 | ||
|
|
95ed06eb09 | ||
|
|
19ee58e090 | ||
|
|
b61f6618aa | ||
|
|
7ed190837a | ||
|
|
812dc8da17 | ||
|
|
b150de0a99 | ||
|
|
2757680bbf | ||
|
|
9fecbb3105 | ||
|
|
b0126126d2 | ||
|
|
3260d507f5 | ||
|
|
537879ee7d | ||
|
|
0c483136cf | ||
|
|
106eedf2a8 | ||
|
|
cec4418796 | ||
|
|
25e0824d28 | ||
|
|
739a268735 | ||
|
|
7c5d2581a0 | ||
|
|
9f99fca934 | ||
|
|
d7dfef329f | ||
|
|
daaa56f985 | ||
|
|
143be7ea2d | ||
|
|
4cb0cadf96 | ||
|
|
b5545e03db | ||
|
|
4dfe280c99 | ||
|
|
616d9920c0 | ||
|
|
65a185d754 | ||
|
|
5dcb9b11aa | ||
|
|
fbc1b0b06f | ||
|
|
1f64389cd5 | ||
|
|
e2017655a1 | ||
|
|
09af7ed5f7 | ||
|
|
2c663e070c | ||
|
|
799114aa8c | ||
|
|
8ed20d830e | ||
|
|
a513c6c10e | ||
|
|
35640da77d | ||
|
|
b8fbc41536 | ||
|
|
475fb2e732 | ||
|
|
b1bf91b67d | ||
|
|
e2a422b8ef | ||
|
|
81ab1beb52 | ||
|
|
c199939348 | ||
|
|
76685fb1e9 | ||
|
|
3e8dff57b2 | ||
|
|
1207fe6788 | ||
|
|
24946d8604 | ||
|
|
aa8f9f7e67 | ||
|
|
9136c97143 | ||
|
|
976d5c8a3f | ||
|
|
3b023926b1 | ||
|
|
048aa98ba8 | ||
|
|
3c5e612fce | ||
|
|
92452ed0a0 | ||
|
|
edc1ebe9e7 | ||
|
|
96719d7999 | ||
|
|
739185ba74 | ||
|
|
6bf3479c9f | ||
|
|
2c8881fa4e | ||
|
|
a246888987 | ||
|
|
5f4e35a42a | ||
|
|
004fa32b78 | ||
|
|
b679f078af | ||
|
|
64c38128cb | ||
|
|
47ffae51d2 | ||
|
|
dc93e67305 | ||
|
|
04b3f8c73f | ||
|
|
15da58e940 | ||
|
|
2c45ec8870 | ||
|
|
b0a76138e8 | ||
|
|
f48d309e1f | ||
|
|
9f29c127ad | ||
|
|
4edc4fdd20 | ||
|
|
bf25ff5686 | ||
|
|
5dee541de5 | ||
|
|
9ca4b0ce4c | ||
|
|
86d77d28f6 | ||
|
|
5fec9dcd63 | ||
|
|
5cd332146d | ||
|
|
f35a629b10 | ||
|
|
2115d8b251 | ||
|
|
44256afd61 | ||
|
|
078fb9958e | ||
|
|
10d2bd9fe1 | ||
|
|
d5f68c636f | ||
|
|
fc5b8b497f | ||
|
|
399ca3007b | ||
|
|
69450c7b8e | ||
|
|
2abb1fd55d | ||
|
|
5679351226 | ||
|
|
52d06428c4 | ||
|
|
9fa18193a8 | ||
|
|
c5a36496a9 | ||
|
|
89f0eb153f | ||
|
|
0816398823 | ||
|
|
2ca0198ba4 | ||
|
|
441d42d262 | ||
|
|
47635579b0 | ||
|
|
ed034dc2fb | ||
|
|
d704481d1f | ||
|
|
9445f3be05 | ||
|
|
ba9af72e94 | ||
|
|
f2f8c736c9 | ||
|
|
3ee1d2075c | ||
|
|
4ff47b028e | ||
|
|
6d622fcb6b | ||
|
|
dfdd08e943 | ||
|
|
bcb31e6df5 | ||
|
|
e37426d44c | ||
|
|
5344a40bc2 | ||
|
|
f79086fbd3 | ||
|
|
3944f9acc9 | ||
|
|
5f69a51188 | ||
|
|
fc27421c82 |
@@ -25,3 +25,8 @@ all:
|
||||
@exit 1
|
||||
|
||||
endif
|
||||
|
||||
# Tell version 3.79 and up of GNU make to not build goals in this
|
||||
# directory in parallel. This is necessary in case someone tries to
|
||||
# build multiple targets on one command line.
|
||||
.NOTPARALLEL:
|
||||
|
||||
@@ -11,10 +11,15 @@ maintainer-check:
|
||||
$(MAKE) distcheck
|
||||
$(MAKE) my-distcheck
|
||||
|
||||
prev-version := $(shell echo $(VERSION)|tr a-z Xa-y)
|
||||
prev_version_file = .prev-version
|
||||
|
||||
THIS_VERSION_REGEXP = $(subst .,\.,$(VERSION))
|
||||
PREV_VERSION := $(shell cat $(prev_version_file))
|
||||
PREV_VERSION_REGEXP := $(shell echo $(PREV_VERSION)|sed 's/\./\\./g')
|
||||
|
||||
tag-package = $(shell echo "$(PACKAGE)" | tr a-z A-Z)
|
||||
tag-this-version = $(subst .,_,$(VERSION))
|
||||
tag-prev-version = $(subst .,_,$(prev-version))
|
||||
tag-prev-version = $(subst .,_,$(PREV_VERSION))
|
||||
this-cvs-tag = $(tag-package)-$(tag-this-version)
|
||||
prev-cvs-tag = $(tag-package)-$(tag-prev-version)
|
||||
|
||||
@@ -25,6 +30,9 @@ po-check:
|
||||
diff -u $@-1 $@-2
|
||||
rm -f $@-1 $@-2
|
||||
|
||||
# Do not save the original name or timestamp in the .tar.gz file.
|
||||
GZIP_ENV = --no-name
|
||||
|
||||
# Tag before making distribution. Also, don't make a distribution if
|
||||
# checks fail. Also, make sure the NEWS file is up-to-date.
|
||||
# FIXME: use dist-hook/my-dist like distcheck-hook/my-distcheck.
|
||||
@@ -70,25 +78,20 @@ my-distcheck: writable-files po-check
|
||||
echo "$(distdir).tar.gz is ready for distribution"; \
|
||||
echo "========================"
|
||||
|
||||
THIS_VERSION_REGEXP = $(subst .,\.,$(VERSION))
|
||||
# FIXME: this works only for Gnits-style test releases.
|
||||
PREV_VERSION := $(shell echo $(VERSION)|tr b-z a-y|sed 's/a$$//')
|
||||
PREV_VERSION_REGEXP := $(shell echo $(PREV_VERSION)|sed 's/\./\\./g')
|
||||
v = Version
|
||||
|
||||
a_host = alpha.gnu.org
|
||||
b_host = tug.org
|
||||
b_host = freefriends.org
|
||||
|
||||
alpha_subdir = gnu/fetish
|
||||
a_url_dir = $(alpha_subdir)
|
||||
b_url_dir = $(alpha_subdir)
|
||||
|
||||
a_real_dir = /fs/share/ftp/$(alpha_subdir)
|
||||
b_real_dir = /home/ftp/pub/$(alpha_subdir)
|
||||
b_real_dir = fetish-ftp
|
||||
|
||||
url_dir_list = $(foreach x,a b,ftp://$($(x)_host)/$($(x)_url_dir))
|
||||
|
||||
md5 = $(shell md5sum < $(distdir).tar.gz|sed 's/ -//')
|
||||
sha1 = $(shell sha1sum < $(distdir).tar.gz|sed 's/ -//')
|
||||
|
||||
rel-check:
|
||||
tarz=/tmp/rel-check-tarz-$$$$; \
|
||||
@@ -119,17 +122,20 @@ announcement: NEWS ChangeLog $(distdir).tar.gz
|
||||
echo " $$url/$(xd-delta)"; \
|
||||
done; \
|
||||
echo; \
|
||||
echo "Here are the MD5 and SHA1 signatures for the .tar.gz file"; \
|
||||
echo; \
|
||||
echo "$(md5) $(distdir).tar.gz"; \
|
||||
echo "$(sha1) $(distdir).tar.gz"; \
|
||||
echo; \
|
||||
echo NEWS:; \
|
||||
sed -n "/$(THIS_VERSION_REGEXP)/,/$(PREV_VERSION_REGEXP)/p" NEWS \
|
||||
sed -n "/$(THIS_VERSION_REGEXP)/,/^\[$(PREV_VERSION_REGEXP)/p" NEWS \
|
||||
| grep -v '^\['; \
|
||||
echo; \
|
||||
echo ChangeLog entries:; \
|
||||
find . -name ChangeLog \
|
||||
find . -name ChangeLog -maxdepth 2 \
|
||||
| xargs cvs diff -up -r$(prev-cvs-tag) -rHEAD \
|
||||
| sed -n 's/^+//p' \
|
||||
| perl -ne 'm!^\+\+ (\./)?! or print,next;' \
|
||||
| perl -ne 'm!^\+\+ (\./)?! or print,next;' \
|
||||
-e 'print "\n"."*"x70 ."\n"; s///; print; print "*"x70 ."\n"'; \
|
||||
)
|
||||
|
||||
@@ -145,11 +151,13 @@ writable-files:
|
||||
WGET = wget
|
||||
ftp-gnu = ftp://ftp.gnu.org/gnu
|
||||
|
||||
automake_repo=:pserver:anoncvs@anoncvs.cygnus.com:/cvs/automake
|
||||
.PHONY: wget-update
|
||||
wget-update:
|
||||
$(WGET) $(ftp-gnu)/texinfo/texinfo.tex -O $(srcdir)/doc/texinfo.tex
|
||||
$(WGET) $(ftp-gnu)/config/config.guess -O $(srcdir)/config.guess
|
||||
$(WGET) $(ftp-gnu)/config/config.sub -O $(srcdir)/config.sub
|
||||
cvs -d $(automake_repo) co -p automake/depcomp > depcomp
|
||||
|
||||
alpha: writable-files po-check
|
||||
$(MAKE) cvs-dist
|
||||
@@ -160,9 +168,11 @@ alpha: writable-files po-check
|
||||
&& xdelta delta -9 $(prev-tgz) $(distdir).tar.gz $(xd-delta) || :
|
||||
ln $(release-archive-dir)/$(xd-delta) .
|
||||
chmod a-w $(release-archive-dir)/$(xd-delta)
|
||||
echo $(VERSION) > $(prev_version_file)
|
||||
cvs ci -m. $(prev_version_file)
|
||||
@echo =====================================
|
||||
@echo =====================================
|
||||
@echo 'scp $(xd-delta) $(distdir).tar.gz \'
|
||||
@echo 'rsync -e ssh --pro -av $(xd-delta) $(distdir).tar.gz \'
|
||||
@echo ' $(b_host):$(b_real_dir)'
|
||||
@echo '# send the /tmp/announcement e-mail'
|
||||
@echo =====================================
|
||||
|
||||
32
THANKS
32
THANKS
@@ -14,8 +14,10 @@ Alan Iwi iwi@atm.ox.ac.uk
|
||||
Alberto Accomazzi alberto@cfa0.harvard.edu
|
||||
aldomel aldomel@ix.netcom.com
|
||||
Alen Muzinic zveki@fly.cc.fer.hr
|
||||
Alexandre Duret-Lutz duret_g@epita.fr
|
||||
Alexey Solovyov alekso@math.uu.se
|
||||
Andre Novaes Cunha Andre.Cunha@br.global-one.net
|
||||
Andreas Gruenbacher ag@bestbits.at
|
||||
Andreas Jaeger jaeger@gnu.org
|
||||
Andreas Luik luik@isa.de
|
||||
Andreas Schwab schwab@suse.de
|
||||
@@ -26,6 +28,7 @@ Andrew Dalke dalke@bioreason.com
|
||||
Andrew Tridgell tridge@samba.org
|
||||
Andries Brouwer Andries.Brouwer@cwi.nl
|
||||
Andy Longton alongton@metamark.com
|
||||
Antonio Rendas ajrendas@yahoo.com
|
||||
Ariel Faigon ariel@cthulhu.engr.sgi.com
|
||||
Arne H. Juul arnej@solan.unit.no
|
||||
Arne Henrik Juul arnej@imf.unit.no
|
||||
@@ -50,18 +53,23 @@ Carlos Canau Carlos.Canau@relay.puug.pt
|
||||
Charles Karney karney@pppl.gov
|
||||
Charles Randall crandall@matchlogic.com
|
||||
Chip Salzenberg chip@valinux.com
|
||||
Chris Sylvain csylvain@umm.edu
|
||||
Chris Yeo cyeo@biking.org
|
||||
Christi Alice Scarborough christi@chiark.greenend.org.uk
|
||||
Christian Krackowizer kra1@technodat.co.at
|
||||
Christian Krackowizer ckrackowiz@std.schuler-ag.com
|
||||
Christian Rose menthos@menthos.com
|
||||
Christian von Roques roques@pond.sub.org
|
||||
Chuck Hedrick hedrick@klinzhai.rutgers.edu
|
||||
Clark Morgan cmorgan@aracnet.com
|
||||
Colin Plumb colin@nyx.net
|
||||
Collin Rogowski collin@rogowski.de
|
||||
Dan Hagerty hag@gnu.ai.it.edu
|
||||
Dan Pascu dan@services.iiruc.ro
|
||||
Daniel Bergstrom noa@melody.se
|
||||
Darren Salt ds@youmustbejoking.demon.co.uk
|
||||
David Dyck dcd@tc.fluke.COM
|
||||
David Godfrey dave@delta.demon.co.uk
|
||||
David Luyer david_luyer@pacific.net.au
|
||||
Dennis Henriksen opus@flamingo.osrl.dk
|
||||
Derek Clegg dclegg@next.com
|
||||
Dick Streefland dick_streefland@tasking.com
|
||||
@@ -73,7 +81,7 @@ Doug McLaren dougmc@comco.com
|
||||
Dragos Harabor dharabor@us.oracle.com
|
||||
Ed Avis epa98@doc.ic.ac.uk
|
||||
Edzer Pebesma Edzer.Pebesma@rivm.nl
|
||||
Eirik Fuller eirik@netcom.com
|
||||
Eirik Fuller eirik@hackrat.com
|
||||
Eivind eivindt@multinet.no
|
||||
Eli Zaretskii eliz@is.elta.co.il
|
||||
Emile LeBlanc leblanc@math.toronto.edu
|
||||
@@ -84,6 +92,7 @@ Erik Corry erik@kroete2.freinet.de
|
||||
Felix Lee flee@teleport.com
|
||||
Fletcher Mattox fletcher@cs.utexas.edu
|
||||
Florin Iucha fiucha@hsys.mic.ro
|
||||
Frank Adler fadler@allesklar.de
|
||||
Frank T Lofaro ftlofaro@snooks.Egr.UNLV.EDU
|
||||
François Pinard pinard@iro.umontreal.ca
|
||||
Fred Fish fnf@ninemoons.com
|
||||
@@ -96,6 +105,7 @@ Geoff Odhner geoff@franklin.com
|
||||
Gerhard Poul gpoul@gnu.org
|
||||
Germano Leichsenring germano@jedi.cs.kobe-u.ac.jp
|
||||
GOTO Masanori gotom@debian.or.jp
|
||||
Greg Louis glouis@dynamicro.on.ca
|
||||
Greg McGary gkm@gnu.org
|
||||
Greg Troxel gdt@bbn.com
|
||||
Greg Wooledge gawooledge@sherwin.com
|
||||
@@ -116,6 +126,8 @@ James Sneeringer jvs@ocslink.com
|
||||
James Tanis jtt@soscorp.com
|
||||
James Youngman james+usenet@free-lunch.demon.co.uk
|
||||
Jamie Lokier jamie@imbolc.ucc.ie
|
||||
Jan Fedak J.Fedak@sh.cvut.cz
|
||||
Jan Nieuwenhuizen janneke@gnu.org
|
||||
Janos Farkas chexum@shadow.banki.hu
|
||||
Jarkko Hietaniemi jhi@epsilon.hut.fi
|
||||
Jeff Moore jbm@mordor.com
|
||||
@@ -142,12 +154,16 @@ John Salmon johns@mullet.anu.edu.au
|
||||
John Summerfield summer@OS2.ami.com.au
|
||||
Joost van Baal joostvb@xs4all.nl
|
||||
Joseph S. Myers jsm28@cam.ac.uk
|
||||
jvogel jvogel@linkny.com
|
||||
Jungshik Shin jshin@pantheon.yale.edu
|
||||
Jürgen Fluk louis@dachau.marco.de
|
||||
jvogel jvogel@linkny.com
|
||||
Kai-Uwe Rommel rommel@informatik.tu-muenchen.de
|
||||
Kai Henningsen kai@debian.org
|
||||
Kalle Olavi Niemitalo tosi@stekt.oulu.fi
|
||||
Kamal Paul Nigam Kamal_Paul_Nigam@gs35.sp.cs.cmu.edu
|
||||
Karl Eichwalder keichwa@gmx.net
|
||||
Karl Heuer kwzh@gnu.org
|
||||
Karl-Michael Schneider schneide@phil.uni-passau.de
|
||||
Karsten Thygesen karthy@kom.auc.dk
|
||||
Kaveh R. Ghazi ghazi@caip.rutgers.edu
|
||||
Keith Owens kaos@audio.apana.org.au
|
||||
@@ -159,6 +175,7 @@ Lars Hecking lhecking@nmrc.ucc.ie
|
||||
Lehti Rami rammer@cs.tut.fi
|
||||
Leonard N. Zubkoff lnz@dandelion.com
|
||||
Lorne Baker lbaker@nitro.avint.net
|
||||
M. P. Suzuki mpsuzuki@hiroshima-u.ac.jp
|
||||
Maciej Kwapulinski pikpok@univ.gda.pl
|
||||
Manas Garg manas@cygsoft.com
|
||||
Manfred Hollstein manfred@s-direktnet.de
|
||||
@@ -171,9 +188,11 @@ Mark D. Roth roth@uiuc.edu
|
||||
Mark Harris mark@monitor.designacc.com
|
||||
Mark Hewitt mhewitt@armature.com
|
||||
Mark Kettenis kettenis@phys.uva.nl
|
||||
Mark Nudelman marknu@flash.net
|
||||
Mark W. Eichin eichin@cygnus.com
|
||||
Markus Demleitner msdemlei@auriga.ari.uni-heidelberg.de
|
||||
Martin martin@dresden.nacamar.de
|
||||
Martin Gallant martyg@goodbit.net
|
||||
Martin Hippe martin.hippe@schlund.de
|
||||
Martin Mitchell martin@debian.org
|
||||
Martin P.J. Zinser zinser@decus.de
|
||||
@@ -181,16 +200,19 @@ Marty Leisner leisner@sdsp.mc.xerox.com
|
||||
Masami Takikawa takikawm@CS.ORST.EDU
|
||||
Mate Wierdl mw@moni.msci.memphis.edu
|
||||
Matej Vela mvela@public.srce.hr
|
||||
Matt Perry matt@primefactor.com
|
||||
Matthew Braun matthew@ans.net
|
||||
Matthew Clarke Matthew_Clarke@mindlink.bc.ca
|
||||
Matthew S. Levine mslevine@theory.lcs.mit.edu
|
||||
Matthew Swift swift@alum.mit.edu
|
||||
Mattias Wadenstein maswan@acc.umu.se
|
||||
Matthias Urlichs smurf@noris.de
|
||||
Meelis Roos mroos@tartu.cyber.ee
|
||||
Michael ??? michael@roka.net
|
||||
Michael Deutschmann michael@talamasca.ocis.net
|
||||
Michael Hasselberg mikelh@zonta.ping.de
|
||||
Michael Hohn hohn@math.utah.edu
|
||||
Michael J. Croghan mcroghan@usatoday.com
|
||||
Michael Stone mstone@debian.org
|
||||
Michael Stutz stutz@dsl.org
|
||||
Michael Veksler mveksler@techunix.technion.ac.il
|
||||
@@ -263,13 +285,17 @@ Torbjorn Lindgren tl@funcom.no
|
||||
Torsten Landschoff torsten@pclab.ifg.uni-kiel.de
|
||||
Ulrich Drepper drepper@gnu.org
|
||||
Urs Thuermann urs@isnogud.escape.de
|
||||
Vesselin Atanasov vesselin@bgnet.bg
|
||||
Vin Shelton acs@alumni.princeton.edu
|
||||
Volker Borchert bt@teknon.de
|
||||
Wayne Stewart wstewa@atl.com
|
||||
Wenjun Zheng zwj@yahoo.com
|
||||
Werner Almesberger Werner.Almesberger@epfl.ch
|
||||
Wichert Akkerman wichert@cistron.nl
|
||||
Will Edgington wedgingt@acm.org
|
||||
William Bader william@nscs.fast.net
|
||||
William Dowling will@franklin.com
|
||||
William Lewis wiml@omnigroup.com
|
||||
Wolfram Kleff kleff@cs.uni-bonn.de
|
||||
Won-kyu Park wkpark@chem.skku.ac.kr
|
||||
Zvi Har'El rl@math.technion.ac.il
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Makefile.in generated automatically by automake 1.4a from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.4b from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
@@ -154,7 +155,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
$(srcdir)/version.texi: stamp-vti
|
||||
$(srcdir)/version.texi: $(srcdir)/stamp-vti
|
||||
@:
|
||||
|
||||
$(srcdir)/stamp-vti: fileutils.texi $(top_srcdir)/configure.in
|
||||
@@ -179,8 +180,8 @@ distclean-vti:
|
||||
maintainer-clean-vti:
|
||||
-rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
|
||||
|
||||
fileutils.info: fileutils.texi version.texi
|
||||
fileutils.dvi: fileutils.texi version.texi
|
||||
fileutils.info: fileutils.texi $(srcdir)/version.texi
|
||||
fileutils.dvi: fileutils.texi $(srcdir)/version.texi
|
||||
|
||||
|
||||
DVIPS = dvips
|
||||
|
||||
188
doc/getdate.texi
188
doc/getdate.texi
@@ -30,27 +30,32 @@ or a week from Sunday, with feelings of helpless confusion. @dots{}
|
||||
--- Robert Grudin, @cite{Time and the Art of Living}.
|
||||
@end quotation
|
||||
|
||||
This section describes the textual date representations that GNU
|
||||
This section describes the textual date representations that @sc{gnu}
|
||||
programs accept. These are the strings you, as a user, can supply as
|
||||
arguments to the various programs. The C interface (via the
|
||||
@code{getdate} function) is not described here.
|
||||
|
||||
@cindex beginning of time, for Unix
|
||||
@cindex epoch, for Unix
|
||||
Although the date syntax here can represent any possible time since zero
|
||||
A.D., computer integers are not big enough for such a (comparatively)
|
||||
long time. The earliest date semantically allowed on Unix systems is
|
||||
midnight, 1 January 1970 UCT.
|
||||
@cindex beginning of time, for @sc{posix}
|
||||
@cindex epoch, for @sc{posix}
|
||||
Although the date syntax here can represent any possible time since the
|
||||
year zero, computer integers often cannot represent such a wide range of
|
||||
time. On @sc{posix} systems, the clock starts at 1970-01-01 00:00:00
|
||||
@sc{utc}: @sc{posix} does not require support for times before the
|
||||
@sc{posix} Epoch and times far in the future. Traditional Unix systems
|
||||
have 32-bit signed @code{time_t} and can represent times from 1901-12-13
|
||||
20:45:52 through 2038-01-19 03:14:07 @sc{utc}. Systems with 64-bit
|
||||
signed @code{time_t} can represent all the times in the known
|
||||
lifetime of the universe.
|
||||
|
||||
@menu
|
||||
* General date syntax:: Common rules.
|
||||
* Calendar date items:: 19 Dec 1994.
|
||||
* Time of day items:: 9:20pm.
|
||||
* Time zone items:: EST, DST, BST, UTC, ...
|
||||
* Day of week items:: Monday and others.
|
||||
* Relative items in date strings:: next tuesday, 2 years ago.
|
||||
* Calendar date items:: 19 Dec 1994.
|
||||
* Time of day items:: 9:20pm.
|
||||
* Time zone items:: @sc{est}, @sc{pdt}, @sc{gmt}, ...
|
||||
* Day of week items:: Monday and others.
|
||||
* Relative items in date strings:: next tuesday, 2 years ago.
|
||||
* Pure numbers in date strings:: 19931219, 1440.
|
||||
* Authors of getdate:: Bellovin, Salz, Berets, et al.
|
||||
* Authors of getdate:: Bellovin, Eggert, Salz, Berets, et al.
|
||||
@end menu
|
||||
|
||||
|
||||
@@ -113,7 +118,7 @@ specified differently, depending on whether the month is specified
|
||||
numerically or literally. All these strings specify the same calendar date:
|
||||
|
||||
@example
|
||||
1972-09-24 # ISO 8601.
|
||||
1972-09-24 # @sc{iso} 8601.
|
||||
72-9-24 # Assume 19xx for 69 through 99,
|
||||
# 20xx for 00 through 68.
|
||||
72-09-24 # Leading zeros are ignored.
|
||||
@@ -136,9 +141,9 @@ sep 24
|
||||
|
||||
Here are the rules.
|
||||
|
||||
@cindex ISO 8601 date format
|
||||
@cindex date format, ISO 8601
|
||||
For numeric months, the ISO 8601 format
|
||||
@cindex @sc{iso} 8601 date format
|
||||
@cindex date format, @sc{iso} 8601
|
||||
For numeric months, the @sc{iso} 8601 format
|
||||
@samp{@var{year}-@var{month}-@var{day}} is allowed, where @var{year} is
|
||||
any positive number, @var{month} is a number between 01 and 12, and
|
||||
@var{day} is a number between 01 and 31. A leading zero must be present
|
||||
@@ -186,7 +191,7 @@ day. Here are some examples, all of which represent the same time:
|
||||
20:02:0
|
||||
20:02
|
||||
8:02pm
|
||||
20:02-0500 # In EST (Eastern U.S. Standard Time).
|
||||
20:02-0500 # In @sc{est} (U.S. Eastern Standard Time).
|
||||
@end example
|
||||
|
||||
More generally, the time of the day may be given as
|
||||
@@ -206,6 +211,9 @@ or @samp{p.m.}), @var{hour} is restricted to run from 1 to 12, and
|
||||
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}.
|
||||
(This is the zero-oriented interpretation of @samp{12am} and @samp{12pm},
|
||||
as opposed to the old tradition derived from Latin
|
||||
which uses @samp{12m} for noon and @samp{12pm} for midnight.)
|
||||
|
||||
@cindex time zone correction
|
||||
@cindex minutes, time zone correction by
|
||||
@@ -214,10 +222,10 @@ 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 time zone correction is given this way, it
|
||||
forces interpretation of the time relative to
|
||||
Coordinated Universal Time (UTC), overriding any previous
|
||||
Coordinated Universal Time (@sc{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
|
||||
is used. This is the best way to specify a time zone correction by
|
||||
fractional parts of an hour.
|
||||
|
||||
Either @samp{am}/@samp{pm} or a time zone correction may be specified,
|
||||
@@ -229,119 +237,18 @@ but not both.
|
||||
|
||||
@cindex time zone item
|
||||
|
||||
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.
|
||||
A @dfn{time zone item} specifies an international time zone, indicated
|
||||
by a small set of letters, e.g., @samp{UTC} for Coordinated Universal
|
||||
Time. Any included periods are ignored. By following a
|
||||
non-daylight-saving time zone by the string @samp{DST} in a separate
|
||||
word (that is, separated by some white space), the corresponding
|
||||
daylight saving time zone may be specified.
|
||||
|
||||
Here are many non-daylight-saving-time time zones, indexed by the zone
|
||||
hour value.
|
||||
|
||||
@table @asis
|
||||
@item -1200
|
||||
@samp{Y} for militaries.
|
||||
@item -1100
|
||||
@samp{X} 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-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 -0700
|
||||
@samp{PDT} for Pacific Daylight.
|
||||
@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
|
||||
Time zone items are obsolescent and are not recommended, because they
|
||||
are ambiguous; for example, @samp{EST} has a different meaning in
|
||||
Australia than in the United States. Instead, it's better to use
|
||||
unambiguous numeric time zone corrections like @samp{-0500}, as
|
||||
described in the previous section.
|
||||
|
||||
|
||||
@node Day of week items
|
||||
@@ -409,7 +316,7 @@ The unit of time may be preceded by a multiplier, given as an optionally
|
||||
signed number. Unsigned numbers are taken as positively signed. No
|
||||
number at all implies 1 for a multiplier. Following a relative item by
|
||||
the string @samp{ago} is equivalent to preceding the unit by a
|
||||
multiplicator with value @math{-1}.
|
||||
multiplier with value @math{-1}.
|
||||
|
||||
@findex day @r{in date strings}
|
||||
@findex tomorrow @r{in date strings}
|
||||
@@ -429,9 +336,9 @@ items, like in @samp{12:00 today}. The string @samp{this} also has
|
||||
the meaning of a zero-valued time displacement, but is preferred in
|
||||
date strings like @samp{this thursday}.
|
||||
|
||||
When a relative item causes the resulting date to cross the boundary
|
||||
between DST and non-DST (or vice-versa), the hour is adjusted according
|
||||
to the local time.
|
||||
When a relative item causes the resulting date to cross a boundary
|
||||
where the clocks were adjusted, typically for daylight-saving time,
|
||||
the resulting date and time are adjusted accordingly.
|
||||
|
||||
|
||||
@node Pure numbers in date strings
|
||||
@@ -439,8 +346,8 @@ to the local time.
|
||||
|
||||
@cindex pure numbers in date strings
|
||||
|
||||
The precise intepretation of a pure decimal number depends
|
||||
the context in the date string.
|
||||
The precise interpretation of a pure decimal number depends
|
||||
on the context in the date string.
|
||||
|
||||
If the decimal number is of the form @var{yyyy}@var{mm}@var{dd} and no
|
||||
other calendar date item (@pxref{Calendar date items}) appears before it
|
||||
@@ -468,13 +375,14 @@ year.
|
||||
@cindex Berets, Jim
|
||||
@cindex MacKenzie, David
|
||||
@cindex Meyering, Jim
|
||||
@cindex Eggert, Paul
|
||||
@code{getdate} was originally implemented by Steven M. Bellovin
|
||||
(@email{smb@@research.att.com}) while at the University of North Carolina
|
||||
at Chapel Hill. The code was later tweaked by a couple of people on
|
||||
Usenet, then completely overhauled by Rich $alz (@email{rsalz@@bbn.com})
|
||||
and Jim Berets (@email{jberets@@bbn.com}) in August, 1990. Various
|
||||
revisions for the GNU system were made by David MacKenzie, Jim Meyering,
|
||||
and others.
|
||||
revisions for the @sc{gnu} system were made by David MacKenzie, Jim Meyering,
|
||||
Paul Eggert and others.
|
||||
|
||||
@cindex Pinard, F.
|
||||
@cindex Berry, K.
|
||||
|
||||
@@ -69,11 +69,12 @@ matter what group the user who creates them is in.
|
||||
@cindex sticky
|
||||
@cindex swap space, saving text image in
|
||||
@cindex text image, saving in swap space
|
||||
@cindex append-only directories
|
||||
@cindex restricted deletion flag
|
||||
save the program's text image on the swap device so it will load more
|
||||
quickly when run (called the @dfn{sticky bit}). For directories on some
|
||||
systems, prevent users from removing files that they do not own in the
|
||||
directory; this is called making the directory @dfn{append-only}.
|
||||
systems, prevent users from removing or renaming a file in a directory
|
||||
unless they own the file or the directory; this is called the
|
||||
@dfn{restriction deletion flag} for the directory.
|
||||
@end enumerate
|
||||
|
||||
@node Symbolic Modes
|
||||
@@ -118,7 +119,7 @@ format:
|
||||
|
||||
@noindent
|
||||
The spaces between the three parts above are shown for readability only;
|
||||
symbolic modes can not contain spaces.
|
||||
symbolic modes cannot contain spaces.
|
||||
|
||||
The @var{users} part tells which users' access to the file is changed.
|
||||
It consists of one or more of the following letters (or it can be empty;
|
||||
@@ -276,18 +277,8 @@ o+t
|
||||
|
||||
Remember that the special permissions only affect files that are
|
||||
executable, plus, on some systems, directories (on which they have
|
||||
different meanings; @pxref{Mode Structure}). Using @samp{a}
|
||||
in the @var{users} part of a symbolic mode does not cause the special
|
||||
permissions to be affected; thus,
|
||||
|
||||
@example
|
||||
a+s
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
has @emph{no effect}. You must use @samp{u}, @samp{g}, and @samp{o}
|
||||
explicitly to affect the special permissions. Also, the
|
||||
combinations @samp{u+t}, @samp{g+t}, and @samp{o+s} have no effect.
|
||||
different meanings; @pxref{Mode Structure}).
|
||||
Also, the combinations @samp{u+t}, @samp{g+t}, and @samp{o+s} have no effect.
|
||||
|
||||
The @samp{=} operator is not very useful with special permissions; for
|
||||
example, the mode:
|
||||
@@ -437,7 +428,7 @@ This number is always interpreted in octal; you do not have to add a
|
||||
leading 0, as you do in C. Mode 0055 is the same as mode 55.
|
||||
|
||||
A numeric mode is usually shorter than the corresponding symbolic
|
||||
mode, but it is limited in that it can not take into account a file's
|
||||
mode, but it is limited in that it cannot take into account a file's
|
||||
previous permissions; it can only set them absolutely.
|
||||
|
||||
On most systems, the permissions granted to the user,
|
||||
|
||||
@@ -64,7 +64,7 @@ END-INFO-DIR-ENTRY
|
||||
@ifinfo
|
||||
This file documents the GNU shell utilities.
|
||||
|
||||
Copyright (C) 1994, 95, 96 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994, 1995, 1996, 2000 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@@ -96,7 +96,7 @@ by the Foundation.
|
||||
|
||||
@page
|
||||
@vskip 0pt plus 1filll
|
||||
Copyright @copyright{} 1994, 95, 96 Free Software Foundation, Inc.
|
||||
Copyright @copyright{} 1994, 1995, 1996, 2000 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
@@ -350,6 +350,7 @@ independent way. For example, a string containing the Euro currency symbol
|
||||
$ /usr/local/bin/printf '\u20AC 14.95'
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
will be output correctly in all locales supporting the Euro symbol
|
||||
(ISO-8859-15, UTF-8, and others). Similarly, a Chinese string
|
||||
|
||||
@@ -357,18 +358,19 @@ will be output correctly in all locales supporting the Euro symbol
|
||||
$ /usr/local/bin/printf '\u4e2d\u6587'
|
||||
@end example
|
||||
|
||||
will be output correctly in all chinese locales (GB2312, BIG5, UTF-8, etc).
|
||||
@noindent
|
||||
will be output correctly in all Chinese locales (GB2312, BIG5, UTF-8, etc).
|
||||
|
||||
Note that in these examples, the full pathname of @code{printf} has been
|
||||
given, to distinguish it from the GNU @code{bash} builtin function
|
||||
@code{printf}.
|
||||
|
||||
For larger strings, you don't need to look up the hexadecimal code values of
|
||||
each character one by one. ASCII characters mixed with \u escape sequences
|
||||
is also known as the JAVA source file encoding. You can use GNU recode 3.5c
|
||||
(or newer) to convert strings to this encoding. Here is how to convert a
|
||||
piece of text into a shell script which will output this text in a locale-
|
||||
independent way:
|
||||
For larger strings, you don't need to look up the hexadecimal code
|
||||
values of each character one by one. ASCII characters mixed with \u
|
||||
escape sequences is also known as the JAVA source file encoding. You can
|
||||
use GNU recode 3.5c (or newer) to convert strings to this encoding. Here
|
||||
is how to convert a piece of text into a shell script which will output
|
||||
this text in a locale-independent way:
|
||||
|
||||
@smallexample
|
||||
$ LC_CTYPE=zh_CN.big5 /usr/local/bin/printf \
|
||||
@@ -2202,7 +2204,7 @@ format of the @samp{%c} directive (described below). Synopses:
|
||||
@example
|
||||
date [@var{option}]@dots{} [+@var{format}]
|
||||
date [-u|--utc|--universal] @c this avoids a newline in the output
|
||||
[ @var{MMDDhhmm}[[@var{CC}]@var{YY}][.@var{ss}] ]
|
||||
[ MMDDhhmm[[CC]YY][.ss] ]
|
||||
@end example
|
||||
|
||||
@findex strftime @r{and @code{date}}
|
||||
@@ -2258,7 +2260,7 @@ Note that this value is the number of seconds between the epoch
|
||||
and the current date as defined by the localtime system call.
|
||||
It isn't changed by the @samp{--date} option.
|
||||
@item %S
|
||||
second (00@dots{}61)
|
||||
second (00@dots{}60)
|
||||
@item %T
|
||||
time, 24-hour (hh:mm:ss)
|
||||
@item %X
|
||||
@@ -2400,7 +2402,7 @@ zone.
|
||||
The argument must consist entirely of digits, which have the following
|
||||
meaning:
|
||||
|
||||
@table @var
|
||||
@table @samp
|
||||
@item MM
|
||||
month
|
||||
@item DD
|
||||
@@ -2479,16 +2481,14 @@ Append the hours, minutes, and seconds.
|
||||
@end table
|
||||
|
||||
If showing any time terms, then include the time zone using the format
|
||||
@samp{%z}. If @samp{--utc} is also specified, use @samp{%Z} in place of
|
||||
@samp{%z}.
|
||||
|
||||
@item -R
|
||||
@itemx --rfc-822
|
||||
@opindex -R
|
||||
@opindex --rfc-822
|
||||
Display the time and date using the RFC-822-specified
|
||||
Display the time and date using the RFC-822-conforming
|
||||
format, @samp{%a, %_d %b %Y %H:%M:%S %z}.
|
||||
If @samp{--utc} is also specified, use @samp{GMT} in place of @samp{%z}.
|
||||
|
||||
@item -r @var{file}
|
||||
@itemx --reference=@var{file}
|
||||
@@ -2501,7 +2501,7 @@ time of @var{file}, instead of the current time and date.
|
||||
@itemx --set=@var{datestr}
|
||||
@opindex -s
|
||||
@opindex --set
|
||||
Set the time and date to @var{datestr}, See @samp{-d} above.
|
||||
Set the time and date to @var{datestr}. See @samp{-d} above.
|
||||
|
||||
@item -u
|
||||
@itemx --utc
|
||||
@@ -2509,11 +2509,16 @@ Set the time and date to @var{datestr}, See @samp{-d} above.
|
||||
@opindex -u
|
||||
@opindex --utc
|
||||
@opindex --universal
|
||||
@cindex coordinated universal time
|
||||
@cindex Coordinated Universal Time
|
||||
@cindex UTC
|
||||
@cindex Greenwich Mean Time
|
||||
Print or set the time and date in Universal Coordinated Time instead of
|
||||
in local (wall clock) time.
|
||||
|
||||
@cindex GMT
|
||||
Use Coordinated Universal Time (@sc{utc}) by operating as if the
|
||||
@env{TZ} environment variable was set to the string @samp{UTC0}.
|
||||
Normally, @command{date} operates in the time zone indicated by
|
||||
@env{TZ}, or the system default if @env{TZ} is not set. Coordinated
|
||||
Universal Time is often called ``Greenwich Mean Time'' (@sc{gmt}) for
|
||||
historical reasons.
|
||||
@end table
|
||||
|
||||
|
||||
@@ -2591,7 +2596,7 @@ To convert a date string to the number of seconds since the epoch
|
||||
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),
|
||||
than the epoch, but in a time zone five hours later (Cambridge, Massachusetts),
|
||||
thus a total of five hours and one second after the epoch:
|
||||
|
||||
@example
|
||||
@@ -2956,7 +2961,7 @@ nohup @var{command} [@var{arg}]@dots{}
|
||||
|
||||
@flindex nohup.out
|
||||
@code{nohup} increases the scheduling priority of @var{command} by 5, so
|
||||
it has a slightly smaller change to run. If standard output is a terminal,
|
||||
it has a slightly smaller chance to run. If standard output is a terminal,
|
||||
it and standard error are redirected so that they are appended to the
|
||||
file @file{nohup.out}; if that cannot be written to, they are appended
|
||||
to the file @file{$HOME/nohup.out}. If that cannot be written to, the
|
||||
@@ -3335,11 +3340,11 @@ $ seq -s' ' 0 .1 .3
|
||||
0 0.1 0.2
|
||||
@end example
|
||||
|
||||
But doesn't happen on most systems because @code{seq} is implemented using
|
||||
binary floating point arithmetic (via the C @code{double} type) -- which
|
||||
means some decimal numbers like @code{.1} cannot be represented exactly.
|
||||
That in turn means some nonintuitive conditions like @code{.1 * 3 > .3}
|
||||
will end up being true.
|
||||
But that doesn't happen on most systems because @code{seq} is
|
||||
implemented using binary floating point arithmetic (via the C
|
||||
@code{double} type) -- which means some decimal numbers like @code{.1}
|
||||
cannot be represented exactly. That in turn means some nonintuitive
|
||||
conditions like @code{.1 * 3 > .3} will end up being true.
|
||||
|
||||
To work around that in the above example, use a slightly larger number as
|
||||
the @var{last} value:
|
||||
|
||||
269
doc/texinfo.tex
269
doc/texinfo.tex
@@ -3,9 +3,9 @@
|
||||
% Load plain if necessary, i.e., if running under initex.
|
||||
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
|
||||
%
|
||||
\def\texinfoversion{2000-05-28.15}
|
||||
\def\texinfoversion{2000-12-11.07}
|
||||
%
|
||||
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
|
||||
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
|
||||
% Free Software Foundation, Inc.
|
||||
%
|
||||
% This texinfo.tex file is free software; you can redistribute it and/or
|
||||
@@ -688,16 +688,54 @@ where each line of input produces a line of output.}
|
||||
\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
|
||||
\leftline{\hskip\leftskip{\rm#1}}}}
|
||||
|
||||
% @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
|
||||
|
||||
\def\inmargin#1{%
|
||||
\strut\vadjust{\nobreak\kern-\strutdepth
|
||||
\vtop to \strutdepth{\baselineskip\strutdepth\vss
|
||||
\llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}
|
||||
% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
|
||||
% paragraph. For more general purposes, use the \margin insertion
|
||||
% class. WHICH is `l' or `r'.
|
||||
%
|
||||
\newskip\inmarginspacing \inmarginspacing=1cm
|
||||
\def\strutdepth{\dp\strutbox}
|
||||
|
||||
%\hbox{{\rm#1}}\hfil\break}}
|
||||
%
|
||||
\def\doinmargin#1#2{\strut\vadjust{%
|
||||
\nobreak
|
||||
\kern-\strutdepth
|
||||
\vtop to \strutdepth{%
|
||||
\baselineskip=\strutdepth
|
||||
\vss
|
||||
% if you have multiple lines of stuff to put here, you'll need to
|
||||
% make the vbox yourself of the appropriate size.
|
||||
\ifx#1l%
|
||||
\llap{\ignorespaces #2\hskip\inmarginspacing}%
|
||||
\else
|
||||
\rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
|
||||
\fi
|
||||
\null
|
||||
}%
|
||||
}}
|
||||
\def\inleftmargin{\doinmargin l}
|
||||
\def\inrightmargin{\doinmargin r}
|
||||
%
|
||||
% @inmargin{TEXT [, RIGHT-TEXT]}
|
||||
% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
|
||||
% else use TEXT for both).
|
||||
%
|
||||
\def\inmargin#1{\parseinmargin #1,,\finish}
|
||||
\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
|
||||
\setbox0 = \hbox{\ignorespaces #2}%
|
||||
\ifdim\wd0 > 0pt
|
||||
\def\lefttext{#1}% have both texts
|
||||
\def\righttext{#2}%
|
||||
\else
|
||||
\def\lefttext{#1}% have only one text
|
||||
\def\righttext{#1}%
|
||||
\fi
|
||||
%
|
||||
\ifodd\pageno
|
||||
\def\temp{\inleftmargin\lefttext}%
|
||||
\else
|
||||
\def\temp{\inrightmargin\righttext}%
|
||||
\fi
|
||||
\temp
|
||||
}
|
||||
|
||||
% @include file insert text of that file as input.
|
||||
% Allow normal characters that we make active in the argument (a file name).
|
||||
@@ -2593,42 +2631,48 @@ width0pt\relax} \fi
|
||||
}
|
||||
|
||||
% @defindex foo == \newindex{foo}
|
||||
|
||||
%
|
||||
\def\defindex{\parsearg\newindex}
|
||||
|
||||
% Define @defcodeindex, like @defindex except put all entries in @code.
|
||||
|
||||
%
|
||||
\def\defcodeindex{\parsearg\newcodeindex}
|
||||
%
|
||||
\def\newcodeindex#1{%
|
||||
\iflinks
|
||||
\expandafter\newwrite \csname#1indfile\endcsname
|
||||
\openout \csname#1indfile\endcsname \jobname.#1
|
||||
\fi
|
||||
\expandafter\xdef\csname#1index\endcsname{%
|
||||
\noexpand\docodeindex{#1}}
|
||||
\noexpand\docodeindex{#1}}%
|
||||
}
|
||||
|
||||
\def\defcodeindex{\parsearg\newcodeindex}
|
||||
|
||||
% @synindex foo bar makes index foo feed into index bar.
|
||||
% Do this instead of @defindex foo if you don't want it as a separate index.
|
||||
% The \closeout helps reduce unnecessary open files; the limit on the
|
||||
% Acorn RISC OS is a mere 16 files.
|
||||
\def\synindex#1 #2 {%
|
||||
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
|
||||
\expandafter\closeout\csname#1indfile\endcsname
|
||||
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
|
||||
\expandafter\xdef\csname#1index\endcsname{% define \xxxindex
|
||||
\noexpand\doindex{#2}}%
|
||||
}
|
||||
|
||||
%
|
||||
% @syncodeindex foo bar similar, but put all entries made for index foo
|
||||
% inside @code.
|
||||
\def\syncodeindex#1 #2 {%
|
||||
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
|
||||
\expandafter\closeout\csname#1indfile\endcsname
|
||||
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
|
||||
\expandafter\xdef\csname#1index\endcsname{% define \xxxindex
|
||||
\noexpand\docodeindex{#2}}%
|
||||
%
|
||||
\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
|
||||
\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
|
||||
|
||||
% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
|
||||
% #3 the target index (bar).
|
||||
\def\dosynindex#1#2#3{%
|
||||
% Only do \closeout if we haven't already done it, else we'll end up
|
||||
% closing the target index.
|
||||
\expandafter \ifx\csname donesynindex#2\endcsname \undefined
|
||||
% The \closeout helps reduce unnecessary open files; the limit on the
|
||||
% Acorn RISC OS is a mere 16 files.
|
||||
\expandafter\closeout\csname#2indfile\endcsname
|
||||
\expandafter\let\csname\donesynindex#2\endcsname = 1
|
||||
\fi
|
||||
% redefine \fooindfile:
|
||||
\expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
|
||||
\expandafter\let\csname#2indfile\endcsname=\temp
|
||||
% redefine \fooindex:
|
||||
\expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
|
||||
}
|
||||
|
||||
% Define \doindex, the driver for all \fooindex macros.
|
||||
@@ -3155,7 +3199,6 @@ width0pt\relax} \fi
|
||||
%
|
||||
% Double the \vsize as well. (We don't need a separate register here,
|
||||
% since nobody clobbers \vsize.)
|
||||
\advance\vsize by -\ht\partialpage
|
||||
\vsize = 2\vsize
|
||||
}
|
||||
|
||||
@@ -3169,6 +3212,7 @@ width0pt\relax} \fi
|
||||
% previous page.
|
||||
\dimen@ = \vsize
|
||||
\divide\dimen@ by 2
|
||||
\advance\dimen@ by -\ht\partialpage
|
||||
%
|
||||
% box0 will be the left-hand column, box2 the right.
|
||||
\setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
|
||||
@@ -3176,15 +3220,18 @@ width0pt\relax} \fi
|
||||
\unvbox255
|
||||
\penalty\outputpenalty
|
||||
}
|
||||
%
|
||||
% Re-output the contents of the output page -- any previous material,
|
||||
% followed by the two boxes we just split, in box0 and box2.
|
||||
\def\pagesofar{%
|
||||
% Re-output the contents of the output page -- any previous material,
|
||||
% followed by the two boxes we just split, in box0 and box2.
|
||||
\unvbox\partialpage
|
||||
%
|
||||
\hsize = \doublecolumnhsize
|
||||
\wd0=\hsize \wd2=\hsize
|
||||
\hbox to\pagewidth{\box0\hfil\box2}%
|
||||
}
|
||||
%
|
||||
% All done with double columns.
|
||||
\def\enddoublecolumns{%
|
||||
\output = {%
|
||||
% Split the last of the double-column material. Leave it on the
|
||||
@@ -3209,8 +3256,9 @@ width0pt\relax} \fi
|
||||
% \endgroup where \vsize got restored).
|
||||
\pagegoal = \vsize
|
||||
}
|
||||
%
|
||||
% Called at the end of the double column material.
|
||||
\def\balancecolumns{%
|
||||
% Called at the end of the double column material.
|
||||
\setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
|
||||
\dimen@ = \ht0
|
||||
\advance\dimen@ by \topskip
|
||||
@@ -4271,6 +4319,7 @@ width0pt\relax} \fi
|
||||
\gobble
|
||||
}
|
||||
|
||||
|
||||
% @quotation does normal linebreaking (hence we can't use \nonfillstart)
|
||||
% and narrows the margins.
|
||||
%
|
||||
@@ -4293,6 +4342,158 @@ width0pt\relax} \fi
|
||||
}
|
||||
|
||||
|
||||
% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
|
||||
% If we want to allow any <char> as delimiter,
|
||||
% we need the curly braces so that makeinfo sees the @verb command, eg:
|
||||
% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
|
||||
%
|
||||
% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
|
||||
%
|
||||
% [Knuth] p. 344; only we need to do '@' too
|
||||
\def\dospecials{%
|
||||
\do\ \do\\\do\@\do\{\do\}\do\$\do\&%
|
||||
\do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~}
|
||||
%
|
||||
% [Knuth] p. 380
|
||||
\def\uncatcodespecials{%
|
||||
\def\do##1{\catcode`##1=12}\dospecials}
|
||||
%
|
||||
% [Knuth] pp. 380,381,391
|
||||
% Disable Spanish ligatures ?` and !` of \tt font
|
||||
\begingroup
|
||||
\catcode`\`=\active\gdef`{\relax\lq}
|
||||
\endgroup
|
||||
%
|
||||
% Setup for the @verb command.
|
||||
%
|
||||
% Eight spaces for a tab
|
||||
\begingroup
|
||||
\catcode`\^^I=\active
|
||||
\gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
|
||||
\endgroup
|
||||
%
|
||||
\def\setupverb{%
|
||||
\tt % easiest (and conventionally used) font for verbatim
|
||||
\def\par{\leavevmode\endgraf}%
|
||||
\catcode`\`=\active
|
||||
\tabeightspaces
|
||||
% Respect line breaks,
|
||||
% print special symbols as themselves, and
|
||||
% make each space count
|
||||
% must do in this order:
|
||||
\obeylines \uncatcodespecials \sepspaces
|
||||
}
|
||||
|
||||
% Setup for the @verbatim environment
|
||||
%
|
||||
% Real tab expansion
|
||||
\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
|
||||
%
|
||||
\def\starttabbox{\setbox0=\hbox\bgroup}
|
||||
\begingroup
|
||||
\catcode`\^^I=\active
|
||||
\gdef\tabexpand{%
|
||||
\catcode`\^^I=\active
|
||||
\def^^I{\leavevmode\egroup
|
||||
\dimen0=\wd0 % the width so far, or since the previous tab
|
||||
\divide\dimen0 by\tabw
|
||||
\multiply\dimen0 by\tabw % compute previous multiple of \tabw
|
||||
\advance\dimen0 by\tabw % advance to next multiple of \tabw
|
||||
\wd0=\dimen0 \box0 \starttabbox
|
||||
}%
|
||||
}
|
||||
\endgroup
|
||||
\def\setupverbatim{%
|
||||
% Easiest (and conventionally used) font for verbatim
|
||||
\tt
|
||||
\def\par{\leavevmode\egroup\box0\endgraf}%
|
||||
\catcode`\`=\active
|
||||
\tabexpand
|
||||
% Respect line breaks,
|
||||
% print special symbols as themselves, and
|
||||
% make each space count
|
||||
% must do in this order:
|
||||
\obeylines \uncatcodespecials \sepspaces
|
||||
\everypar{\starttabbox}%
|
||||
}
|
||||
|
||||
% Do the @verb magic: verbatim text is quoted by unique
|
||||
% delimiter characters. Before first delimiter expect a
|
||||
% right brace, after last delimiter expect closing brace:
|
||||
%
|
||||
% \def\doverb'{'<char>#1<char>'}'{#1}
|
||||
%
|
||||
% [Knuth] p. 382; only eat outer {}
|
||||
\begingroup
|
||||
\catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12
|
||||
\gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
|
||||
\endgroup
|
||||
%
|
||||
\def\verb{\begingroup\setupverb\doverb}
|
||||
%
|
||||
%
|
||||
% Do the @verbatim magic: define the macro \doverbatim so that
|
||||
% the (first) argument ends when '@end verbatim' is reached, ie:
|
||||
%
|
||||
% \def\doverbatim#1@end verbatim{#1}
|
||||
%
|
||||
% For Texinfo it's a lot easier than for LaTeX,
|
||||
% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
|
||||
% we need not redefine '\', '{' and '}'
|
||||
%
|
||||
% Inspired by LaTeX's verbatim command set [latex.ltx]
|
||||
%% Include LaTeX hack for completeness -- never know
|
||||
%% \begingroup
|
||||
%% \catcode`|=0 \catcode`[=1
|
||||
%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active
|
||||
%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[
|
||||
%% #1|endgroup|def|Everbatim[]|end[verbatim]]
|
||||
%% |endgroup
|
||||
\begingroup
|
||||
\catcode`\ =\active
|
||||
\gdef\doverbatim#1@end verbatim{#1\end{verbatim}}
|
||||
\endgroup
|
||||
%
|
||||
\def\verbatim{%
|
||||
\def\Everbatim{\nonfillfinish\endgroup}%
|
||||
\begingroup
|
||||
\nonfillstart
|
||||
\advance\leftskip by -\defbodyindent
|
||||
\begingroup\setupverbatim\doverbatim
|
||||
}
|
||||
|
||||
% @verbatiminclude FILE - insert text of file in verbatim environment.
|
||||
%
|
||||
% Allow normal characters that we make active in the argument (a file name).
|
||||
\def\verbatiminclude{%
|
||||
\begingroup
|
||||
\catcode`\\=12
|
||||
\catcode`~=12
|
||||
\catcode`^=12
|
||||
\catcode`_=12
|
||||
\catcode`|=12
|
||||
\catcode`<=12
|
||||
\catcode`>=12
|
||||
\catcode`+=12
|
||||
\parsearg\doverbatiminclude
|
||||
}
|
||||
\def\setupverbatiminclude{%
|
||||
\begingroup
|
||||
\nonfillstart
|
||||
\advance\leftskip by -\defbodyindent
|
||||
\begingroup\setupverbatim
|
||||
}
|
||||
%
|
||||
\def\doverbatiminclude#1{%
|
||||
% Restore active chars for included file.
|
||||
\endgroup
|
||||
\begingroup
|
||||
\def\thisfile{#1}%
|
||||
\expandafter\expandafter\setupverbatiminclude\input\thisfile
|
||||
\endgroup\nonfillfinish\endgroup
|
||||
}
|
||||
|
||||
|
||||
\message{defuns,}
|
||||
% @defun etc.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
\input texinfo
|
||||
@c %**start of header
|
||||
@setfilename textutils.info
|
||||
@settitle GNU text utilities
|
||||
@settitle @sc{gnu} text utilities
|
||||
@c %**end of header
|
||||
|
||||
@include version.texi
|
||||
@@ -20,7 +20,7 @@
|
||||
@ifinfo
|
||||
@format
|
||||
START-INFO-DIR-ENTRY
|
||||
* Text utilities: (textutils). GNU text utilities.
|
||||
* Text utilities: (textutils). GNU text utilities.
|
||||
* cat: (textutils)cat invocation. Concatenate and write files.
|
||||
* cksum: (textutils)cksum invocation. Print @sc{posix} CRC checksum.
|
||||
* comm: (textutils)comm invocation. Compare sorted files by line.
|
||||
@@ -56,30 +56,18 @@ This file documents the GNU text utilities.
|
||||
|
||||
Copyright (C) 1994, 95, 96 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
are preserved on all copies.
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.1
|
||||
or any later version published by the Free Software Foundation;
|
||||
with no Invariant Sections, with no
|
||||
Front-Cover Texts, and with no Back-Cover Texts.
|
||||
A copy of the license is included in the section entitled ``GNU
|
||||
Free Documentation License''.
|
||||
|
||||
@ignore
|
||||
Permission is granted to process this file through TeX and print the
|
||||
results, provided the printed document carries copying permission
|
||||
notice identical to this one except for the removal of this paragraph
|
||||
(this paragraph not being relevant to the printed manual).
|
||||
|
||||
@end ignore
|
||||
Permission is granted to copy and distribute modified versions of this
|
||||
manual under the conditions for verbatim copying, provided that the entire
|
||||
resulting derived work is distributed under the terms of a permission
|
||||
notice identical to this one.
|
||||
|
||||
Permission is granted to copy and distribute translations of this manual
|
||||
into another language, under the above conditions for modified versions,
|
||||
except that this permission notice may be stated in a translation approved
|
||||
by the Foundation.
|
||||
@end ifinfo
|
||||
|
||||
@titlepage
|
||||
@title GNU @code{textutils}
|
||||
@title @sc{gnu} @code{textutils}
|
||||
@subtitle A set of text utilities
|
||||
@subtitle for version @value{VERSION}, @value{UPDATED}
|
||||
@author David MacKenzie et al.
|
||||
@@ -88,19 +76,13 @@ by the Foundation.
|
||||
@vskip 0pt plus 1filll
|
||||
Copyright @copyright{} 1994, 95, 96 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of
|
||||
this manual provided the copyright notice and this permission notice
|
||||
are preserved on all copies.
|
||||
|
||||
Permission is granted to copy and distribute modified versions of this
|
||||
manual under the conditions for verbatim copying, provided that the entire
|
||||
resulting derived work is distributed under the terms of a permission
|
||||
notice identical to this one.
|
||||
|
||||
Permission is granted to copy and distribute translations of this manual
|
||||
into another language, under the above conditions for modified versions,
|
||||
except that this permission notice may be stated in a translation approved
|
||||
by the Foundation.
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.1
|
||||
or any later version published by the Free Software Foundation;
|
||||
with no Invariant Sections, with no
|
||||
Front-Cover Texts, and with no Back-Cover Texts.
|
||||
A copy of the license is included in the section entitled ``GNU
|
||||
Free Documentation License''.
|
||||
@end titlepage
|
||||
|
||||
|
||||
@@ -114,7 +96,7 @@ by the Foundation.
|
||||
@cindex text utilities
|
||||
@cindex utilities for text handling
|
||||
|
||||
This manual documents version @value{VERSION} of the GNU text utilities.
|
||||
This manual documents version @value{VERSION} of the @sc{gnu} text utilities.
|
||||
|
||||
@menu
|
||||
* Introduction:: Caveats, overview, and authors.
|
||||
@@ -217,11 +199,12 @@ Opening the software toolbox
|
||||
|
||||
This manual is incomplete: No attempt is made to explain basic concepts
|
||||
in a way suitable for novices. Thus, if you are interested, please get
|
||||
involved in improving this manual. The entire GNU community will
|
||||
involved in improving this manual. The entire @sc{gnu} community will
|
||||
benefit.
|
||||
|
||||
@cindex POSIX.2
|
||||
The GNU text utilities are mostly compatible with the @sc{posix.2} standard.
|
||||
The @sc{gnu} text utilities are mostly compatible with the @sc{posix.2}
|
||||
standard.
|
||||
|
||||
@c This paragraph appears in all of fileutils.texi, textutils.texi, and
|
||||
@c sh-utils.texi too -- so be sure to keep them consistent.
|
||||
@@ -251,7 +234,7 @@ overall process.
|
||||
|
||||
Certain options are available in all of these programs. Rather than
|
||||
writing identical descriptions for each of the programs, they are
|
||||
described here. (In fact, every GNU program accepts (or should accept)
|
||||
described here. (In fact, every @sc{gnu} program accepts (or should accept)
|
||||
these options.)
|
||||
|
||||
Some of these programs recognize the @samp{--help} and @samp{--version}
|
||||
@@ -692,19 +675,19 @@ to the output line generated by the type specification.
|
||||
|
||||
@table @samp
|
||||
@item a
|
||||
named character,
|
||||
named character
|
||||
@item c
|
||||
@sc{ascii} character or backslash escape,
|
||||
@item d
|
||||
signed decimal,
|
||||
signed decimal
|
||||
@item f
|
||||
floating point,
|
||||
floating point
|
||||
@item o
|
||||
octal,
|
||||
octal
|
||||
@item u
|
||||
unsigned decimal,
|
||||
unsigned decimal
|
||||
@item x
|
||||
hexadecimal.
|
||||
hexadecimal
|
||||
@end table
|
||||
|
||||
The type @code{a} outputs things like @samp{sp} for space, @samp{nl} for
|
||||
@@ -722,24 +705,24 @@ one of the following characters. For integers (@samp{d}, @samp{o},
|
||||
|
||||
@table @samp
|
||||
@item C
|
||||
char,
|
||||
char
|
||||
@item S
|
||||
short,
|
||||
short
|
||||
@item I
|
||||
int,
|
||||
int
|
||||
@item L
|
||||
long.
|
||||
long
|
||||
@end table
|
||||
|
||||
For floating point (@code{f}):
|
||||
|
||||
@table @asis
|
||||
@item F
|
||||
float,
|
||||
float
|
||||
@item D
|
||||
double,
|
||||
double
|
||||
@item L
|
||||
long double.
|
||||
long double
|
||||
@end table
|
||||
|
||||
@item -v
|
||||
@@ -763,7 +746,8 @@ is not given at all, the default is 16.
|
||||
@end table
|
||||
|
||||
The next several options map the old, pre-@sc{posix} format specification
|
||||
options to the corresponding @sc{posix} format specs. GNU @code{od} accepts
|
||||
options to the corresponding @sc{posix} format specs.
|
||||
@sc{gnu} @code{od} accepts
|
||||
any combination of old- and new-style options. Format specification
|
||||
options accumulate.
|
||||
|
||||
@@ -983,27 +967,35 @@ is @samp{space}). For multicolumn output, lines will always be truncated to
|
||||
column output no line truncation occurs by default. Use @samp{-W} option to
|
||||
truncate lines in that case.
|
||||
|
||||
@c FIXME:??? Should this be something like "Starting with version 1.22i,..."
|
||||
Including version 1.22i:
|
||||
|
||||
The following changes were made in version 1.22i and apply to later
|
||||
versions of @command{pr}:
|
||||
@c FIXME: this whole section here sounds very awkward to me. I
|
||||
@c made a few small changes, but really it all needs to be redone. - Brian
|
||||
Some small @var{letter options} (@samp{-s}, @samp{-w}) have been redefined
|
||||
with the object of a better @sc{posix} compliance. The output of some
|
||||
further cases has been adapted to other Unix systems. These changes are
|
||||
not compatible with earlier versions of the program.
|
||||
@c OK, I fixed another sentence or two, but some of it I just don't understand.
|
||||
@ - Brian
|
||||
@itemize @bullet
|
||||
|
||||
@item
|
||||
Some small @var{letter options} (@samp{-s}, @samp{-w}) have been
|
||||
redefined for better @sc{posix} compliance. The output of some further
|
||||
cases has been adapted to other Unix systems. These changes are not
|
||||
compatible with earlier versions of the program.
|
||||
|
||||
@item
|
||||
Some @var{new capital letter} options (@samp{-J}, @samp{-S}, @samp{-W})
|
||||
have been introduced to turn off unexpected interferences of small letter
|
||||
options. The @samp{-N} option and the second argument @var{last_page}
|
||||
of @samp{+FIRST_PAGE} offer more flexibility. The detailed handling of
|
||||
form feeds set in the input files requires the @samp{-T} option.
|
||||
|
||||
@item
|
||||
Capital letter options override small letter ones.
|
||||
|
||||
@item
|
||||
Some of the option-arguments (compare @samp{-s}, @samp{-S}, @samp{-e},
|
||||
@samp{-i}, @samp{-n}) cannot be specified as separate arguments from the
|
||||
preceding option letter (already stated in the @sc{posix} specification).
|
||||
@end itemize
|
||||
|
||||
The program accepts the following options. Also see @ref{Common options}.
|
||||
|
||||
@@ -1194,12 +1186,12 @@ opened. (The exit status will still be nonzero, however.)
|
||||
@itemx --separator[=@var{char}]
|
||||
@opindex -s
|
||||
@opindex --separator
|
||||
Separate columns by a single character @var{char}. Default for @var{char}
|
||||
is the TAB character without @samp{-w} and @samp{no character} with
|
||||
@samp{-w}. Without @samp{-s} default separator @samp{space} is set.
|
||||
@samp{-s[char]} turns off line truncation of all three column options
|
||||
(@samp{-COLUMN}|@samp{-a -COLUMN}|@samp{-m}) except @samp{-w} is set.
|
||||
That is a @sc{posix}-compliant formulation.
|
||||
Separate columns by a single character @var{char}. The default for
|
||||
@var{char} is the TAB character without @samp{-w} and @samp{no
|
||||
character} with @samp{-w}. Without @samp{-s} the default separator
|
||||
@samp{space} is set. @samp{-s[char]} turns off line truncation of all
|
||||
three column options (@samp{-COLUMN}|@samp{-a -COLUMN}|@samp{-m}) unless
|
||||
@samp{-w} is set. This is a @sc{posix}-compliant formulation.
|
||||
|
||||
|
||||
@item -S[@var{string}]
|
||||
@@ -1437,13 +1429,13 @@ one-line header consisting of
|
||||
before the output for each @var{file}.
|
||||
|
||||
@cindex BSD @code{tail}
|
||||
GNU @code{tail} can output any amount of data (some other versions of
|
||||
@sc{gnu} @code{tail} can output any amount of data (some other versions of
|
||||
@code{tail} cannot). It also has no @samp{-r} option (print in
|
||||
reverse), since reversing a file is really a different job from printing
|
||||
the end of a file; BSD @code{tail} (which is the one with @code{-r}) can
|
||||
only reverse files that are at most as large as its buffer, which is
|
||||
typically 32k. A more reliable and versatile way to reverse files is
|
||||
the GNU @code{tac} command.
|
||||
the @sc{gnu} @code{tac} command.
|
||||
|
||||
@code{tail} accepts two option formats: the new one, in which numbers
|
||||
are arguments to the options (@samp{-n 1}), and the old one, in which
|
||||
@@ -1702,9 +1694,9 @@ exhausted.
|
||||
|
||||
The output files' names consist of a prefix (@samp{xx} by default)
|
||||
followed by a suffix. By default, the suffix is an ascending sequence
|
||||
of two-digit decimal numbers from @samp{00} and up to @samp{99}. In any
|
||||
case, concatenating the output files in sorted order by filename
|
||||
produces the original input file.
|
||||
of two-digit decimal numbers from @samp{00} to @samp{99}. In any case,
|
||||
concatenating the output files in sorted order by filename produces the
|
||||
original input file.
|
||||
|
||||
By default, if @code{csplit} encounters an error or receives a hangup,
|
||||
interrupt, quit, or terminate signal, it removes any output files
|
||||
@@ -1821,9 +1813,9 @@ in columns. However, @sc{posix} requires that there be exactly one space
|
||||
separating columns. You can make @code{wc} use the @sc{posix}-mandated
|
||||
output format by setting the @env{POSIXLY_CORRECT} environment variable.
|
||||
|
||||
By default, @code{wc} prints three counts: the newline, words, byte counts.
|
||||
Options can specify that only certain counts be printed. Options do not
|
||||
undo others previously given, so
|
||||
By default, @code{wc} prints three counts: the newline, words, and byte
|
||||
counts. Options can specify that only certain counts be printed.
|
||||
Options do not undo others previously given, so
|
||||
|
||||
@example
|
||||
wc --bytes --words
|
||||
@@ -1890,10 +1882,10 @@ sum [@var{option}]@dots{} [@var{file}]@dots{}
|
||||
@code{sum} prints the checksum for each @var{file} followed by the
|
||||
number of blocks in the file (rounded up). If more than one @var{file}
|
||||
is given, file names are also printed (by default). (With the
|
||||
@samp{--sysv} option, corresponding file name are printed when there is
|
||||
@samp{--sysv} option, corresponding file names are printed when there is
|
||||
at least one file argument.)
|
||||
|
||||
By default, GNU @code{sum} computes checksums using an algorithm
|
||||
By default, @sc{gnu} @code{sum} computes checksums using an algorithm
|
||||
compatible with BSD @code{sum} and prints file sizes in units of
|
||||
1024-byte blocks.
|
||||
|
||||
@@ -2125,9 +2117,9 @@ disables this last-resort comparison so that lines in which all fields
|
||||
compare equal are left in their original relative order. If no fields
|
||||
or global options are specified, @samp{-s} has no effect.
|
||||
|
||||
GNU @code{sort} (as specified for all GNU utilities) has no limits on
|
||||
@sc{gnu} @code{sort} (as specified for all @sc{gnu} utilities) has no limits on
|
||||
input line length or restrictions on bytes allowed within lines. In
|
||||
addition, if the final byte of an input file is not a newline, GNU
|
||||
addition, if the final byte of an input file is not a newline, @sc{gnu}
|
||||
@code{sort} silently supplies one. A line's trailing newline is not
|
||||
part of the line for comparison purposes.@footnote{@sc{posix}.2-1992
|
||||
requires that the trailing newline be part of the comparison, and some
|
||||
@@ -2268,6 +2260,24 @@ If @var{output-file} is one of the input files, @code{sort} copies
|
||||
it to a temporary file before sorting and writing the output to
|
||||
@var{output-file}.
|
||||
|
||||
@item -S @var{size}
|
||||
@opindex -S
|
||||
@cindex size for main memory sorting
|
||||
Use a main-memory sort buffer of the given @var{size}. By default,
|
||||
@var{size} is in units of 1,024 bytes. Appending @samp{%} causes
|
||||
@var{size} to be interpreted as a percentage of physical memory.
|
||||
Appending @samp{k} multiplies @var{size} by 1,024 (the default),
|
||||
@samp{M} by 1,048,576, @samp{G} by 1,073,741,824, and so on for
|
||||
@samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}. Appending
|
||||
@samp{b} causes @var{size} to be interpreted as a byte count, with no
|
||||
multiplication.
|
||||
|
||||
This option can improve the performance of @command{sort} by causing it
|
||||
to start with a larger or smaller sort buffer than the default.
|
||||
However, this option affects only the initial buffer size. The buffer
|
||||
grows beyond @var{size} if @command{sort} encounters input lines larger
|
||||
than @var{size}.
|
||||
|
||||
@item -t @var{separator}
|
||||
@opindex -t
|
||||
@cindex field separator character
|
||||
@@ -2277,7 +2287,9 @@ string between a non-whitespace character and a whitespace character.
|
||||
That is, given the input line @w{@samp{ foo bar}}, @code{sort} breaks it
|
||||
into fields @w{@samp{ foo}} and @w{@samp{ bar}}. The field separator is
|
||||
not considered to be part of either the field preceding or the field
|
||||
following.
|
||||
following. But note that sort fields that extend to the end of the line,
|
||||
as @samp{-k 2}, or sort fields consisting of a range, as @samp{-k 2,3},
|
||||
retain the field separators present between the endpoints of the range.
|
||||
|
||||
@item -T @var{tempdir}
|
||||
@opindex -T
|
||||
@@ -2325,13 +2337,13 @@ and character positions are numbered starting with 0. See below.
|
||||
|
||||
@end table
|
||||
|
||||
In addition, when GNU @code{sort} is invoked with exactly one argument,
|
||||
In addition, when @sc{gnu} @code{sort} is invoked with exactly one argument,
|
||||
options @samp{--help} and @samp{--version} are recognized. @xref{Common
|
||||
options}.
|
||||
|
||||
Historical (BSD and System V) implementations of @code{sort} have
|
||||
differed in their interpretation of some options, particularly
|
||||
@samp{-b}, @samp{-f}, and @samp{-n}. GNU sort follows the @sc{posix}
|
||||
@samp{-b}, @samp{-f}, and @samp{-n}. @sc{gnu} sort follows the @sc{posix}
|
||||
behavior, which is usually (but not always!) like the System V behavior.
|
||||
According to @sc{posix}, @samp{-n} no longer implies @samp{-b}. For
|
||||
consistency, @samp{-M} has been changed in the same way. This may
|
||||
@@ -2389,7 +2401,7 @@ sort -t : -k 2,2n -k 5.3,5.4
|
||||
@end example
|
||||
|
||||
Note that if you had written @samp{-k 2} instead of @samp{-k 2,2}
|
||||
@samp{sort} would have used all characters beginning in the second field
|
||||
@command{sort} would have used all characters beginning in the second field
|
||||
and extending to the end of the line as the primary @emph{numeric}
|
||||
key. For the large majority of applications, treating keys spanning
|
||||
more than one field as numeric will not do what you expect.
|
||||
@@ -2530,7 +2542,7 @@ Print only duplicate lines.
|
||||
Print all duplicate lines and only duplicate lines.
|
||||
This option is useful mainly in conjunction with other options e.g.,
|
||||
to ignore case or to compare only selected fields.
|
||||
This is a GNU extension.
|
||||
This is a @sc{gnu} extension.
|
||||
@c FIXME: give an example showing *how* it's useful
|
||||
|
||||
@item -u
|
||||
@@ -2659,15 +2671,15 @@ ptx -G [@var{option} @dots{}] [@var{input} [@var{output}]]
|
||||
@end example
|
||||
|
||||
The @samp{-G} (or its equivalent: @samp{--traditional}) option disables
|
||||
all GNU extensions and reverts to traditional mode, thus introducing some
|
||||
all @sc{gnu} extensions and reverts to traditional mode, thus introducing some
|
||||
limitations and changing several of the program's default option values.
|
||||
When @samp{-G} is not specified, GNU extensions are always enabled. GNU
|
||||
extensions to @code{ptx} are documented wherever appropriate in this
|
||||
When @samp{-G} is not specified, @sc{gnu} extensions are always enabled.
|
||||
@sc{gnu} extensions to @code{ptx} are documented wherever appropriate in this
|
||||
document. For the full list, see @xref{Compatibility in ptx}.
|
||||
|
||||
Individual options are explained in the following sections.
|
||||
|
||||
When GNU extensions are enabled, there may be zero, one or several
|
||||
When @sc{gnu} extensions are enabled, there may be zero, one or several
|
||||
@var{file}s after the options. If there is no @var{file}, the program
|
||||
reads the standard input. If there is one or several @var{file}s, they
|
||||
give the name of input files which are all read in turn, as if all the
|
||||
@@ -2677,7 +2689,7 @@ file names and line numbers refer to individual text input files. In
|
||||
all cases, the program outputs the permuted index to the standard
|
||||
output.
|
||||
|
||||
When GNU extensions are @emph{not} enabled, that is, when the program
|
||||
When @sc{gnu} extensions are @emph{not} enabled, that is, when the program
|
||||
operates in traditional mode, there may be zero, one or two parameters
|
||||
besides the options. If there are no parameters, the program reads the
|
||||
standard input and outputs the permuted index to the standard output.
|
||||
@@ -2687,7 +2699,7 @@ respectively the name of the @var{input} file to read and the name of
|
||||
the @var{output} file to produce. @emph{Be very careful} to note that,
|
||||
in this case, the contents of file given by the second parameter is
|
||||
destroyed. This behavior is dictated by System V @code{ptx}
|
||||
compatibility; GNU Standards normally discourage output parameters not
|
||||
compatibility; @sc{gnu} Standards normally discourage output parameters not
|
||||
introduced by an option.
|
||||
|
||||
Note that for @emph{any} file named as the value of an option or as an
|
||||
@@ -2716,7 +2728,7 @@ exit without further processing.
|
||||
|
||||
@item -G
|
||||
@itemx --traditional
|
||||
As already explained, this option disables all GNU extensions to
|
||||
As already explained, this option disables all @sc{gnu} extensions to
|
||||
@code{ptx} and switches to traditional mode.
|
||||
|
||||
@item --help
|
||||
@@ -2737,7 +2749,7 @@ processing.
|
||||
As it is set up now, the program assumes that the input file is coded
|
||||
using 8-bit ISO 8859-1 code, also known as Latin-1 character set,
|
||||
@emph{unless} it is compiled for MS-DOS, in which case it uses the
|
||||
character set of the IBM-PC. (GNU @code{ptx} is not known to work on
|
||||
character set of the IBM-PC. (@sc{gnu} @code{ptx} is not known to work on
|
||||
smaller MS-DOS machines anymore.) Compared to 7-bit @sc{ascii}, the set
|
||||
of characters which are letters is different; this alters the behavior
|
||||
of regular expression matching. Thus, the default regular expression
|
||||
@@ -2770,9 +2782,9 @@ is not part of the Break file is a word constituent. If both options
|
||||
@samp{-b} and @samp{-W} are specified, then @samp{-W} has precedence and
|
||||
@samp{-b} is ignored.
|
||||
|
||||
When GNU extensions are enabled, the only way to avoid newline as a
|
||||
When @sc{gnu} extensions are enabled, the only way to avoid newline as a
|
||||
break character is to write all the break characters in the file with no
|
||||
newline at all, not even at the end of the file. When GNU extensions
|
||||
newline at all, not even at the end of the file. When @sc{gnu} extensions
|
||||
are disabled, spaces, tabs and newlines are always considered as break
|
||||
characters even if not included in the Break file.
|
||||
|
||||
@@ -2799,9 +2811,9 @@ is ignored. The file is called the @dfn{Only file}. The file contains
|
||||
exactly one word in each line; the end of line separation of words is
|
||||
not subject to the value of the @samp{-S} option.
|
||||
|
||||
There is no default for the Only file. In the case there are both an
|
||||
Only file and an Ignore file, a word can be a keyword only if it is
|
||||
given in the Only file and not given in the Ignore file.
|
||||
There is no default for the Only file. When both an Only file and an
|
||||
Ignore file are specified, a word is considered a keyword only
|
||||
if it is listed in the Only file and not in the Ignore file.
|
||||
|
||||
@item -r
|
||||
@itemx --references
|
||||
@@ -2815,7 +2827,7 @@ Using this option changes the default value for option @samp{-S}.
|
||||
Using this option, the program does not try very hard to remove
|
||||
references from contexts in output, but it succeeds in doing so
|
||||
@emph{when} the context ends exactly at the newline. If option
|
||||
@samp{-r} is used with @samp{-S} default value, or when GNU extensions
|
||||
@samp{-r} is used with @samp{-S} default value, or when @sc{gnu} extensions
|
||||
are disabled, this condition is always met and references are completely
|
||||
excluded from the output contexts.
|
||||
|
||||
@@ -2826,15 +2838,15 @@ This option selects which regular expression will describe the end of a
|
||||
line or the end of a sentence. In fact, this regular expression is not
|
||||
the only distinction between end of lines or end of sentences, and input
|
||||
line boundaries have no special significance outside this option. By
|
||||
default, when GNU extensions are enabled and if @samp{-r} option is not
|
||||
default, when @sc{gnu} extensions are enabled and if @samp{-r} option is not
|
||||
used, end of sentences are used. In this case, this @var{regex} is
|
||||
imported from GNU Emacs:
|
||||
imported from @sc{gnu} Emacs:
|
||||
|
||||
@example
|
||||
[.?!][]\"')@}]*\\($\\|\t\\| \\)[ \t\n]*
|
||||
@end example
|
||||
|
||||
Whenever GNU extensions are disabled or if @samp{-r} option is used, end
|
||||
Whenever @sc{gnu} extensions are disabled or if @samp{-r} option is used, end
|
||||
of lines are used; in this case, the default @var{regexp} is just:
|
||||
|
||||
@example
|
||||
@@ -2866,8 +2878,8 @@ corresponding characters by @code{ptx} itself.
|
||||
@itemx --word-regexp=@var{regexp}
|
||||
|
||||
This option selects which regular expression will describe each keyword.
|
||||
By default, if GNU extensions are enabled, a word is a sequence of
|
||||
letters; the @var{regexp} used is @samp{\w+}. When GNU extensions are
|
||||
By default, if @sc{gnu} extensions are enabled, a word is a sequence of
|
||||
letters; the @var{regexp} used is @samp{\w+}. When @sc{gnu} extensions are
|
||||
disabled, a word is by default anything which ends with a space, a tab
|
||||
or a newline; the @var{regexp} used is @samp{[^ \t\n]+}.
|
||||
|
||||
@@ -2887,14 +2899,14 @@ the corresponding characters by @code{ptx} itself.
|
||||
|
||||
Output format is mainly controlled by the @samp{-O} and @samp{-T} options
|
||||
described in the table below. When neither @samp{-O} nor @samp{-T} are
|
||||
selected, and if GNU extensions are enabled, the program chooses an
|
||||
selected, and if @sc{gnu} extensions are enabled, the program chooses an
|
||||
output format suitable for a dumb terminal. Each keyword occurrence is
|
||||
output to the center of one line, surrounded by its left and right
|
||||
contexts. Each field is properly justified, so the concordance output
|
||||
can be readily observed. As a special feature, if automatic
|
||||
references are selected by option @samp{-A} and are output before the
|
||||
left context, that is, if option @samp{-R} is @emph{not} selected, then
|
||||
a colon is added after the reference; this nicely interfaces with GNU
|
||||
a colon is added after the reference; this nicely interfaces with @sc{gnu}
|
||||
Emacs @code{next-error} processing. In this default output format, each
|
||||
white space character, like newline and tab, is merely changed to
|
||||
exactly one space, with no special attempt to compress consecutive
|
||||
@@ -2915,13 +2927,13 @@ output line.
|
||||
@item -w @var{number}
|
||||
@itemx --width=@var{number}
|
||||
|
||||
Select the output maximum width of each final line. If references are
|
||||
used, they are included or excluded from the output maximum width
|
||||
Select the maximum output width of each final line. If references are
|
||||
used, they are included or excluded from the maximum output width
|
||||
depending on the value of option @samp{-R}. If this option is not
|
||||
selected, that is, when references are output before the left context,
|
||||
the output maximum width takes into account the maximum length of all
|
||||
the maximum output width takes into account the maximum length of all
|
||||
references. If this option is selected, that is, when references are
|
||||
output after the right context, the output maximum width does not take
|
||||
output after the right context, the maximum output width does not take
|
||||
into account the space taken by references, nor the gap that precedes
|
||||
them.
|
||||
|
||||
@@ -2938,17 +2950,16 @@ reference is used at output time, overriding the input reference.
|
||||
@item -R
|
||||
@itemx --right-side-refs
|
||||
|
||||
In default output format, when option @samp{-R} is not used, any
|
||||
reference produced by the effect of options @samp{-r} or @samp{-A} are
|
||||
given to the far right of output lines, after the right context. In
|
||||
default output format, when option @samp{-R} is specified, references
|
||||
are rather given to the beginning of each output line, before the left
|
||||
context. For any other output format, option @samp{-R} is almost
|
||||
ignored, except for the fact that the width of references is @emph{not}
|
||||
taken into account in total output width given by @samp{-w} whenever
|
||||
@samp{-R} is selected.
|
||||
In the default output format, when option @samp{-R} is not used, any
|
||||
references produced by the effect of options @samp{-r} or @samp{-A} are
|
||||
placed to the far right of output lines, after the right context. With
|
||||
default output format, when the @samp{-R} option is specified, references
|
||||
are rather placed at the beginning of each output line, before the left
|
||||
context. For any other output format, option @samp{-R} is
|
||||
ignored, with one exception: with @samp{-R} the width of references
|
||||
is @emph{not} taken into account in total output width given by @samp{-w}.
|
||||
|
||||
This option is automatically selected whenever GNU extensions are
|
||||
This option is automatically selected whenever @sc{gnu} extensions are
|
||||
disabled.
|
||||
|
||||
@item -F @var{string}
|
||||
@@ -2990,8 +3001,8 @@ processing. Each output line will look like:
|
||||
@end smallexample
|
||||
|
||||
so it will be possible to write a @samp{.xx} roff macro to take care of
|
||||
the output typesetting. This is the default output format when GNU
|
||||
extensions are disabled. Option @samp{-M} might be used to change
|
||||
the output typesetting. This is the default output format when @sc{gnu}
|
||||
extensions are disabled. Option @samp{-M} can be used to change
|
||||
@samp{xx} to another macro name.
|
||||
|
||||
In this output format, each non-graphical character, like newline and
|
||||
@@ -3014,48 +3025,48 @@ so it will be possible to write a @code{\xx} definition to take care of
|
||||
the output typesetting. Note that when references are not being
|
||||
produced, that is, neither option @samp{-A} nor option @samp{-r} is
|
||||
selected, the last parameter of each @code{\xx} call is inhibited.
|
||||
Option @samp{-M} might be used to change @samp{xx} to another macro
|
||||
Option @samp{-M} can be used to change @samp{xx} to another macro
|
||||
name.
|
||||
|
||||
In this output format, some special characters, like @kbd{$}, @kbd{%},
|
||||
@kbd{&}, @kbd{#} and @kbd{_} are automatically protected with a
|
||||
backslash. Curly brackets @kbd{@{}, @kbd{@}} are also protected with a
|
||||
backslash, but also enclosed in a pair of dollar signs to force
|
||||
mathematical mode. The backslash itself produces the sequence
|
||||
@code{\backslash@{@}}. Circumflex and tilde diacritics produce the
|
||||
sequence @code{^\@{ @}} and @code{~\@{ @}} respectively. Other
|
||||
diacriticized characters of the underlying character set produce an
|
||||
appropriate @TeX{} sequence as far as possible. The other non-graphical
|
||||
characters, like newline and tab, and all others characters which are
|
||||
not part of @sc{ascii}, are merely changed to exactly one space, with no
|
||||
special attempt to compress consecutive spaces. Let me know how to
|
||||
improve this special character processing for @TeX{}.
|
||||
backslash. Curly brackets @kbd{@{}, @kbd{@}} are protected with a
|
||||
backslash and a pair of dollar signs (to force mathematical mode). The
|
||||
backslash itself produces the sequence @code{\backslash@{@}}.
|
||||
Circumflex and tilde diacritics produce the sequence @code{^\@{ @}} and
|
||||
@code{~\@{ @}} respectively. Other diacriticized characters of the
|
||||
underlying character set produce an appropriate @TeX{} sequence as far
|
||||
as possible. The other non-graphical characters, like newline and tab,
|
||||
and all other characters which are not part of @sc{ascii}, are merely
|
||||
changed to exactly one space, with no special attempt to compress
|
||||
consecutive spaces. Let me know how to improve this special character
|
||||
processing for @TeX{}.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@node Compatibility in ptx
|
||||
@subsection The GNU extensions to @code{ptx}
|
||||
@subsection The @sc{gnu} extensions to @code{ptx}
|
||||
|
||||
This version of @code{ptx} contains a few features which do not exist in
|
||||
System V @code{ptx}. These extra features are suppressed by using the
|
||||
@samp{-G} command line option, unless overridden by other command line
|
||||
options. Some GNU extensions cannot be recovered by overriding, so the
|
||||
simple rule is to avoid @samp{-G} if you care about GNU extensions.
|
||||
options. Some @sc{gnu} extensions cannot be recovered by overriding, so the
|
||||
simple rule is to avoid @samp{-G} if you care about @sc{gnu} extensions.
|
||||
Here are the differences between this program and System V @code{ptx}.
|
||||
|
||||
@itemize @bullet
|
||||
|
||||
@item
|
||||
This program can read many input files at once, it always writes the
|
||||
resulting concordance on standard output. On the other end, System V
|
||||
@code{ptx} reads only one file and produce the result on standard output
|
||||
resulting concordance on standard output. On the other hand, System V
|
||||
@code{ptx} reads only one file and sends the result to standard output
|
||||
or, if a second @var{file} parameter is given on the command, to that
|
||||
@var{file}.
|
||||
|
||||
Having output parameters not introduced by options is a quite dangerous
|
||||
practice which GNU avoids as far as possible. So, for using @code{ptx}
|
||||
portably between GNU and System V, you should always use it with a
|
||||
Having output parameters not introduced by options is a dangerous
|
||||
practice which @sc{gnu} avoids as far as possible. So, for using @code{ptx}
|
||||
portably between @sc{gnu} and System V, you should always use it with a
|
||||
single input file, and always expect the result on standard output. You
|
||||
might also want to automatically configure in a @samp{-G} option to
|
||||
@code{ptx} calls in products using @code{ptx}, if the configurator finds
|
||||
@@ -3064,9 +3075,9 @@ that the installed @code{ptx} accepts @samp{-G}.
|
||||
@item
|
||||
The only options available in System V @code{ptx} are options @samp{-b},
|
||||
@samp{-f}, @samp{-g}, @samp{-i}, @samp{-o}, @samp{-r}, @samp{-t} and
|
||||
@samp{-w}. All other options are GNU extensions and are not repeated in
|
||||
@samp{-w}. All other options are @sc{gnu} extensions and are not repeated in
|
||||
this enumeration. Moreover, some options have a slightly different
|
||||
meaning when GNU extensions are enabled, as explained below.
|
||||
meaning when @sc{gnu} extensions are enabled, as explained below.
|
||||
|
||||
@item
|
||||
By default, concordance output is not formatted for @code{troff} or
|
||||
@@ -3075,29 +3086,29 @@ or @code{nroff} output may still be selected through option @samp{-O}.
|
||||
|
||||
@item
|
||||
Unless @samp{-R} option is used, the maximum reference width is
|
||||
subtracted from the total output line width. With GNU extensions
|
||||
subtracted from the total output line width. With @sc{gnu} extensions
|
||||
disabled, width of references is not taken into account in the output
|
||||
line width computations.
|
||||
|
||||
@item
|
||||
All 256 characters, even @kbd{NUL}s, are always read and processed from
|
||||
input file with no adverse effect, even if GNU extensions are disabled.
|
||||
input file with no adverse effect, even if @sc{gnu} extensions are disabled.
|
||||
However, System V @code{ptx} does not accept 8-bit characters, a few
|
||||
control characters are rejected, and the tilde @kbd{~} is also rejected.
|
||||
|
||||
@item
|
||||
Input line length is only limited by available memory, even if GNU
|
||||
Input line length is only limited by available memory, even if @sc{gnu}
|
||||
extensions are disabled. However, System V @code{ptx} processes only
|
||||
the first 200 characters in each line.
|
||||
|
||||
@item
|
||||
The break (non-word) characters default to be every character except all
|
||||
letters of the underlying character set, diacriticized or not. When GNU
|
||||
letters of the underlying character set, diacriticized or not. When @sc{gnu}
|
||||
extensions are disabled, the break characters default to space, tab and
|
||||
newline only.
|
||||
|
||||
@item
|
||||
The program makes better use of output line width. If GNU extensions
|
||||
The program makes better use of output line width. If @sc{gnu} extensions
|
||||
are disabled, the program rather tries to imitate System V @code{ptx},
|
||||
but still, there are some slight disposition glitches this program does
|
||||
not completely reproduce.
|
||||
@@ -3134,7 +3145,7 @@ cut [@var{option}]@dots{} [@var{file}]@dots{}
|
||||
In the table which follows, the @var{byte-list}, @var{character-list},
|
||||
and @var{field-list} are one or more numbers or ranges (two numbers
|
||||
separated by a dash) separated by commas. Bytes, characters, and
|
||||
fields are numbered from starting at 1. Incomplete ranges may be
|
||||
fields are numbered starting at 1. Incomplete ranges may be
|
||||
given: @samp{-@var{m}} means @samp{1-@var{m}}; @samp{@var{n}-} means
|
||||
@samp{@var{n}} through end of line or last field.
|
||||
|
||||
@@ -3165,6 +3176,8 @@ take up 1 character.
|
||||
@opindex --fields
|
||||
Print only the fields listed in @var{field-list}. Fields are
|
||||
separated by a TAB character by default.
|
||||
Also print any line that contains no delimiter character, unless
|
||||
the @samp{--only-delimited} (@samp{-s}) option is specified
|
||||
|
||||
@item -d @var{input_delim_byte}
|
||||
@itemx --delimiter=@var{input_delim_byte}
|
||||
@@ -3330,7 +3343,7 @@ Print a line for each unpairable line in file @var{file-number}
|
||||
|
||||
@end table
|
||||
|
||||
In addition, when GNU @code{join} is invoked with exactly one argument,
|
||||
In addition, when @sc{gnu} @code{join} is invoked with exactly one argument,
|
||||
options @samp{--help} and @samp{--version} are recognized. @xref{Common
|
||||
options}.
|
||||
|
||||
@@ -3438,7 +3451,7 @@ from @var{m} through @var{n}, in ascending order. @var{m} should
|
||||
collate before @var{n}; if it doesn't, an error results. As an example,
|
||||
@samp{0-9} is the same as @samp{0123456789}.
|
||||
|
||||
GNU @code{tr} does not support the System V syntax that uses square
|
||||
@sc{gnu} @code{tr} does not support the System V syntax that uses square
|
||||
brackets to enclose ranges. Translations specified in that format
|
||||
sometimes work as expected, since the brackets are often transliterated
|
||||
to themselves. However, they should be avoided because they sometimes
|
||||
@@ -3526,7 +3539,7 @@ The syntax @samp{[=@var{c}=]} expands to all of the characters that are
|
||||
equivalent to @var{c}, in no particular order. Equivalence classes are
|
||||
a relatively recent invention intended to support non-English alphabets.
|
||||
But there seems to be no standard way to define them or determine their
|
||||
contents. Therefore, they are not fully implemented in GNU @code{tr};
|
||||
contents. Therefore, they are not fully implemented in @sc{gnu} @code{tr};
|
||||
each character's equivalence class consists only of that character,
|
||||
which is of no particular use.
|
||||
|
||||
@@ -3574,8 +3587,8 @@ BSD @code{tr} pads @var{set2} to the length of @var{set1} by repeating
|
||||
the last character of @var{set2} as many times as necessary. System V
|
||||
@code{tr} truncates @var{set1} to the length of @var{set2}.
|
||||
|
||||
By default, GNU @code{tr} handles this case like BSD @code{tr}. When
|
||||
the @samp{--truncate-set1} (@samp{-t}) option is given, GNU @code{tr}
|
||||
By default, @sc{gnu} @code{tr} handles this case like BSD @code{tr}. When
|
||||
the @samp{--truncate-set1} (@samp{-t}) option is given, @sc{gnu} @code{tr}
|
||||
handles this case like the System V @code{tr} instead. This option is
|
||||
ignored for operations other than translation.
|
||||
|
||||
@@ -3714,7 +3727,7 @@ following warning and error messages, for strict compliance with
|
||||
|
||||
@item
|
||||
When the @samp{--delete} option is given but @samp{--squeeze-repeats}
|
||||
is not, and @var{set2} is given, GNU @code{tr} by default prints
|
||||
is not, and @var{set2} is given, @sc{gnu} @code{tr} by default prints
|
||||
a usage message and exits, because @var{set2} would not be used.
|
||||
The @sc{posix} specification says that @var{set2} must be ignored in
|
||||
this case. Silently ignoring arguments is a bad idea.
|
||||
@@ -3726,9 +3739,9 @@ value 400 octal does not fit into a single byte.
|
||||
|
||||
@end enumerate
|
||||
|
||||
GNU @code{tr} does not provide complete BSD or System V compatibility.
|
||||
@sc{gnu} @code{tr} does not provide complete BSD or System V compatibility.
|
||||
For example, it is impossible to disable interpretation of the @sc{posix}
|
||||
constructs @samp{[:alpha:]}, @samp{[=c=]}, and @samp{[c*10]}. Also, GNU
|
||||
constructs @samp{[:alpha:]}, @samp{[=c=]}, and @samp{[c*10]}. Also, @sc{gnu}
|
||||
@code{tr} does not delete zero bytes automatically, unlike traditional
|
||||
Unix versions, which provide no way to preserve zero bytes.
|
||||
|
||||
@@ -3853,13 +3866,13 @@ Robbins.
|
||||
@node Toolbox introduction
|
||||
@unnumberedsec Toolbox introduction
|
||||
|
||||
This month's column is only peripherally related to the GNU Project, in
|
||||
that it describes a number of the GNU tools on your Linux system and how they
|
||||
might be used. What it's really about is the ``Software Tools'' philosophy
|
||||
This month's column is only peripherally related to the @sc{gnu} Project, in
|
||||
that it describes a number of the @sc{gnu} tools on your Linux system and how
|
||||
they might be used. What it's really about is the ``Software Tools'' philosophy
|
||||
of program development and usage.
|
||||
|
||||
The software tools philosophy was an important and integral concept
|
||||
in the initial design and development of Unix (of which Linux and GNU are
|
||||
in the initial design and development of Unix (of which Linux and @sc{gnu} are
|
||||
essentially clones). Unfortunately, in the modern day press of
|
||||
Internetworking and flashy GUIs, it seems to have fallen by the
|
||||
wayside. This is a shame, since it provides a powerful mental model
|
||||
@@ -4352,8 +4365,8 @@ appropriate tool, build one.
|
||||
As of this writing, all the programs we've discussed are available via
|
||||
anonymous @code{ftp} from @code{prep.ai.mit.edu} as
|
||||
@file{/pub/gnu/textutils-1.9.tar.gz}.@footnote{Version 1.9 was current
|
||||
when this column was written. Check the nearest GNU archive for the
|
||||
current version. The main GNU FTP site is now @code{ftp.gnu.org}.}
|
||||
when this column was written. Check the nearest @sc{gnu} archive for the
|
||||
current version. The main @sc{gnu} FTP site is now @code{ftp.gnu.org}.}
|
||||
|
||||
None of what I have presented in this column is new. The Software Tools
|
||||
philosophy was first introduced in the book @cite{Software Tools},
|
||||
@@ -4379,8 +4392,8 @@ whose members had ported the original @code{ratfor} programs to essentially
|
||||
every computer system with a FORTRAN compiler. The popularity of the
|
||||
group waned in the middle '80s as Unix began to spread beyond universities.
|
||||
|
||||
With the current proliferation of GNU code and other clones of Unix programs,
|
||||
these programs now receive little attention; modern C versions are
|
||||
With the current proliferation of @sc{gnu} code and other clones of Unix
|
||||
programs, these programs now receive little attention; modern C versions are
|
||||
much more efficient and do more than these programs do. Nevertheless, as
|
||||
exposition of good programming style, and evangelism for a still-valuable
|
||||
philosophy, these books are unparalleled, and I recommend them highly.
|
||||
|
||||
@@ -217,3 +217,13 @@ p delta
|
||||
n
|
||||
p Start
|
||||
q
|
||||
b dir_name
|
||||
r
|
||||
n
|
||||
p slash
|
||||
n
|
||||
n
|
||||
n
|
||||
p slash
|
||||
p slash - path + 1
|
||||
q
|
||||
|
||||
350
lib/ChangeLog
350
lib/ChangeLog
@@ -1,3 +1,353 @@
|
||||
2001-01-15 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* unicodeio.c (print_unicode_char): Cast the second iconv() arg,
|
||||
to avoid a warning. Add back 'const' to inptr.
|
||||
|
||||
2001-01-16 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* basename.c: Include <stdio.h>, needed by assert on SunOS4.
|
||||
From Bruno Haible.
|
||||
|
||||
2001-01-14 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* rename.c: New file. From Volker Borchert.
|
||||
Include stdlib.h, string.h or strings.h, and xalloc.h.
|
||||
Use strip_trailing_slashes rather than open-coding it.
|
||||
|
||||
2001-01-03 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* lib/strftime.c: Sync with glibc time/strftime.c 1.81.
|
||||
|
||||
2001-01-03 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* unicodeio.c (print_unicode_char): Remove `const' from declaration of
|
||||
local `inptr' to avoid warning with some system declarations of iconv.
|
||||
|
||||
2000-12-29 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* lib/modechange.c: Do not assume that mode_t uses the
|
||||
traditional octal encoding. E.g. "chmod 1 FOO" should set
|
||||
the other-execute bit of FOO even if S_IXOTH != 1.
|
||||
|
||||
(SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
|
||||
WOTH, XOTH, ALLM): New macros.
|
||||
(S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
|
||||
S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
|
||||
Use them.
|
||||
(S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
|
||||
(S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
|
||||
(mode_compile):
|
||||
No need to use uintmax_t; unsigned long is long enough.
|
||||
Don't bother to get suffix since we don't use it.
|
||||
|
||||
2000-12-24 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* hash.c (is_prime): Return explicit boolean values.
|
||||
(hash_get_first): Return NULL to appease Irix5.6's 89.
|
||||
Reported by Nelson Beebe.
|
||||
|
||||
2000-10-31 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* localcharset.c (locale_charset): Add support for Win32.
|
||||
|
||||
2000-12-18 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* physmem.h, physmem.c: New files.
|
||||
|
||||
* Makefile.am (libfetish_a_SOURCES): Add physmem.c.
|
||||
(noinst_HEADERS): Add physmem.h.
|
||||
|
||||
* xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
|
||||
't' for compatibility with Solaris 8 sort.
|
||||
|
||||
2000-12-18 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* config.charset: Add support for BeOS.
|
||||
|
||||
2000-12-16 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
|
||||
SHELLS_FILE to a file name that's useful on djgpp systems.
|
||||
Include stdlib.h.
|
||||
(ADDITIONAL_DEFAULT_SHELLS): Define.
|
||||
(default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
|
||||
Based mostly on a patch from Prashant TR.
|
||||
|
||||
2000-12-16 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
This bug had a serious impact on chown: `chown N:M FILE' (for integer
|
||||
N and M) would have treated it like `chown N:N FILE'.
|
||||
|
||||
* userspec.c (parse_user_spec): Fix typo: s/u/g/.
|
||||
|
||||
2000-10-31 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
|
||||
CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
|
||||
to the list of canonical encodings. Rename EUC-CN to GB2312.
|
||||
|
||||
2000-12-08 Andreas Schwab <schwab@suse.de>
|
||||
|
||||
* mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
|
||||
invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
|
||||
|
||||
2000-12-07 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* stripslash.c (ISSLASH): Define.
|
||||
(strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
|
||||
From Prashant TR.
|
||||
|
||||
* dirname.c (FILESYSTEM_PREFIX_LEN): Define.
|
||||
(dir_name_r): Declare this function as static.
|
||||
[BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
|
||||
manifest itself on a name containing a mix of slashes and
|
||||
backslashes.
|
||||
Make this function work with names starting with a DOS-style
|
||||
drive letter and colon prefix.
|
||||
(dir_name): Append `.' if necessary.
|
||||
Based mostly on patches from Prashant TR and Eli Zaretskii.
|
||||
|
||||
* dirname.h (dir_name_r): Remove prototype.
|
||||
|
||||
2000-12-05 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* dirname.c (dir_name_r): Add `const' in a few local declarations.
|
||||
|
||||
2000-12-04 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
|
||||
Also include memory.h, stdlib.h, unistd.h if appropriate.
|
||||
Reported by Andreas Jaeger (conflicting declaration of malloc).
|
||||
|
||||
2000-12-02 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* closeout.h: Make idempotent, to avoid some obscure warnings.
|
||||
|
||||
2000-12-01 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* lib/memrchr.c: Include <config.h> before any system include file.
|
||||
|
||||
2000-11-29 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* lib/dirname.c (dir_name_r): Fix typo: int -> size_t.
|
||||
|
||||
2000-11-26 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* memcoll.c: Include sys/types.h. From Werner Almesberger.
|
||||
|
||||
2000-11-22 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* lib/strftime.c (my_strftime): Do not invoke mbrlen with a
|
||||
size of (size_t) -1; it's not portable.
|
||||
|
||||
2000-11-17 Akim Demaille <akim@epita.fr>
|
||||
|
||||
* lib/obstack.h: Formatting changes.
|
||||
(obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
|
||||
prevent type checking.
|
||||
(obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
|
||||
cast the value to (void *): assigning a `foo *' to a `void *'
|
||||
variable is valid.
|
||||
(obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
|
||||
|
||||
2000-11-17 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* strstr.c: Update from GNU libc.
|
||||
|
||||
2000-11-16 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* strverscmp.c: Incorporate weak-alias-related changes from glibc.
|
||||
|
||||
2000-11-11 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* error.c: Add a couple #includes, merging from GNU libc version.
|
||||
|
||||
2000-11-10 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* obstack.h: Update from GNU libc.
|
||||
* obstack.c: Likewise.
|
||||
|
||||
2000-11-06 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* getusershell.c (setusershell): Use rewind rather than
|
||||
fseek/fseeko, to avoid configuration hassles with fseeko.
|
||||
Don't bother opening SHELLS_FILE if shellstream is NULL;
|
||||
it's not necessary.
|
||||
|
||||
2000-11-05 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* makepath.h (make_dir): Declare.
|
||||
* makepath.c (make_dir): Remove `static' attribute.
|
||||
Tweak a comment.
|
||||
|
||||
2000-11-04 Alexandre Duret-Lutz <duret_g@epita.fr>
|
||||
|
||||
* hash.c (hash_get_next): Fix a thinko: when ENTRY is the
|
||||
last one in a bucket, advance to the next bucket.
|
||||
|
||||
2000-11-02 Vesselin Atanasov <vesselin@bgnet.bg>
|
||||
|
||||
* fnmatch.c: Do not comment out all the code if we are using
|
||||
the GNU C library, because in some cases we are replacing buggy
|
||||
code in the GNU C library itself.
|
||||
|
||||
2000-10-30 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* error.h, getline.h, modechange.h:
|
||||
Remove "2000" from Copyright line, as the file hasn't been
|
||||
changed this year other than in the copyright notice.
|
||||
|
||||
* xalloc.h: Add "2000" to Copyright line, as this file
|
||||
was changed this year.
|
||||
|
||||
2000-10-30 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* fnmatch.c (FOLD): Do not assume that characters are unsigned.
|
||||
(fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
|
||||
e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
|
||||
|
||||
2000-10-29 Greg Louis <glouis@dynamicro.on.ca>
|
||||
|
||||
* regex.h (__restrict_arr): Move definition out of #ifndef block.
|
||||
Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
|
||||
doesn't define __restrict_arr.
|
||||
|
||||
2000-10-29 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* xstat.in: Fix grammar in comment.
|
||||
|
||||
2000-10-28 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* memchr.c: Update from libc.
|
||||
Adjust for portability:
|
||||
[HAVE_STDLIB_H]: Include stdlib.h.
|
||||
[HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
|
||||
Undef __memchr, too.
|
||||
[!weak_alias]: Define __memchr to memchr.
|
||||
|
||||
* regex.c: Update from libc.
|
||||
* regex.h: Likewise.
|
||||
* getopt1.c: Likewise.
|
||||
* memcmp.c: Likewise.
|
||||
|
||||
* getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
|
||||
Avoid using fseek, when possible -- it's broken by design.
|
||||
Patch by Ulrich Drepper.
|
||||
|
||||
2000-10-26 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* strftime.c: Update from libc.
|
||||
|
||||
2000-10-25 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* obstack.c: Update from libc.
|
||||
|
||||
2000-10-23 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* hard-locale.c (hard_locale): Revert last change -- it was simply
|
||||
wrong. That set_locale call must not have any side effects.
|
||||
From Paul Eggert.
|
||||
|
||||
2000-10-22 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
|
||||
[CYCLIC]: Remove now-unused definition.
|
||||
|
||||
* save-cwd.c (O_DIRECTORY): Define, if needed.
|
||||
(save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
|
||||
Suggestion from Ulrich Drepper.
|
||||
|
||||
2000-10-21 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* dirname.c (dir_name_r): New function, factored out of dir_name.
|
||||
(dir_name): Use dir_name_r.
|
||||
* dirname.h (dir_name_r): Declare it.
|
||||
|
||||
2000-10-21 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* dirname.c (memrchr): Declare if necessary.
|
||||
(dir_name): Remove the restriction that there be no
|
||||
trailing slashes. Now, this code skips past them, effectively
|
||||
ignoring them.
|
||||
[TEST_DIRNAME] (main): New unit tests.
|
||||
|
||||
* memrchr.c: New file from GNU libc.
|
||||
Undef __memrchr, too.
|
||||
[!weak_alias]: Define __memrchr to memrchr.
|
||||
Guard weak_alias use with `#ifdef weak_alias'.
|
||||
|
||||
2000-10-17 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* quote.h (PARAMS): Define and use.
|
||||
Reported by Akim Demaille.
|
||||
|
||||
* getopt.c: Update from libc.
|
||||
|
||||
2000-10-16 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
|
||||
From Jan Fedak.
|
||||
|
||||
2000-09-25 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* md5.h (rol): Define (from GnuPG).
|
||||
|
||||
* sha.c: Give credit (GnuPG) where due.
|
||||
(M): Use rol rather than open-coding it.
|
||||
Add a FIXME comment.
|
||||
|
||||
2000-09-21 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* userspec.c (parse_user_spec): Remove debugging printf I'd added.
|
||||
Reported by Michael Stone.
|
||||
|
||||
2000-09-20 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Makefile.am (libfetish_a_SOURCES): Add sha.c.
|
||||
(noinst_HEADERS): Add sha.h.
|
||||
Based on code from Scott G. Miller and from GnuPG.
|
||||
|
||||
2000-09-15 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* regex.c: Update from libc.
|
||||
|
||||
2000-09-10 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* getopt.c (_getopt_internal): Update from glibc.
|
||||
|
||||
2000-09-09 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
|
||||
think it should be used as a general replacement for isascii.
|
||||
* fnmatch.c: Likewise.
|
||||
* mbswidth.c: Likewise
|
||||
* regex.c: Likewise.
|
||||
|
||||
Don't use atoi.
|
||||
* userspec.c: Include sys/param.h and limits.h.
|
||||
Include xstrtol.h.
|
||||
(CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
|
||||
(UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
|
||||
(parse_user_spec): Use xstrtoul, not atoi when converting numeric
|
||||
UID, GID. Check range.
|
||||
|
||||
2000-09-06 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* getopt.c (_getopt_internal): Update from glibc.
|
||||
|
||||
2000-08-30 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* strftime.c: Merge in changes from GNU libc.
|
||||
|
||||
2000-08-26 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* closeout.c: Include "__fpending.h".
|
||||
(close_stdout_status): Return right away if there's nothing to flush.
|
||||
|
||||
* Makefile.am (noinst_HEADERS): Add __fpending.h.
|
||||
* __fpending.c: New file.
|
||||
* __fpending.h: New file.
|
||||
|
||||
2000-08-07 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
Standardize on "memory exhausted" instead of "Memory exhausted"
|
||||
|
||||
@@ -13,9 +13,9 @@ libfetish_a_SOURCES = \
|
||||
full-write.c getopt.c getopt1.c getstr.c getugroups.c hard-locale.c hash.c \
|
||||
human.c idcache.c isdir.c linebuffer.c localcharset.c long-options.c \
|
||||
makepath.c mbswidth.c md5.c memcasecmp.c memcoll.c modechange.c \
|
||||
path-concat.c \
|
||||
path-concat.c physmem.c \
|
||||
quote.c quotearg.c readtokens.c safe-read.c same.c save-cwd.c \
|
||||
savedir.c stripslash.c unicodeio.c userspec.c version-etc.c xgetcwd.c \
|
||||
savedir.c sha.c stripslash.c unicodeio.c userspec.c version-etc.c xgetcwd.c \
|
||||
xgethostname.c xmalloc.c xstrdup.c xstrtod.c xstrtol.c xstrtoul.c \
|
||||
xstrtoumax.c yesno.c
|
||||
|
||||
@@ -24,12 +24,14 @@ libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
|
||||
|
||||
noinst_HEADERS = \
|
||||
argmatch.h backupfile.h bumpalloc.h closeout.h diacrit.h dirname.h error.h \
|
||||
exclude.h filemode.h fnmatch.h fsusage.h getdate.h getline.h getopt.h \
|
||||
exclude.h filemode.h fnmatch.h __fpending.h fsusage.h \
|
||||
getdate.h getline.h getopt.h \
|
||||
getstr.h getpagesize.h group-member.h hard-locale.h hash.h human.h lchown.h \
|
||||
linebuffer.h long-options.h mbswidth.h md5.h memcasecmp.h memcoll.h \
|
||||
makepath.h mbswidth.h modechange.h mountlist.h nanosleep.h obstack.h \
|
||||
path-concat.h pathmax.h posixtm.h quote.h quotearg.h readtokens.h \
|
||||
readutmp.h regex.h safe-read.h same.h save-cwd.h savedir.h \
|
||||
path-concat.h pathmax.h physmem.h posixtm.h \
|
||||
quote.h quotearg.h readtokens.h \
|
||||
readutmp.h regex.h safe-read.h same.h save-cwd.h savedir.h sha.h \
|
||||
strverscmp.h unicodeio.h version-etc.h xalloc.h xstrtod.h xstrtol.h
|
||||
|
||||
BUILT_SOURCES = getdate.c lstat.c stat.c
|
||||
|
||||
166
lib/Makefile.in
166
lib/Makefile.in
@@ -1,6 +1,7 @@
|
||||
# Makefile.in generated automatically by automake 1.4a from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.4b from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
@@ -128,9 +129,9 @@ libfetish_a_SOURCES = \
|
||||
full-write.c getopt.c getopt1.c getstr.c getugroups.c hard-locale.c hash.c \
|
||||
human.c idcache.c isdir.c linebuffer.c localcharset.c long-options.c \
|
||||
makepath.c mbswidth.c md5.c memcasecmp.c memcoll.c modechange.c \
|
||||
path-concat.c \
|
||||
path-concat.c physmem.c \
|
||||
quote.c quotearg.c readtokens.c safe-read.c same.c save-cwd.c \
|
||||
savedir.c stripslash.c unicodeio.c userspec.c version-etc.c xgetcwd.c \
|
||||
savedir.c sha.c stripslash.c unicodeio.c userspec.c version-etc.c xgetcwd.c \
|
||||
xgethostname.c xmalloc.c xstrdup.c xstrtod.c xstrtol.c xstrtoul.c \
|
||||
xstrtoumax.c yesno.c
|
||||
|
||||
@@ -140,12 +141,14 @@ libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
|
||||
|
||||
noinst_HEADERS = \
|
||||
argmatch.h backupfile.h bumpalloc.h closeout.h diacrit.h dirname.h error.h \
|
||||
exclude.h filemode.h fnmatch.h fsusage.h getdate.h getline.h getopt.h \
|
||||
exclude.h filemode.h fnmatch.h __fpending.h fsusage.h \
|
||||
getdate.h getline.h getopt.h \
|
||||
getstr.h getpagesize.h group-member.h hard-locale.h hash.h human.h lchown.h \
|
||||
linebuffer.h long-options.h mbswidth.h md5.h memcasecmp.h memcoll.h \
|
||||
makepath.h mbswidth.h modechange.h mountlist.h nanosleep.h obstack.h \
|
||||
path-concat.h pathmax.h posixtm.h quote.h quotearg.h readtokens.h \
|
||||
readutmp.h regex.h safe-read.h same.h save-cwd.h savedir.h \
|
||||
path-concat.h pathmax.h physmem.h posixtm.h \
|
||||
quote.h quotearg.h readtokens.h \
|
||||
readutmp.h regex.h safe-read.h same.h save-cwd.h savedir.h sha.h \
|
||||
strverscmp.h unicodeio.h version-etc.h xalloc.h xstrtod.h xstrtol.h
|
||||
|
||||
|
||||
@@ -178,11 +181,12 @@ diacrit$U.o dirname$U.o exclude$U.o filemode$U.o full-write$U.o \
|
||||
getopt$U.o getopt1$U.o getstr$U.o getugroups$U.o hard-locale$U.o \
|
||||
hash$U.o human$U.o idcache$U.o isdir$U.o linebuffer$U.o \
|
||||
localcharset$U.o long-options$U.o makepath$U.o mbswidth$U.o md5$U.o \
|
||||
memcasecmp$U.o memcoll$U.o modechange$U.o path-concat$U.o quote$U.o \
|
||||
quotearg$U.o readtokens$U.o safe-read$U.o same$U.o save-cwd$U.o \
|
||||
savedir$U.o stripslash$U.o unicodeio$U.o userspec$U.o version-etc$U.o \
|
||||
xgetcwd$U.o xgethostname$U.o xmalloc$U.o xstrdup$U.o xstrtod$U.o \
|
||||
xstrtol$U.o xstrtoul$U.o xstrtoumax$U.o yesno$U.o
|
||||
memcasecmp$U.o memcoll$U.o modechange$U.o path-concat$U.o physmem$U.o \
|
||||
quote$U.o quotearg$U.o readtokens$U.o safe-read$U.o same$U.o \
|
||||
save-cwd$U.o savedir$U.o sha$U.o stripslash$U.o unicodeio$U.o \
|
||||
userspec$U.o version-etc$U.o xgetcwd$U.o xgethostname$U.o xmalloc$U.o \
|
||||
xstrdup$U.o xstrtod$U.o xstrtol$U.o xstrtoul$U.o xstrtoumax$U.o \
|
||||
yesno$U.o
|
||||
libfetish_a_OBJECTS = $(am_libfetish_a_OBJECTS)
|
||||
AR = ar
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
@@ -193,35 +197,37 @@ DIST_SOURCES = $(libfetish_a_SOURCES)
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
DEP_FILES = @AMDEP@ $(DEPDIR)/addext$U.Po $(DEPDIR)/alloca.Po \
|
||||
$(DEPDIR)/argmatch$U.Po $(DEPDIR)/atexit.Po $(DEPDIR)/backupfile$U.Po \
|
||||
$(DEPDIR)/basename$U.Po $(DEPDIR)/canon-host$U.Po $(DEPDIR)/chown.Po \
|
||||
$(DEPDIR)/closeout$U.Po $(DEPDIR)/diacrit$U.Po $(DEPDIR)/dirname$U.Po \
|
||||
$(DEPDIR)/dup2.Po $(DEPDIR)/error.Po $(DEPDIR)/euidaccess.Po \
|
||||
$(DEPDIR)/exclude$U.Po $(DEPDIR)/fileblocks.Po $(DEPDIR)/filemode$U.Po \
|
||||
$(DEPDIR)/fnmatch.Po $(DEPDIR)/fsusage.Po $(DEPDIR)/ftruncate.Po \
|
||||
$(DEPDIR)/full-write$U.Po $(DEPDIR)/getdate$U.Po $(DEPDIR)/getgroups.Po \
|
||||
$(DEPDIR)/gethostname.Po $(DEPDIR)/getline.Po $(DEPDIR)/getloadavg.Po \
|
||||
$(DEPDIR)/getopt$U.Po $(DEPDIR)/getopt1$U.Po $(DEPDIR)/getpass.Po \
|
||||
$(DEPDIR)/getstr$U.Po $(DEPDIR)/getugroups$U.Po \
|
||||
$(DEPDIR)/getusershell.Po $(DEPDIR)/group-member.Po \
|
||||
$(DEPDIR)/hard-locale$U.Po $(DEPDIR)/hash$U.Po $(DEPDIR)/human$U.Po \
|
||||
$(DEPDIR)/idcache$U.Po $(DEPDIR)/isdir$U.Po $(DEPDIR)/lchown.Po \
|
||||
$(DEPDIR)/linebuffer$U.Po $(DEPDIR)/localcharset$U.Po \
|
||||
$(DEPDIR)/long-options$U.Po $(DEPDIR)/lstat.Po $(DEPDIR)/makepath$U.Po \
|
||||
$(DEPDIR)/malloc.Po $(DEPDIR)/mbswidth$U.Po $(DEPDIR)/md5$U.Po \
|
||||
$(DEPDIR)/memcasecmp$U.Po $(DEPDIR)/memchr.Po $(DEPDIR)/memcmp.Po \
|
||||
$(DEPDIR)/memcoll$U.Po $(DEPDIR)/memcpy.Po $(DEPDIR)/memmove.Po \
|
||||
DEP_FILES = @AMDEP@ $(DEPDIR)/__fpending.Po $(DEPDIR)/addext$U.Po \
|
||||
$(DEPDIR)/alloca.Po $(DEPDIR)/argmatch$U.Po $(DEPDIR)/atexit.Po \
|
||||
$(DEPDIR)/backupfile$U.Po $(DEPDIR)/basename$U.Po \
|
||||
$(DEPDIR)/canon-host$U.Po $(DEPDIR)/chown.Po $(DEPDIR)/closeout$U.Po \
|
||||
$(DEPDIR)/diacrit$U.Po $(DEPDIR)/dirname$U.Po $(DEPDIR)/dup2.Po \
|
||||
$(DEPDIR)/error.Po $(DEPDIR)/euidaccess.Po $(DEPDIR)/exclude$U.Po \
|
||||
$(DEPDIR)/fileblocks.Po $(DEPDIR)/filemode$U.Po $(DEPDIR)/fnmatch.Po \
|
||||
$(DEPDIR)/fsusage.Po $(DEPDIR)/ftruncate.Po $(DEPDIR)/full-write$U.Po \
|
||||
$(DEPDIR)/getdate$U.Po $(DEPDIR)/getgroups.Po $(DEPDIR)/gethostname.Po \
|
||||
$(DEPDIR)/getline.Po $(DEPDIR)/getloadavg.Po $(DEPDIR)/getopt$U.Po \
|
||||
$(DEPDIR)/getopt1$U.Po $(DEPDIR)/getpass.Po $(DEPDIR)/getstr$U.Po \
|
||||
$(DEPDIR)/getugroups$U.Po $(DEPDIR)/getusershell.Po \
|
||||
$(DEPDIR)/group-member.Po $(DEPDIR)/hard-locale$U.Po \
|
||||
$(DEPDIR)/hash$U.Po $(DEPDIR)/human$U.Po $(DEPDIR)/idcache$U.Po \
|
||||
$(DEPDIR)/isdir$U.Po $(DEPDIR)/lchown.Po $(DEPDIR)/linebuffer$U.Po \
|
||||
$(DEPDIR)/localcharset$U.Po $(DEPDIR)/long-options$U.Po \
|
||||
$(DEPDIR)/lstat.Po $(DEPDIR)/makepath$U.Po $(DEPDIR)/malloc.Po \
|
||||
$(DEPDIR)/mbswidth$U.Po $(DEPDIR)/md5$U.Po $(DEPDIR)/memcasecmp$U.Po \
|
||||
$(DEPDIR)/memchr.Po $(DEPDIR)/memcmp.Po $(DEPDIR)/memcoll$U.Po \
|
||||
$(DEPDIR)/memcpy.Po $(DEPDIR)/memmove.Po $(DEPDIR)/memrchr.Po \
|
||||
$(DEPDIR)/memset.Po $(DEPDIR)/mktime.Po $(DEPDIR)/modechange$U.Po \
|
||||
$(DEPDIR)/mountlist.Po $(DEPDIR)/nanosleep.Po $(DEPDIR)/obstack.Po \
|
||||
$(DEPDIR)/path-concat$U.Po $(DEPDIR)/posixtm$U.Po $(DEPDIR)/putenv.Po \
|
||||
$(DEPDIR)/quote$U.Po $(DEPDIR)/quotearg$U.Po $(DEPDIR)/readtokens$U.Po \
|
||||
$(DEPDIR)/readutmp.Po $(DEPDIR)/realloc.Po $(DEPDIR)/regex.Po \
|
||||
$(DEPDIR)/path-concat$U.Po $(DEPDIR)/physmem$U.Po \
|
||||
$(DEPDIR)/posixtm$U.Po $(DEPDIR)/putenv.Po $(DEPDIR)/quote$U.Po \
|
||||
$(DEPDIR)/quotearg$U.Po $(DEPDIR)/readtokens$U.Po $(DEPDIR)/readutmp.Po \
|
||||
$(DEPDIR)/realloc.Po $(DEPDIR)/regex.Po $(DEPDIR)/rename.Po \
|
||||
$(DEPDIR)/rmdir.Po $(DEPDIR)/rpmatch.Po $(DEPDIR)/safe-read$U.Po \
|
||||
$(DEPDIR)/same$U.Po $(DEPDIR)/save-cwd$U.Po $(DEPDIR)/savedir$U.Po \
|
||||
$(DEPDIR)/stat.Po $(DEPDIR)/stime.Po $(DEPDIR)/stpcpy.Po \
|
||||
$(DEPDIR)/strcasecmp.Po $(DEPDIR)/strcspn.Po $(DEPDIR)/strdup.Po \
|
||||
$(DEPDIR)/strftime.Po $(DEPDIR)/stripslash$U.Po \
|
||||
$(DEPDIR)/sha$U.Po $(DEPDIR)/stat.Po $(DEPDIR)/stime.Po \
|
||||
$(DEPDIR)/stpcpy.Po $(DEPDIR)/strcasecmp.Po $(DEPDIR)/strcspn.Po \
|
||||
$(DEPDIR)/strdup.Po $(DEPDIR)/strftime.Po $(DEPDIR)/stripslash$U.Po \
|
||||
$(DEPDIR)/strncasecmp.Po $(DEPDIR)/strndup.Po $(DEPDIR)/strnlen.Po \
|
||||
$(DEPDIR)/strpbrk.Po $(DEPDIR)/strstr.Po $(DEPDIR)/strtod.Po \
|
||||
$(DEPDIR)/strtol.Po $(DEPDIR)/strtoul.Po $(DEPDIR)/strtoull.Po \
|
||||
@@ -232,15 +238,15 @@ $(DEPDIR)/xmalloc$U.Po $(DEPDIR)/xstrdup$U.Po $(DEPDIR)/xstrtod$U.Po \
|
||||
$(DEPDIR)/xstrtol$U.Po $(DEPDIR)/xstrtoul$U.Po \
|
||||
$(DEPDIR)/xstrtoumax$U.Po $(DEPDIR)/yesno$U.Po
|
||||
DIST_COMMON = README $(noinst_HEADERS) ChangeLog Makefile.am \
|
||||
Makefile.in TODO alloca.c atexit.c chown.c dup2.c error.c error.h \
|
||||
euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c getdate.c \
|
||||
getgroups.c gethostname.c getline.c getloadavg.c getpass.c \
|
||||
Makefile.in TODO __fpending.c alloca.c atexit.c chown.c dup2.c error.c \
|
||||
error.h euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c \
|
||||
getdate.c getgroups.c gethostname.c getline.c getloadavg.c getpass.c \
|
||||
getusershell.c group-member.c lchown.c malloc.c memchr.c memcmp.c \
|
||||
memcpy.c memmove.c memset.c mktime.c mountlist.c nanosleep.c obstack.c \
|
||||
obstack.h putenv.c readutmp.c realloc.c regex.c rmdir.c rpmatch.c \
|
||||
stime.c stpcpy.c strcasecmp.c strcspn.c strdup.c strftime.c \
|
||||
strncasecmp.c strndup.c strnlen.c strpbrk.c strstr.c strtod.c strtol.c \
|
||||
strtoul.c strtoull.c strtoumax.c strverscmp.c utime.c
|
||||
memcpy.c memmove.c memrchr.c memset.c mktime.c mountlist.c nanosleep.c \
|
||||
obstack.c obstack.h putenv.c readutmp.c realloc.c regex.c rename.c \
|
||||
rmdir.c rpmatch.c stime.c stpcpy.c strcasecmp.c strcspn.c strdup.c \
|
||||
strftime.c strncasecmp.c strndup.c strnlen.c strpbrk.c strstr.c \
|
||||
strtod.c strtol.c strtoul.c strtoull.c strtoumax.c strverscmp.c utime.c
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
@@ -251,7 +257,7 @@ OBJECTS = $(am_libfetish_a_OBJECTS)
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .sed .sin .y
|
||||
.SUFFIXES: .sed .sin .c .o .y
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnits lib/Makefile
|
||||
|
||||
@@ -298,6 +304,8 @@ libfetish.a: $(libfetish_a_OBJECTS) $(libfetish_a_DEPENDENCIES)
|
||||
-rm -f libfetish.a
|
||||
$(libfetish_a_AR) libfetish.a $(libfetish_a_OBJECTS) $(libfetish_a_LIBADD)
|
||||
$(RANLIB) libfetish.a
|
||||
__fpending_.c: __fpending.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/__fpending.c; then echo $(srcdir)/__fpending.c; else echo __fpending.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > __fpending_.c
|
||||
addext_.c: addext.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/addext.c; then echo $(srcdir)/addext.c; else echo addext.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > addext_.c
|
||||
alloca_.c: alloca.c $(ANSI2KNR)
|
||||
@@ -404,6 +412,8 @@ memcpy_.c: memcpy.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcpy_.c
|
||||
memmove_.c: memmove.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memmove.c; then echo $(srcdir)/memmove.c; else echo memmove.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memmove_.c
|
||||
memrchr_.c: memrchr.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memrchr.c; then echo $(srcdir)/memrchr.c; else echo memrchr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memrchr_.c
|
||||
memset_.c: memset.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memset_.c
|
||||
mktime_.c: mktime.c $(ANSI2KNR)
|
||||
@@ -418,6 +428,8 @@ obstack_.c: obstack.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/obstack.c; then echo $(srcdir)/obstack.c; else echo obstack.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > obstack_.c
|
||||
path-concat_.c: path-concat.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/path-concat.c; then echo $(srcdir)/path-concat.c; else echo path-concat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > path-concat_.c
|
||||
physmem_.c: physmem.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/physmem.c; then echo $(srcdir)/physmem.c; else echo physmem.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > physmem_.c
|
||||
posixtm_.c: posixtm.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/posixtm.c; then echo $(srcdir)/posixtm.c; else echo posixtm.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > posixtm_.c
|
||||
putenv_.c: putenv.c $(ANSI2KNR)
|
||||
@@ -434,6 +446,8 @@ realloc_.c: realloc.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > realloc_.c
|
||||
regex_.c: regex.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > regex_.c
|
||||
rename_.c: rename.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rename.c; then echo $(srcdir)/rename.c; else echo rename.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > rename_.c
|
||||
rmdir_.c: rmdir.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rmdir.c; then echo $(srcdir)/rmdir.c; else echo rmdir.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > rmdir_.c
|
||||
rpmatch_.c: rpmatch.c $(ANSI2KNR)
|
||||
@@ -446,6 +460,8 @@ save-cwd_.c: save-cwd.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/save-cwd.c; then echo $(srcdir)/save-cwd.c; else echo save-cwd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > save-cwd_.c
|
||||
savedir_.c: savedir.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/savedir.c; then echo $(srcdir)/savedir.c; else echo savedir.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > savedir_.c
|
||||
sha_.c: sha.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/sha.c; then echo $(srcdir)/sha.c; else echo sha.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > sha_.c
|
||||
stat_.c: stat.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stat_.c
|
||||
stime_.c: stime.c $(ANSI2KNR)
|
||||
@@ -510,22 +526,23 @@ xstrtoumax_.c: xstrtoumax.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtoumax.c; then echo $(srcdir)/xstrtoumax.c; else echo xstrtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtoumax_.c
|
||||
yesno_.c: yesno.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/yesno.c; then echo $(srcdir)/yesno.c; else echo yesno.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > yesno_.c
|
||||
addext_.o alloca_.o argmatch_.o atexit_.o backupfile_.o basename_.o \
|
||||
canon-host_.o chown_.o closeout_.o diacrit_.o dirname_.o dup2_.o \
|
||||
error_.o euidaccess_.o exclude_.o fileblocks_.o filemode_.o fnmatch_.o \
|
||||
fsusage_.o ftruncate_.o full-write_.o getdate_.o getgroups_.o \
|
||||
gethostname_.o getline_.o getloadavg_.o getopt_.o getopt1_.o getpass_.o \
|
||||
getstr_.o getugroups_.o getusershell_.o group-member_.o hard-locale_.o \
|
||||
hash_.o human_.o idcache_.o isdir_.o lchown_.o linebuffer_.o \
|
||||
localcharset_.o long-options_.o lstat_.o makepath_.o malloc_.o \
|
||||
mbswidth_.o md5_.o memcasecmp_.o memchr_.o memcmp_.o memcoll_.o \
|
||||
memcpy_.o memmove_.o memset_.o mktime_.o modechange_.o mountlist_.o \
|
||||
nanosleep_.o obstack_.o path-concat_.o posixtm_.o putenv_.o quote_.o \
|
||||
quotearg_.o readtokens_.o readutmp_.o realloc_.o regex_.o rmdir_.o \
|
||||
rpmatch_.o safe-read_.o same_.o save-cwd_.o savedir_.o stat_.o stime_.o \
|
||||
stpcpy_.o strcasecmp_.o strcspn_.o strdup_.o strftime_.o stripslash_.o \
|
||||
strncasecmp_.o strndup_.o strnlen_.o strpbrk_.o strstr_.o strtod_.o \
|
||||
strtol_.o strtoul_.o strtoull_.o strtoumax_.o strverscmp_.o \
|
||||
__fpending_.o addext_.o alloca_.o argmatch_.o atexit_.o backupfile_.o \
|
||||
basename_.o canon-host_.o chown_.o closeout_.o diacrit_.o dirname_.o \
|
||||
dup2_.o error_.o euidaccess_.o exclude_.o fileblocks_.o filemode_.o \
|
||||
fnmatch_.o fsusage_.o ftruncate_.o full-write_.o getdate_.o \
|
||||
getgroups_.o gethostname_.o getline_.o getloadavg_.o getopt_.o \
|
||||
getopt1_.o getpass_.o getstr_.o getugroups_.o getusershell_.o \
|
||||
group-member_.o hard-locale_.o hash_.o human_.o idcache_.o isdir_.o \
|
||||
lchown_.o linebuffer_.o localcharset_.o long-options_.o lstat_.o \
|
||||
makepath_.o malloc_.o mbswidth_.o md5_.o memcasecmp_.o memchr_.o \
|
||||
memcmp_.o memcoll_.o memcpy_.o memmove_.o memrchr_.o memset_.o \
|
||||
mktime_.o modechange_.o mountlist_.o nanosleep_.o obstack_.o \
|
||||
path-concat_.o physmem_.o posixtm_.o putenv_.o quote_.o quotearg_.o \
|
||||
readtokens_.o readutmp_.o realloc_.o regex_.o rename_.o rmdir_.o \
|
||||
rpmatch_.o safe-read_.o same_.o save-cwd_.o savedir_.o sha_.o stat_.o \
|
||||
stime_.o stpcpy_.o strcasecmp_.o strcspn_.o strdup_.o strftime_.o \
|
||||
stripslash_.o strncasecmp_.o strndup_.o strnlen_.o strpbrk_.o strstr_.o \
|
||||
strtod_.o strtol_.o strtoul_.o strtoull_.o strtoumax_.o strverscmp_.o \
|
||||
unicodeio_.o userspec_.o utime_.o version-etc_.o xgetcwd_.o \
|
||||
xgethostname_.o xmalloc_.o xstrdup_.o xstrtod_.o xstrtol_.o xstrtoul_.o \
|
||||
xstrtoumax_.o yesno_.o : $(ANSI2KNR)
|
||||
@@ -560,6 +577,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
|
||||
|
||||
GTAGS:
|
||||
here=`CDPATH=: && cd $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $$here
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
@@ -569,6 +591,7 @@ distclean-tags:
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
@AMDEP@include $(DEPDIR)/__fpending.Po
|
||||
@AMDEP@include $(DEPDIR)/addext$U.Po
|
||||
@AMDEP@include $(DEPDIR)/alloca.Po
|
||||
@AMDEP@include $(DEPDIR)/argmatch$U.Po
|
||||
@@ -622,6 +645,7 @@ maintainer-clean-tags:
|
||||
@AMDEP@include $(DEPDIR)/memcoll$U.Po
|
||||
@AMDEP@include $(DEPDIR)/memcpy.Po
|
||||
@AMDEP@include $(DEPDIR)/memmove.Po
|
||||
@AMDEP@include $(DEPDIR)/memrchr.Po
|
||||
@AMDEP@include $(DEPDIR)/memset.Po
|
||||
@AMDEP@include $(DEPDIR)/mktime.Po
|
||||
@AMDEP@include $(DEPDIR)/modechange$U.Po
|
||||
@@ -629,6 +653,7 @@ maintainer-clean-tags:
|
||||
@AMDEP@include $(DEPDIR)/nanosleep.Po
|
||||
@AMDEP@include $(DEPDIR)/obstack.Po
|
||||
@AMDEP@include $(DEPDIR)/path-concat$U.Po
|
||||
@AMDEP@include $(DEPDIR)/physmem$U.Po
|
||||
@AMDEP@include $(DEPDIR)/posixtm$U.Po
|
||||
@AMDEP@include $(DEPDIR)/putenv.Po
|
||||
@AMDEP@include $(DEPDIR)/quote$U.Po
|
||||
@@ -637,12 +662,14 @@ maintainer-clean-tags:
|
||||
@AMDEP@include $(DEPDIR)/readutmp.Po
|
||||
@AMDEP@include $(DEPDIR)/realloc.Po
|
||||
@AMDEP@include $(DEPDIR)/regex.Po
|
||||
@AMDEP@include $(DEPDIR)/rename.Po
|
||||
@AMDEP@include $(DEPDIR)/rmdir.Po
|
||||
@AMDEP@include $(DEPDIR)/rpmatch.Po
|
||||
@AMDEP@include $(DEPDIR)/safe-read$U.Po
|
||||
@AMDEP@include $(DEPDIR)/same$U.Po
|
||||
@AMDEP@include $(DEPDIR)/save-cwd$U.Po
|
||||
@AMDEP@include $(DEPDIR)/savedir$U.Po
|
||||
@AMDEP@include $(DEPDIR)/sha$U.Po
|
||||
@AMDEP@include $(DEPDIR)/stat.Po
|
||||
@AMDEP@include $(DEPDIR)/stime.Po
|
||||
@AMDEP@include $(DEPDIR)/stpcpy.Po
|
||||
@@ -716,6 +743,9 @@ check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
all-recursive-am: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
install-exec-am: install-exec-local
|
||||
install-exec: install-exec-am
|
||||
|
||||
@@ -780,12 +810,12 @@ maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
|
||||
maintainer-clean-kr tags mostlyclean-tags distclean-tags clean-tags \
|
||||
maintainer-clean-tags mostlyclean-depend distclean-depend clean-depend \
|
||||
maintainer-clean-depend distdir info-am info dvi-am dvi check check-am \
|
||||
installcheck-am installcheck install-exec-local install-exec-am \
|
||||
install-exec install-data-am install-data install-am install \
|
||||
uninstall-local uninstall-am uninstall all-local all-redirect all-am \
|
||||
all install-strip installdirs mostlyclean-generic distclean-generic \
|
||||
clean-generic maintainer-clean-generic clean mostlyclean distclean \
|
||||
maintainer-clean
|
||||
installcheck-am installcheck all-recursive-am install-exec-local \
|
||||
install-exec-am install-exec install-data-am install-data install-am \
|
||||
install uninstall-local uninstall-am uninstall all-local all-redirect \
|
||||
all-am all install-strip installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
lstat.c: xstat.in
|
||||
sed \
|
||||
|
||||
30
lib/__fpending.c
Normal file
30
lib/__fpending.c
Normal file
@@ -0,0 +1,30 @@
|
||||
/* __fpending.c -- return the number of pending output bytes on a stream
|
||||
Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Written by Jim Meyering. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "__fpending.h"
|
||||
|
||||
size_t
|
||||
__fpending (FILE *fp)
|
||||
{
|
||||
return PENDING_OUTPUT_N_BYTES;
|
||||
}
|
||||
18
lib/__fpending.h
Normal file
18
lib/__fpending.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if HAVE_STDIO_EXT_H
|
||||
# include <stdio_ext.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef HAVE_DECL___FPENDING
|
||||
"this configure-time declaration test was not run"
|
||||
#endif
|
||||
#if !HAVE_DECL___FPENDING
|
||||
size_t __fpending (FILE *);
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/* basename.c -- return the last element in a path
|
||||
Copyright (C) 1990, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1998, 1999, 2000, 2001 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
|
||||
@@ -19,6 +19,7 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifndef FILESYSTEM_PREFIX_LEN
|
||||
|
||||
@@ -43,6 +43,7 @@ extern int errno;
|
||||
#include "closeout.h"
|
||||
#include "error.h"
|
||||
#include "quotearg.h"
|
||||
#include "__fpending.h"
|
||||
|
||||
static int default_exit_status = EXIT_FAILURE;
|
||||
static const char *file_name;
|
||||
@@ -86,11 +87,15 @@ close_stdout_set_file_name (const char *file)
|
||||
It's important to detect such failures and exit nonzero because many
|
||||
tools (most notably `make' and other build-management systems) depend
|
||||
on being able to detect failure in other tools via their exit status. */
|
||||
|
||||
void
|
||||
close_stdout_status (int status)
|
||||
{
|
||||
int e = ferror (stdout) ? 0 : -1;
|
||||
|
||||
if (__fpending (stdout) == 0)
|
||||
return;
|
||||
|
||||
if (fclose (stdout) != 0)
|
||||
e = errno;
|
||||
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
#ifndef CLOSEOUT_H
|
||||
# define CLOSEOUT_H 1
|
||||
|
||||
# ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
void close_stdout_set_status PARAMS ((int status));
|
||||
void close_stdout_set_file_name PARAMS ((const char *file));
|
||||
void close_stdout PARAMS ((void));
|
||||
void close_stdout_status PARAMS ((int status));
|
||||
|
||||
#endif
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
# ASCII, ANSI_X3.4-1968 glibc solaris freebsd
|
||||
# ISO-8859-1 glibc aix hpux irix osf solaris freebsd yes
|
||||
# ISO-8859-2 glibc aix hpux irix solaris freebsd yes
|
||||
# ISO-8859-3 glibc yes
|
||||
# ISO-8859-4 solaris yes
|
||||
# ISO-8859-5 glibc aix hpux irix solaris yes
|
||||
# ISO-8859-6 glibc aix hpux solaris yes
|
||||
@@ -41,28 +42,41 @@
|
||||
# ISO-8859-8 glibc aix hpux solaris yes
|
||||
# ISO-8859-9 glibc aix hpux irix osf solaris yes
|
||||
# ISO-8859-13 glibc
|
||||
# ISO-8859-15 aix solaris freebsd
|
||||
# ISO-8859-15 glibc aix solaris freebsd
|
||||
# KOI8-R glibc solaris freebsd yes
|
||||
# KOI8-U glibc yes
|
||||
# CP850 aix osf
|
||||
# CP856 aix
|
||||
# CP866 freebsd
|
||||
# CP874 win32
|
||||
# CP922 aix
|
||||
# CP932 aix
|
||||
# CP932 aix win32
|
||||
# CP943 aix
|
||||
# CP949 win32
|
||||
# CP950 win32
|
||||
# CP1046 aix
|
||||
# CP1124 aix
|
||||
# CP1129 aix
|
||||
# CP1251 glibc
|
||||
# CP1252 aix
|
||||
# EUC-CN aix hpux irix solaris
|
||||
# EUC-JP aix hpux irix solaris yes
|
||||
# EUC-KR aix hpux irix solaris yes
|
||||
# EUC-TW aix hpux irix solaris
|
||||
# BIG5 aix hpux solaris yes
|
||||
# GBK aix
|
||||
# CP1250 win32
|
||||
# CP1251 glibc win32
|
||||
# CP1252 aix win32
|
||||
# CP1253 win32
|
||||
# CP1254 win32
|
||||
# CP1255 win32
|
||||
# CP1256 win32
|
||||
# CP1257 win32
|
||||
# GB2312 glibc aix hpux irix solaris yes
|
||||
# EUC-JP glibc aix hpux irix solaris yes
|
||||
# EUC-KR glibc aix hpux irix solaris yes
|
||||
# EUC-TW glibc aix hpux irix solaris
|
||||
# BIG5 glibc aix hpux solaris yes
|
||||
# BIG5HKSCS glibc
|
||||
# GBK aix win32
|
||||
# GB18030 glibc
|
||||
# SJIS hpux solaris
|
||||
# TIS-620 aix hpux solaris
|
||||
# JOHAB glibc win32
|
||||
# TIS-620 glibc aix hpux solaris
|
||||
# VISCII glibc yes
|
||||
# HP-ROMAN8 hpux
|
||||
# HP-ARABIC8 hpux
|
||||
# HP-GREEK8 hpux
|
||||
@@ -117,7 +131,7 @@ case "$os" in
|
||||
echo "IBM-1124 CP1124"
|
||||
echo "IBM-1129 CP1129"
|
||||
echo "IBM-1252 CP1252"
|
||||
echo "IBM-eucCN EUC-CN"
|
||||
echo "IBM-eucCN GB2312"
|
||||
echo "IBM-eucJP EUC-JP"
|
||||
echo "IBM-eucKR EUC-KR"
|
||||
echo "IBM-eucTW EUC-TW"
|
||||
@@ -146,7 +160,7 @@ case "$os" in
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "eucTW EUC-TW"
|
||||
echo "hp15CN EUC-CN"
|
||||
echo "hp15CN GB2312"
|
||||
#echo "ccdc ?" # what is this?
|
||||
echo "SJIS SJIS"
|
||||
echo "utf8 UTF-8"
|
||||
@@ -157,7 +171,7 @@ case "$os" in
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "eucCN EUC-CN"
|
||||
echo "eucCN GB2312"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "eucTW EUC-TW"
|
||||
@@ -181,7 +195,7 @@ case "$os" in
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "koi8-r KOI8-R"
|
||||
echo "BIG5 BIG5"
|
||||
echo "gb2312 EUC-CN"
|
||||
echo "gb2312 GB2312"
|
||||
echo "cns11643 EUC-TW"
|
||||
echo "5601 EUC-KR"
|
||||
echo "eucJP EUC-JP"
|
||||
@@ -213,4 +227,8 @@ case "$os" in
|
||||
echo "$l.CP866 CP866"
|
||||
done
|
||||
;;
|
||||
beos*)
|
||||
# BeOS has a single locale, and it has UTF-8 encoding.
|
||||
echo "C UTF-8"
|
||||
;;
|
||||
esac
|
||||
|
||||
154
lib/dirname.c
154
lib/dirname.c
@@ -34,72 +34,156 @@ char *malloc ();
|
||||
#endif
|
||||
#include <assert.h>
|
||||
|
||||
#ifndef HAVE_DECL_MEMRCHR
|
||||
"this configure-time declaration test was not run"
|
||||
#endif
|
||||
#if !HAVE_DECL_MEMRCHR
|
||||
void *memrchr ();
|
||||
#endif
|
||||
|
||||
#include "dirname.h"
|
||||
|
||||
#ifndef FILESYSTEM_PREFIX_LEN
|
||||
# define FILESYSTEM_PREFIX_LEN(Filename) 0
|
||||
#endif
|
||||
|
||||
#ifndef ISSLASH
|
||||
# define ISSLASH(C) ((C) == '/')
|
||||
#endif
|
||||
|
||||
#define BACKSLASH_IS_PATH_SEPARATOR ISSLASH ('\\')
|
||||
|
||||
/* Return the leading directories part of PATH,
|
||||
allocated with malloc. If out of memory, return 0.
|
||||
Assumes that trailing slashes have already been
|
||||
removed. */
|
||||
|
||||
char *
|
||||
dir_name (const char *path)
|
||||
/* Return the length of `dirname (PATH)' and set *RESULT to point
|
||||
to PATH or to `"."', as appropriate. Works properly even if
|
||||
there are trailing slashes (by effectively ignoring them).
|
||||
WARNING: This function doesn't work for cwd-relative names like
|
||||
`a:foo' that are specified with a drive-letter prefix. That case
|
||||
is handled in the caller. */
|
||||
static size_t
|
||||
dir_name_r (char const *path, char const **result)
|
||||
{
|
||||
char *newpath;
|
||||
char *slash;
|
||||
int length; /* Length of result, not including NUL. */
|
||||
char const *slash;
|
||||
size_t length; /* Length of result, not including NUL. */
|
||||
|
||||
slash = strrchr (path, '/');
|
||||
if (BACKSLASH_IS_PATH_SEPARATOR)
|
||||
{
|
||||
char *b = strrchr (path, '\\');
|
||||
char const *b = strrchr (path, '\\');
|
||||
if (b && slash < b)
|
||||
slash = b;
|
||||
}
|
||||
|
||||
/* Make sure there are no trailing slashes. */
|
||||
assert (slash == NULL /* There are no slashes in PATH. */
|
||||
|| slash[1] != 0 /* There is a non-NUL byte after the last slash. */
|
||||
|| path == slash /* PATH is just `/'. */
|
||||
);
|
||||
/* If the last byte of PATH is a slash, decrement SLASH until it's
|
||||
pointing at the leftmost in a sequence of trailing slashes. */
|
||||
if (slash && slash[1] == 0)
|
||||
{
|
||||
while (path < slash && ISSLASH (slash[-1]))
|
||||
{
|
||||
--slash;
|
||||
}
|
||||
|
||||
if (path < slash)
|
||||
{
|
||||
size_t len = slash - path;
|
||||
slash = memrchr (path, '/', len);
|
||||
if (BACKSLASH_IS_PATH_SEPARATOR)
|
||||
{
|
||||
char const *b = memrchr (path, '\\', len);
|
||||
if (b && slash < b)
|
||||
slash = b;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (slash == 0)
|
||||
{
|
||||
/* File is in the current directory. */
|
||||
path = ".";
|
||||
length = 1;
|
||||
|
||||
length = FILESYSTEM_PREFIX_LEN (path);
|
||||
|
||||
if (length == 0)
|
||||
{
|
||||
path = ".";
|
||||
length = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Remove any trailing slashes from the result. */
|
||||
if (BACKSLASH_IS_PATH_SEPARATOR)
|
||||
{
|
||||
const char *lim = ((path[0] >= 'A' && path[0] <= 'z'
|
||||
&& path[1] == ':')
|
||||
? path + 2 : path);
|
||||
/* Remove any trailing slashes from the result. If we have a
|
||||
canonicalized "d:/path", leave alone the root case "d:/". */
|
||||
char const *lim = path + FILESYSTEM_PREFIX_LEN (path);
|
||||
|
||||
/* If canonicalized "d:/path", leave alone the root case "d:/". */
|
||||
while (slash > lim && ISSLASH (*slash))
|
||||
--slash;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (slash > path && ISSLASH (*slash))
|
||||
--slash;
|
||||
}
|
||||
while (lim < slash && ISSLASH (*slash))
|
||||
--slash;
|
||||
|
||||
length = slash - path + 1;
|
||||
}
|
||||
|
||||
newpath = (char *) malloc (length + 1);
|
||||
*result = path;
|
||||
return length;
|
||||
}
|
||||
|
||||
/* Return the leading directories part of PATH,
|
||||
allocated with malloc. If out of memory, return 0.
|
||||
Works properly even if there are trailing slashes
|
||||
(by effectively ignoring them). */
|
||||
|
||||
char *
|
||||
dir_name (char const *path)
|
||||
{
|
||||
char const *result;
|
||||
size_t length = dir_name_r (path, &result);
|
||||
int append_dot = (length && length == FILESYSTEM_PREFIX_LEN (newpath));
|
||||
char *newpath = (char *) malloc (length + append_dot + 1);
|
||||
if (newpath == 0)
|
||||
return 0;
|
||||
strncpy (newpath, path, length);
|
||||
strncpy (newpath, result, length);
|
||||
/* If PATH is "d:foo", return "d:.", the CWD on drive d: */
|
||||
if (append_dot)
|
||||
newpath[length++] = '.';
|
||||
newpath[length] = 0;
|
||||
return newpath;
|
||||
}
|
||||
|
||||
#ifdef TEST_DIRNAME
|
||||
/*
|
||||
|
||||
Run the test like this (expect no output):
|
||||
gcc -DHAVE_CONFIG_H -DTEST_DIRNAME -I.. -O -Wall memrchr.c dirname.c
|
||||
sed -n '/^BEGIN-DATA$/,/^END-DATA$/p' dirname.c|grep -v DATA|./a.out
|
||||
|
||||
BEGIN-DATA
|
||||
foo//// .
|
||||
bar/foo//// bar
|
||||
foo/ .
|
||||
/ /
|
||||
. .
|
||||
a .
|
||||
END-DATA
|
||||
|
||||
*/
|
||||
|
||||
# define MAX_BUFF_LEN 1024
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
char buff[MAX_BUFF_LEN + 1];
|
||||
|
||||
buff[MAX_BUFF_LEN] = 0;
|
||||
while (fgets (buff, MAX_BUFF_LEN, stdin) && buff[0])
|
||||
{
|
||||
char path[MAX_BUFF_LEN];
|
||||
char expected_result[MAX_BUFF_LEN];
|
||||
char const *result;
|
||||
sscanf (buff, "%s %s", path, expected_result);
|
||||
result = dir_name (path);
|
||||
if (strcmp (result, expected_result))
|
||||
printf ("%s: got %s, expected %s\n", path, result, expected_result);
|
||||
}
|
||||
exit (0);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
10
lib/error.c
10
lib/error.c
@@ -1,5 +1,5 @@
|
||||
/* Error handler for noninteractive utilities
|
||||
Copyright (C) 1990-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990-1998, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
@@ -26,6 +26,9 @@
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#if HAVE_LIBINTL_H
|
||||
# include <libintl.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
|
||||
# if __STDC__
|
||||
@@ -83,6 +86,11 @@ unsigned int error_message_count;
|
||||
# define error __error
|
||||
# define error_at_line __error_at_line
|
||||
|
||||
# ifdef USE_IN_LIBIO
|
||||
# include <libio/iolibio.h>
|
||||
# define fflush(s) _IO_fflush (s)
|
||||
# endif
|
||||
|
||||
#else /* not _LIBC */
|
||||
|
||||
/* The calling program should define program_name and set it to the
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Declaration for error-reporting function
|
||||
Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
/* Copyright 1991, 1992, 1993, 1996, 1997, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -27,30 +27,18 @@
|
||||
#include <fnmatch.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if defined STDC_HEADERS || !defined isascii
|
||||
# define IN_CTYPE_DOMAIN(c) 1
|
||||
#else
|
||||
# define IN_CTYPE_DOMAIN(c) isascii (c)
|
||||
#endif
|
||||
|
||||
/* 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__
|
||||
#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
|
||||
|
||||
|
||||
# if defined STDC_HEADERS || !defined isascii
|
||||
# define ISASCII(c) 1
|
||||
# else
|
||||
# define ISASCII(c) isascii(c)
|
||||
# endif
|
||||
|
||||
# define ISUPPER(c) (ISASCII (c) && isupper (c))
|
||||
|
||||
|
||||
# ifndef errno
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Match STRING against the filename pattern PATTERN, returning zero if
|
||||
it matches, nonzero if not. */
|
||||
@@ -61,7 +49,9 @@ fnmatch (const char *pattern, const char *string, int flags)
|
||||
register char c;
|
||||
|
||||
/* Note that this evaluates C many times. */
|
||||
# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
|
||||
#define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER ((unsigned char) (c)) \
|
||||
? tolower ((unsigned char) (c)) \
|
||||
: (c))
|
||||
|
||||
while ((c = *p++) != '\0')
|
||||
{
|
||||
@@ -99,13 +89,10 @@ fnmatch (const char *pattern, const char *string, int flags)
|
||||
|
||||
for (c = *p++; c == '?' || c == '*'; c = *p++)
|
||||
{
|
||||
if ((flags & FNM_FILE_NAME) && *n == '/')
|
||||
/* A slash does not match a wildcard under FNM_FILE_NAME. */
|
||||
return FNM_NOMATCH;
|
||||
else if (c == '?')
|
||||
if (c == '?')
|
||||
{
|
||||
/* A ? needs to match one character. */
|
||||
if (*n == '\0')
|
||||
if (*n == '\0' || (*n == '/' && (flags & FNM_FILE_NAME)))
|
||||
/* There isn't another character; no match. */
|
||||
return FNM_NOMATCH;
|
||||
else
|
||||
@@ -117,7 +104,13 @@ fnmatch (const char *pattern, const char *string, int flags)
|
||||
}
|
||||
|
||||
if (c == '\0')
|
||||
return 0;
|
||||
{
|
||||
if ((flags & (FNM_FILE_NAME | FNM_LEADING_DIR)) == FNM_FILE_NAME)
|
||||
for (; *n != '\0'; n++)
|
||||
if (*n == '/')
|
||||
return FNM_NOMATCH;
|
||||
return 0;
|
||||
}
|
||||
|
||||
{
|
||||
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
|
||||
@@ -126,6 +119,8 @@ fnmatch (const char *pattern, const char *string, int flags)
|
||||
if ((c == '[' || FOLD (*n) == c1) &&
|
||||
fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
|
||||
return 0;
|
||||
else if (*n == '/' && (flags & FNM_FILE_NAME))
|
||||
break;
|
||||
return FNM_NOMATCH;
|
||||
}
|
||||
|
||||
@@ -231,7 +226,5 @@ fnmatch (const char *pattern, const char *string, int flags)
|
||||
|
||||
return FNM_NOMATCH;
|
||||
|
||||
# undef FOLD
|
||||
#undef FOLD
|
||||
}
|
||||
|
||||
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1995, 1997, 1999, 2000 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995, 1997, 1999 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
24
lib/getopt.c
24
lib/getopt.c
@@ -27,13 +27,13 @@
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#else
|
||||
# if !defined __STDC__ || !__STDC__
|
||||
#endif
|
||||
|
||||
#if !defined __STDC__ || !__STDC__
|
||||
/* This is a separate conditional since some stdc systems
|
||||
reject `defined (const)'. */
|
||||
# ifndef const
|
||||
# define const
|
||||
# endif
|
||||
# ifndef const
|
||||
# define const
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -75,11 +75,12 @@
|
||||
#endif
|
||||
|
||||
#ifndef _
|
||||
/* This is for other GNU distributions with internationalized messages.
|
||||
When compiling libc, the _ macro is predefined. */
|
||||
# ifdef HAVE_LIBINTL_H
|
||||
/* This is for other GNU distributions with internationalized messages. */
|
||||
# if defined HAVE_LIBINTL_H || defined _LIBC
|
||||
# include <libintl.h>
|
||||
# define _(msgid) gettext (msgid)
|
||||
# ifndef _
|
||||
# define _(msgid) gettext (msgid)
|
||||
# endif
|
||||
# else
|
||||
# define _(msgid) (msgid)
|
||||
# endif
|
||||
@@ -671,7 +672,10 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
pfound = p;
|
||||
indfound = option_index;
|
||||
}
|
||||
else
|
||||
else if (long_only
|
||||
|| pfound->has_arg != p->has_arg
|
||||
|| pfound->flag != p->flag
|
||||
|| pfound->val != p->val)
|
||||
/* Second or later nonexact match found. */
|
||||
ambig = 1;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,10 @@
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#else
|
||||
#endif
|
||||
|
||||
#include "getopt.h"
|
||||
|
||||
#if !defined __STDC__ || !__STDC__
|
||||
/* This is a separate conditional since some stdc systems
|
||||
reject `defined (const)'. */
|
||||
@@ -28,9 +31,6 @@
|
||||
#define const
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "getopt.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
@@ -22,11 +22,19 @@
|
||||
#endif
|
||||
|
||||
#ifndef SHELLS_FILE
|
||||
# ifndef __DJGPP__
|
||||
/* File containing a list of nonrestricted shells, one per line. */
|
||||
# define SHELLS_FILE "/etc/shells"
|
||||
# define SHELLS_FILE "/etc/shells"
|
||||
# else
|
||||
/* This is a horrible kludge. Isn't there a better way? */
|
||||
# define SHELLS_FILE "/dev/env/DJDIR/etc/shells"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include "xalloc.h"
|
||||
|
||||
@@ -40,9 +48,17 @@
|
||||
|
||||
static int readname ();
|
||||
|
||||
#if ! defined ADDITIONAL_DEFAULT_SHELLS && defined __MSDOS__
|
||||
# define ADDITIONAL_DEFAULT_SHELLS \
|
||||
"c:/dos/command.com", "c:/windows/command.com", "c:/command.com",
|
||||
#else
|
||||
# define ADDITIONAL_DEFAULT_SHELLS /* empty */
|
||||
#endif
|
||||
|
||||
/* List of shells to use if the shells file is missing. */
|
||||
static char const* const default_shells[] =
|
||||
{
|
||||
ADDITIONAL_DEFAULT_SHELLS
|
||||
"/bin/sh", "/bin/csh", "/usr/bin/sh", "/usr/bin/csh", NULL
|
||||
};
|
||||
|
||||
@@ -100,10 +116,8 @@ void
|
||||
setusershell ()
|
||||
{
|
||||
default_index = 0;
|
||||
if (shellstream == NULL)
|
||||
shellstream = fopen (SHELLS_FILE, "r");
|
||||
else
|
||||
fseek (shellstream, 0L, 0);
|
||||
if (shellstream)
|
||||
rewind (shellstream);
|
||||
}
|
||||
|
||||
/* Close the shells file. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* hash - hashing table processing.
|
||||
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
|
||||
Written by Jim Meyering, 1992.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -263,11 +263,12 @@ hash_get_first (const Hash_table *table)
|
||||
return bucket->data;
|
||||
|
||||
assert (0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Return the user data for the entry following ENTRY, where ENTRY has been
|
||||
returned by a previous call to either `hash_get_first' or `hash_get_next'.
|
||||
Return NULL if there is no more entries. */
|
||||
Return NULL if there are no more entries. */
|
||||
|
||||
void *
|
||||
hash_get_next (const Hash_table *table, const void *entry)
|
||||
@@ -284,7 +285,7 @@ hash_get_next (const Hash_table *table, const void *entry)
|
||||
return cursor->next->data;
|
||||
|
||||
/* Find first entry in any subsequent bucket. */
|
||||
for (; bucket < table->bucket_limit; bucket++)
|
||||
while (++bucket < table->bucket_limit)
|
||||
if (bucket->data)
|
||||
return bucket->data;
|
||||
|
||||
@@ -422,7 +423,7 @@ is_prime (unsigned long candidate)
|
||||
divisor++;
|
||||
}
|
||||
|
||||
return candidate % divisor != 0;
|
||||
return (candidate % divisor ? true : false);
|
||||
}
|
||||
|
||||
/* Round a given CANDIDATE number up to the nearest prime, and return that
|
||||
|
||||
@@ -37,12 +37,22 @@
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LANGINFO_CODESET
|
||||
# include <langinfo.h>
|
||||
#else
|
||||
# if HAVE_SETLOCALE
|
||||
# include <locale.h>
|
||||
#if defined _WIN32 || defined __WIN32__
|
||||
# undef WIN32 /* avoid warning on mingw32 */
|
||||
# define WIN32
|
||||
#endif
|
||||
|
||||
#ifndef WIN32
|
||||
# if HAVE_LANGINFO_CODESET
|
||||
# include <langinfo.h>
|
||||
# else
|
||||
# if HAVE_SETLOCALE
|
||||
# include <locale.h>
|
||||
# endif
|
||||
# endif
|
||||
#else /* WIN32 */
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef DIRECTORY_SEPARATOR
|
||||
@@ -73,6 +83,7 @@ get_charset_aliases ()
|
||||
cp = charset_aliases;
|
||||
if (cp == NULL)
|
||||
{
|
||||
#ifndef WIN32
|
||||
FILE *fp;
|
||||
const char *dir = LIBDIR;
|
||||
const char *base = "charset.alias";
|
||||
@@ -157,9 +168,20 @@ get_charset_aliases ()
|
||||
}
|
||||
}
|
||||
|
||||
charset_aliases = cp;
|
||||
if (file_name != NULL)
|
||||
free (file_name);
|
||||
|
||||
#else /* WIN32 */
|
||||
|
||||
/* To avoid the troubles of installing a separate file in the same
|
||||
directory as the DLL and of retrieving the DLL's directory at
|
||||
runtime, simply inline the aliases here. */
|
||||
|
||||
cp = "CP936" "\0" "GBK" "\0"
|
||||
"CP1361" "\0" "JOHAB" "\0";
|
||||
#endif
|
||||
|
||||
charset_aliases = cp;
|
||||
}
|
||||
|
||||
return cp;
|
||||
@@ -180,19 +202,21 @@ locale_charset ()
|
||||
const char *codeset;
|
||||
const char *aliases;
|
||||
|
||||
#if HAVE_LANGINFO_CODESET
|
||||
#ifndef WIN32
|
||||
|
||||
# if HAVE_LANGINFO_CODESET
|
||||
|
||||
/* Most systems support nl_langinfo (CODESET) nowadays. */
|
||||
codeset = nl_langinfo (CODESET);
|
||||
|
||||
#else
|
||||
# else
|
||||
|
||||
/* On old systems which lack it, use setlocale and getenv. */
|
||||
const char *locale = NULL;
|
||||
|
||||
# if HAVE_SETLOCALE
|
||||
# if HAVE_SETLOCALE
|
||||
locale = setlocale (LC_CTYPE, NULL);
|
||||
# endif
|
||||
# endif
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
{
|
||||
locale = getenv ("LC_ALL");
|
||||
@@ -209,6 +233,16 @@ locale_charset ()
|
||||
through the charset.alias file. */
|
||||
codeset = locale;
|
||||
|
||||
# endif
|
||||
|
||||
#else /* WIN32 */
|
||||
|
||||
static char buf[2 + 10 + 1];
|
||||
|
||||
/* Win32 has a function returning the locale's codepage as a number. */
|
||||
sprintf (buf, "CP%u", GetACP ());
|
||||
codeset = buf;
|
||||
|
||||
#endif
|
||||
|
||||
if (codeset != NULL && codeset[0] != '\0')
|
||||
|
||||
@@ -148,10 +148,10 @@ void strip_trailing_slashes ();
|
||||
function creates DIR and to zero otherwise. Give a diagnostic and
|
||||
return non-zero if DIR cannot be created or cannot be determined to
|
||||
exist already. Use DIRPATH in any diagnostic, not DIR.
|
||||
Note that if DIR already exists, this function will return zero
|
||||
(indicating success) and will set *CREATED_DIR_P to zero. */
|
||||
Note that if DIR already exists, this function returns zero
|
||||
(indicating success) and sets *CREATED_DIR_P to zero. */
|
||||
|
||||
static int
|
||||
int
|
||||
make_dir (const char *dir, const char *dirpath, mode_t mode, int *created_dir_p)
|
||||
{
|
||||
int fail = 0;
|
||||
|
||||
@@ -14,3 +14,9 @@ make_path PARAMS ((const char *_argpath,
|
||||
gid_t _group,
|
||||
int _preserve_existing,
|
||||
const char *_verbose_fmt_string));
|
||||
|
||||
int
|
||||
make_dir PARAMS ((const char *dir,
|
||||
const char *dirpath,
|
||||
mode_t mode,
|
||||
int *created_dir_p));
|
||||
|
||||
@@ -74,15 +74,13 @@ int wcwidth ();
|
||||
|
||||
/* Get ISPRINT. */
|
||||
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
|
||||
/* Undefine to protect against the definition in wctype.h of solaris2.6. */
|
||||
# undef ISASCII
|
||||
# define ISASCII(c) 1
|
||||
# define IN_CTYPE_DOMAIN(c) 1
|
||||
#else
|
||||
# define ISASCII(c) isascii (c)
|
||||
# define IN_CTYPE_DOMAIN(c) isascii(c)
|
||||
#endif
|
||||
/* Undefine to protect against the definition in wctype.h of solaris2.6. */
|
||||
#undef ISPRINT
|
||||
#define ISPRINT(c) (ISASCII (c) && isprint (c))
|
||||
#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
|
||||
|
||||
#include "mbswidth.h"
|
||||
|
||||
@@ -155,7 +153,11 @@ mbsnwidth (const char *string, size_t nbytes, int flags)
|
||||
/* An invalid multibyte sequence was encountered. */
|
||||
{
|
||||
if (flags & MBSW_ACCEPT_INVALID)
|
||||
break;
|
||||
{
|
||||
p++;
|
||||
width++;
|
||||
break;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
@@ -164,7 +166,11 @@ mbsnwidth (const char *string, size_t nbytes, int flags)
|
||||
/* An incomplete multibyte character at the end. */
|
||||
{
|
||||
if (flags & MBSW_ACCEPT_INVALID)
|
||||
break;
|
||||
{
|
||||
p = plimit;
|
||||
width++;
|
||||
break;
|
||||
}
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
11
lib/md5.c
11
lib/md5.c
@@ -304,19 +304,16 @@ md5_process_block (buffer, len, ctx)
|
||||
{ \
|
||||
a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \
|
||||
++words; \
|
||||
CYCLIC (a, s); \
|
||||
a = rol (a, s); \
|
||||
a += b; \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* It is unfortunate that C does not provide an operator for
|
||||
cyclic rotation. Hope the C compiler is smart enough. */
|
||||
#define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s)))
|
||||
|
||||
/* Before we start, one word to the strange constants.
|
||||
They are defined in RFC 1321 as
|
||||
|
||||
T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64
|
||||
T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64, or
|
||||
perl -e 'foreach(1..64){printf "0x%08x\n", int (4294967296 * abs (sin $_))}'
|
||||
*/
|
||||
|
||||
/* Round 1. */
|
||||
@@ -345,7 +342,7 @@ md5_process_block (buffer, len, ctx)
|
||||
do \
|
||||
{ \
|
||||
a += f (b, c, d) + correct_words[k] + T; \
|
||||
CYCLIC (a, s); \
|
||||
a = rol (a, s); \
|
||||
a += b; \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
15
lib/md5.h
15
lib/md5.h
@@ -143,4 +143,19 @@ extern int md5_stream __P ((FILE *stream, void *resblock));
|
||||
digest. */
|
||||
extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock));
|
||||
|
||||
/* The following is from gnupg-1.0.2's cipher/bithelp.h. */
|
||||
/* Rotate a 32 bit integer by n bytes */
|
||||
#if defined __GNUC__ && defined __i386__
|
||||
static inline md5_uint32
|
||||
rol(md5_uint32 x, int n)
|
||||
{
|
||||
__asm__("roll %%cl,%0"
|
||||
:"=r" (x)
|
||||
:"0" (x),"c" (n));
|
||||
return x;
|
||||
}
|
||||
#else
|
||||
# define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) )
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
31
lib/memchr.c
31
lib/memchr.c
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1993, 1997, 1999 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991,93,96,97,99,2000 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);
|
||||
@@ -34,11 +34,18 @@ USA. */
|
||||
# define __ptr_t char *
|
||||
#endif /* C++ or ANSI C. */
|
||||
|
||||
#if defined (_LIBC)
|
||||
#if defined _LIBC
|
||||
# include <string.h>
|
||||
# include <memcopy.h>
|
||||
#else
|
||||
# define reg_char char
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_LIMITS_H) || defined (_LIBC)
|
||||
#if HAVE_STDLIB_H || defined _LIBC
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LIMITS_H || defined _LIBC
|
||||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
@@ -49,21 +56,28 @@ USA. */
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#if HAVE_BP_SYM_H || defined _LIBC
|
||||
# include <bp-sym.h>
|
||||
#else
|
||||
# define BP_SYM(sym) sym
|
||||
#endif
|
||||
|
||||
#undef memchr
|
||||
#undef __memchr
|
||||
|
||||
/* Search no more than N bytes of S for C. */
|
||||
|
||||
__ptr_t
|
||||
memchr (s, c, n)
|
||||
__memchr (s, c_in, n)
|
||||
const __ptr_t s;
|
||||
int c;
|
||||
int c_in;
|
||||
size_t n;
|
||||
{
|
||||
const unsigned char *char_ptr;
|
||||
const unsigned long int *longword_ptr;
|
||||
unsigned long int longword, magic_bits, charmask;
|
||||
unsigned reg_char c;
|
||||
|
||||
c = (unsigned char) c;
|
||||
c = (unsigned char) c_in;
|
||||
|
||||
/* Handle the first few characters by reading one character at a time.
|
||||
Do this until CHAR_PTR is aligned on a longword boundary. */
|
||||
@@ -197,3 +211,6 @@ memchr (s, c, n)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (__memchr, BP_SYM (memchr))
|
||||
#endif
|
||||
|
||||
@@ -49,6 +49,11 @@
|
||||
#ifdef _LIBC
|
||||
|
||||
# include <memcopy.h>
|
||||
# include <endian.h>
|
||||
|
||||
# if __BYTE_ORDER == __BIG_ENDIAN
|
||||
# define WORDS_BIGENDIAN
|
||||
# endif
|
||||
|
||||
#else /* Not in the GNU C library. */
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#if HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
209
lib/memrchr.c
Normal file
209
lib/memrchr.c
Normal file
@@ -0,0 +1,209 @@
|
||||
/* memrchr -- find the last occurrence of a byte in a memory block
|
||||
Copyright (C) 1991, 93, 96, 97, 99, 2000 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),
|
||||
and implemented by Roland McGrath (roland@ai.mit.edu).
|
||||
|
||||
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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#undef __ptr_t
|
||||
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
|
||||
# define __ptr_t void *
|
||||
#else /* Not C++ or ANSI C. */
|
||||
# define __ptr_t char *
|
||||
#endif /* C++ or ANSI C. */
|
||||
|
||||
#if defined (_LIBC)
|
||||
# include <string.h>
|
||||
# include <memcopy.h>
|
||||
#else
|
||||
# define reg_char char
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_LIMITS_H) || defined (_LIBC)
|
||||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
#define LONG_MAX_32_BITS 2147483647
|
||||
|
||||
#ifndef LONG_MAX
|
||||
# define LONG_MAX LONG_MAX_32_BITS
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#undef __memrchr
|
||||
#undef memrchr
|
||||
|
||||
#ifndef weak_alias
|
||||
# define __memrchr memrchr
|
||||
#endif
|
||||
|
||||
/* Search no more than N bytes of S for C. */
|
||||
__ptr_t
|
||||
__memrchr (s, c_in, n)
|
||||
const __ptr_t s;
|
||||
int c_in;
|
||||
size_t n;
|
||||
{
|
||||
const unsigned char *char_ptr;
|
||||
const unsigned long int *longword_ptr;
|
||||
unsigned long int longword, magic_bits, charmask;
|
||||
unsigned reg_char c;
|
||||
|
||||
c = (unsigned char) c_in;
|
||||
|
||||
/* Handle the last few characters by reading one character at a time.
|
||||
Do this until CHAR_PTR is aligned on a longword boundary. */
|
||||
for (char_ptr = (const unsigned char *) s + n;
|
||||
n > 0 && ((unsigned long int) char_ptr
|
||||
& (sizeof (longword) - 1)) != 0;
|
||||
--n)
|
||||
if (*--char_ptr == c)
|
||||
return (__ptr_t) char_ptr;
|
||||
|
||||
/* All these elucidatory comments refer to 4-byte longwords,
|
||||
but the theory applies equally well to 8-byte longwords. */
|
||||
|
||||
longword_ptr = (unsigned long int *) char_ptr;
|
||||
|
||||
/* Bits 31, 24, 16, and 8 of this number are zero. Call these bits
|
||||
the "holes." Note that there is a hole just to the left of
|
||||
each byte, with an extra at the end:
|
||||
|
||||
bits: 01111110 11111110 11111110 11111111
|
||||
bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD
|
||||
|
||||
The 1-bits make sure that carries propagate to the next 0-bit.
|
||||
The 0-bits provide holes for carries to fall into. */
|
||||
|
||||
if (sizeof (longword) != 4 && sizeof (longword) != 8)
|
||||
abort ();
|
||||
|
||||
#if LONG_MAX <= LONG_MAX_32_BITS
|
||||
magic_bits = 0x7efefeff;
|
||||
#else
|
||||
magic_bits = ((unsigned long int) 0x7efefefe << 32) | 0xfefefeff;
|
||||
#endif
|
||||
|
||||
/* Set up a longword, each of whose bytes is C. */
|
||||
charmask = c | (c << 8);
|
||||
charmask |= charmask << 16;
|
||||
#if LONG_MAX > LONG_MAX_32_BITS
|
||||
charmask |= charmask << 32;
|
||||
#endif
|
||||
|
||||
/* Instead of the traditional loop which tests each character,
|
||||
we will test a longword at a time. The tricky part is testing
|
||||
if *any of the four* bytes in the longword in question are zero. */
|
||||
while (n >= sizeof (longword))
|
||||
{
|
||||
/* We tentatively exit the loop if adding MAGIC_BITS to
|
||||
LONGWORD fails to change any of the hole bits of LONGWORD.
|
||||
|
||||
1) Is this safe? Will it catch all the zero bytes?
|
||||
Suppose there is a byte with all zeros. Any carry bits
|
||||
propagating from its left will fall into the hole at its
|
||||
least significant bit and stop. Since there will be no
|
||||
carry from its most significant bit, the LSB of the
|
||||
byte to the left will be unchanged, and the zero will be
|
||||
detected.
|
||||
|
||||
2) Is this worthwhile? Will it ignore everything except
|
||||
zero bytes? Suppose every byte of LONGWORD has a bit set
|
||||
somewhere. There will be a carry into bit 8. If bit 8
|
||||
is set, this will carry into bit 16. If bit 8 is clear,
|
||||
one of bits 9-15 must be set, so there will be a carry
|
||||
into bit 16. Similarly, there will be a carry into bit
|
||||
24. If one of bits 24-30 is set, there will be a carry
|
||||
into bit 31, so all of the hole bits will be changed.
|
||||
|
||||
The one misfire occurs when bits 24-30 are clear and bit
|
||||
31 is set; in this case, the hole at bit 31 is not
|
||||
changed. If we had access to the processor carry flag,
|
||||
we could close this loophole by putting the fourth hole
|
||||
at bit 32!
|
||||
|
||||
So it ignores everything except 128's, when they're aligned
|
||||
properly.
|
||||
|
||||
3) But wait! Aren't we looking for C, not zero?
|
||||
Good point. So what we do is XOR LONGWORD with a longword,
|
||||
each of whose bytes is C. This turns each byte that is C
|
||||
into a zero. */
|
||||
|
||||
longword = *--longword_ptr ^ charmask;
|
||||
|
||||
/* Add MAGIC_BITS to LONGWORD. */
|
||||
if ((((longword + magic_bits)
|
||||
|
||||
/* Set those bits that were unchanged by the addition. */
|
||||
^ ~longword)
|
||||
|
||||
/* Look at only the hole bits. If any of the hole bits
|
||||
are unchanged, most likely one of the bytes was a
|
||||
zero. */
|
||||
& ~magic_bits) != 0)
|
||||
{
|
||||
/* Which of the bytes was C? If none of them were, it was
|
||||
a misfire; continue the search. */
|
||||
|
||||
const unsigned char *cp = (const unsigned char *) longword_ptr;
|
||||
|
||||
#if LONG_MAX > 2147483647
|
||||
if (cp[7] == c)
|
||||
return (__ptr_t) &cp[7];
|
||||
if (cp[6] == c)
|
||||
return (__ptr_t) &cp[6];
|
||||
if (cp[5] == c)
|
||||
return (__ptr_t) &cp[5];
|
||||
if (cp[4] == c)
|
||||
return (__ptr_t) &cp[4];
|
||||
#endif
|
||||
if (cp[3] == c)
|
||||
return (__ptr_t) &cp[3];
|
||||
if (cp[2] == c)
|
||||
return (__ptr_t) &cp[2];
|
||||
if (cp[1] == c)
|
||||
return (__ptr_t) &cp[1];
|
||||
if (cp[0] == c)
|
||||
return (__ptr_t) cp;
|
||||
}
|
||||
|
||||
n -= sizeof (longword);
|
||||
}
|
||||
|
||||
char_ptr = (const unsigned char *) longword_ptr;
|
||||
|
||||
while (n-- > 0)
|
||||
{
|
||||
if (*--char_ptr == c)
|
||||
return (__ptr_t) char_ptr;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (__memrchr, memrchr)
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/* modechange.c -- file mode manipulation
|
||||
Copyright (C) 1989, 1990, 1997-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989, 1990, 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -50,50 +50,65 @@ char *malloc ();
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
|
||||
/* The traditional octal values corresponding to each mode bit. */
|
||||
#define SUID 04000
|
||||
#define SGID 02000
|
||||
#define SVTX 01000
|
||||
#define RUSR 00400
|
||||
#define WUSR 00200
|
||||
#define XUSR 00100
|
||||
#define RGRP 00040
|
||||
#define WGRP 00020
|
||||
#define XGRP 00010
|
||||
#define ROTH 00004
|
||||
#define WOTH 00002
|
||||
#define XOTH 00001
|
||||
#define ALLM 07777 /* all octal mode bits */
|
||||
|
||||
#ifndef S_ISUID
|
||||
# define S_ISUID 04000
|
||||
# define S_ISUID SUID
|
||||
#endif
|
||||
#ifndef S_ISGID
|
||||
# define S_ISGID 04000
|
||||
# define S_ISGID SGID
|
||||
#endif
|
||||
#ifndef S_ISVTX
|
||||
# define S_ISVTX 01000
|
||||
# define S_ISVTX SVTX
|
||||
#endif
|
||||
#ifndef S_IRUSR
|
||||
# define S_IRUSR 0400
|
||||
# define S_IRUSR RUSR
|
||||
#endif
|
||||
#ifndef S_IWUSR
|
||||
# define S_IWUSR 0200
|
||||
# define S_IWUSR WUSR
|
||||
#endif
|
||||
#ifndef S_IXUSR
|
||||
# define S_IXUSR 0100
|
||||
# define S_IXUSR XUSR
|
||||
#endif
|
||||
#ifndef S_IRGRP
|
||||
# define S_IRGRP 0040
|
||||
# define S_IRGRP RGRP
|
||||
#endif
|
||||
#ifndef S_IWGRP
|
||||
# define S_IWGRP 0020
|
||||
# define S_IWGRP WGRP
|
||||
#endif
|
||||
#ifndef S_IXGRP
|
||||
# define S_IXGRP 0010
|
||||
# define S_IXGRP XGRP
|
||||
#endif
|
||||
#ifndef S_IROTH
|
||||
# define S_IROTH 0004
|
||||
# define S_IROTH ROTH
|
||||
#endif
|
||||
#ifndef S_IWOTH
|
||||
# define S_IWOTH 0002
|
||||
# define S_IWOTH WOTH
|
||||
#endif
|
||||
#ifndef S_IXOTH
|
||||
# define S_IXOTH 0001
|
||||
# define S_IXOTH XOTH
|
||||
#endif
|
||||
#ifndef S_IRWXU
|
||||
# define S_IRWXU 0700
|
||||
# define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
|
||||
#endif
|
||||
#ifndef S_IRWXG
|
||||
# define S_IRWXG 0070
|
||||
# define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
|
||||
#endif
|
||||
#ifndef S_IRWXO
|
||||
# define S_IRWXO 0007
|
||||
# define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
|
||||
#endif
|
||||
|
||||
/* All the mode bits that can be affected by chmod. */
|
||||
@@ -157,8 +172,7 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
|
||||
{
|
||||
struct mode_change *head; /* First element of the linked list. */
|
||||
struct mode_change *tail; /* An element of the linked list. */
|
||||
uintmax_t mode_value; /* The mode value, if octal. */
|
||||
char *string_end; /* Pointer to end of parsed value. */
|
||||
unsigned long octal_value; /* The mode value, if octal. */
|
||||
mode_t umask_value; /* The umask value (surprise). */
|
||||
|
||||
head = NULL;
|
||||
@@ -166,12 +180,34 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
|
||||
tail = NULL;
|
||||
#endif
|
||||
|
||||
if (xstrtoumax (mode_string, &string_end, 8, &mode_value, "") == LONGINT_OK)
|
||||
if (xstrtoul (mode_string, NULL, 8, &octal_value, "") == LONGINT_OK)
|
||||
{
|
||||
struct mode_change *p;
|
||||
if (mode_value != (mode_value & CHMOD_MODE_BITS))
|
||||
mode_t mode;
|
||||
if (octal_value != (octal_value & ALLM))
|
||||
return MODE_INVALID;
|
||||
p = make_node_op_equals ((mode_t) mode_value);
|
||||
|
||||
/* Help the compiler optimize the usual case where mode_t uses
|
||||
the traditional octal representation. */
|
||||
mode = ((S_ISUID == SUID && S_ISGID == SGID && S_ISVTX == SVTX
|
||||
&& S_IRUSR == RUSR && S_IWUSR == WUSR && S_IXUSR == XUSR
|
||||
&& S_IRGRP == RGRP && S_IWGRP == WGRP && S_IXGRP == XGRP
|
||||
&& S_IROTH == ROTH && S_IWOTH == WOTH && S_IXOTH == XOTH)
|
||||
? octal_value
|
||||
: ((octal_value & SUID ? S_ISUID : 0)
|
||||
| (octal_value & SGID ? S_ISGID : 0)
|
||||
| (octal_value & SVTX ? S_ISVTX : 0)
|
||||
| (octal_value & RUSR ? S_IRUSR : 0)
|
||||
| (octal_value & WUSR ? S_IWUSR : 0)
|
||||
| (octal_value & XUSR ? S_IXUSR : 0)
|
||||
| (octal_value & RGRP ? S_IRGRP : 0)
|
||||
| (octal_value & WGRP ? S_IWGRP : 0)
|
||||
| (octal_value & XGRP ? S_IXGRP : 0)
|
||||
| (octal_value & ROTH ? S_IROTH : 0)
|
||||
| (octal_value & WOTH ? S_IWOTH : 0)
|
||||
| (octal_value & XOTH ? S_IXOTH : 0)));
|
||||
|
||||
p = make_node_op_equals (mode);
|
||||
if (p == NULL)
|
||||
return MODE_MEMORY_EXHAUSTED;
|
||||
mode_append_entry (&head, &tail, p);
|
||||
@@ -393,7 +429,7 @@ mode_adjust (mode_t oldmode, const struct mode_change *changes)
|
||||
|
||||
/* In order to change only `u', `g', or `o' permissions,
|
||||
or some combination thereof, clear unselected bits.
|
||||
This can not be done in mode_compile because the value
|
||||
This cannot be done in mode_compile because the value
|
||||
to which the `changes->affected' mask is applied depends
|
||||
on the old mode of each file. */
|
||||
value &= changes->affected;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* obstack.c - subroutines used implicitly by object stack macros
|
||||
Copyright (C) 1988-1994,96,97,98,1999, 2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-1994,96,97,98,99,2000 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
@@ -282,9 +282,10 @@ _obstack_newchunk (h, length)
|
||||
register long obj_size = h->next_free - h->object_base;
|
||||
register long i;
|
||||
long already;
|
||||
char *object_base;
|
||||
|
||||
/* Compute size for new chunk. */
|
||||
new_size = (obj_size + length) + (obj_size >> 3) + 100;
|
||||
new_size = (obj_size + length) + (obj_size >> 3) + h->alignment_mask + 100;
|
||||
if (new_size < h->chunk_size)
|
||||
new_size = h->chunk_size;
|
||||
|
||||
@@ -296,6 +297,11 @@ _obstack_newchunk (h, length)
|
||||
new_chunk->prev = old_chunk;
|
||||
new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size;
|
||||
|
||||
/* Compute an aligned object_base in the new chunk */
|
||||
object_base =
|
||||
__INT_TO_PTR ((__PTR_TO_INT (new_chunk->contents) + h->alignment_mask)
|
||||
& ~ (h->alignment_mask));
|
||||
|
||||
/* Move the existing object to the new chunk.
|
||||
Word at a time is fast and is safe if the object
|
||||
is sufficiently aligned. */
|
||||
@@ -303,7 +309,7 @@ _obstack_newchunk (h, length)
|
||||
{
|
||||
for (i = obj_size / sizeof (COPYING_UNIT) - 1;
|
||||
i >= 0; i--)
|
||||
((COPYING_UNIT *)new_chunk->contents)[i]
|
||||
((COPYING_UNIT *)object_base)[i]
|
||||
= ((COPYING_UNIT *)h->object_base)[i];
|
||||
/* We used to copy the odd few remaining bytes as one extra COPYING_UNIT,
|
||||
but that can cross a page boundary on a machine
|
||||
@@ -314,7 +320,7 @@ _obstack_newchunk (h, length)
|
||||
already = 0;
|
||||
/* Copy remaining bytes one by one. */
|
||||
for (i = already; i < obj_size; i++)
|
||||
new_chunk->contents[i] = h->object_base[i];
|
||||
object_base[i] = h->object_base[i];
|
||||
|
||||
/* If the object just copied was the only data in OLD_CHUNK,
|
||||
free that chunk and remove it from the chain.
|
||||
@@ -325,7 +331,7 @@ _obstack_newchunk (h, length)
|
||||
CALL_FREEFUN (h, old_chunk);
|
||||
}
|
||||
|
||||
h->object_base = new_chunk->contents;
|
||||
h->object_base = object_base;
|
||||
h->next_free = h->object_base + obj_size;
|
||||
/* The new chunk certainly contains no empty object yet. */
|
||||
h->maybe_empty_object = 0;
|
||||
@@ -451,7 +457,7 @@ _obstack_memory_used (h)
|
||||
|
||||
/* Define the error handler. */
|
||||
# ifndef _
|
||||
# ifdef HAVE_LIBINTL_H
|
||||
# if defined HAVE_LIBINTL_H || defined _LIBC
|
||||
# include <libintl.h>
|
||||
# ifndef _
|
||||
# define _(Str) gettext (Str)
|
||||
@@ -518,20 +524,20 @@ int (obstack_make_room) (obstack, length)
|
||||
return obstack_make_room (obstack, length);
|
||||
}
|
||||
|
||||
void (obstack_grow) (obstack, pointer, length)
|
||||
void (obstack_grow) (obstack, data, length)
|
||||
struct obstack *obstack;
|
||||
POINTER pointer;
|
||||
const POINTER data;
|
||||
int length;
|
||||
{
|
||||
obstack_grow (obstack, pointer, length);
|
||||
obstack_grow (obstack, data, length);
|
||||
}
|
||||
|
||||
void (obstack_grow0) (obstack, pointer, length)
|
||||
void (obstack_grow0) (obstack, data, length)
|
||||
struct obstack *obstack;
|
||||
POINTER pointer;
|
||||
const POINTER data;
|
||||
int length;
|
||||
{
|
||||
obstack_grow0 (obstack, pointer, length);
|
||||
obstack_grow0 (obstack, data, length);
|
||||
}
|
||||
|
||||
void (obstack_1grow) (obstack, character)
|
||||
@@ -575,20 +581,20 @@ POINTER (obstack_alloc) (obstack, length)
|
||||
return obstack_alloc (obstack, length);
|
||||
}
|
||||
|
||||
POINTER (obstack_copy) (obstack, pointer, length)
|
||||
POINTER (obstack_copy) (obstack, address, length)
|
||||
struct obstack *obstack;
|
||||
POINTER pointer;
|
||||
const POINTER address;
|
||||
int length;
|
||||
{
|
||||
return obstack_copy (obstack, pointer, length);
|
||||
return obstack_copy (obstack, address, length);
|
||||
}
|
||||
|
||||
POINTER (obstack_copy0) (obstack, pointer, length)
|
||||
POINTER (obstack_copy0) (obstack, address, length)
|
||||
struct obstack *obstack;
|
||||
POINTER pointer;
|
||||
const POINTER address;
|
||||
int length;
|
||||
{
|
||||
return obstack_copy0 (obstack, pointer, length);
|
||||
return obstack_copy0 (obstack, address, length);
|
||||
}
|
||||
|
||||
# endif /* __STDC__ */
|
||||
|
||||
104
lib/obstack.h
104
lib/obstack.h
@@ -1,10 +1,11 @@
|
||||
/* obstack.h - object stack macros
|
||||
Copyright (C) 1988,89,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
|
||||
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.
|
||||
Bugs can be reported to bug-glibc@gnu.org.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
@@ -13,11 +14,11 @@
|
||||
|
||||
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.
|
||||
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 General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
@@ -219,18 +220,18 @@ void obstack_init (struct obstack *obstack);
|
||||
|
||||
void * obstack_alloc (struct obstack *obstack, int size);
|
||||
|
||||
void * obstack_copy (struct obstack *obstack, void *address, int size);
|
||||
void * obstack_copy0 (struct obstack *obstack, void *address, int size);
|
||||
void * obstack_copy (struct obstack *obstack, const void *address, int size);
|
||||
void * obstack_copy0 (struct obstack *obstack, const void *address, int size);
|
||||
|
||||
void obstack_free (struct obstack *obstack, void *block);
|
||||
|
||||
void obstack_blank (struct obstack *obstack, int size);
|
||||
|
||||
void obstack_grow (struct obstack *obstack, void *data, int size);
|
||||
void obstack_grow0 (struct obstack *obstack, void *data, int size);
|
||||
void obstack_grow (struct obstack *obstack, const void *data, int size);
|
||||
void obstack_grow0 (struct obstack *obstack, const void *data, int size);
|
||||
|
||||
void obstack_1grow (struct obstack *obstack, int data_char);
|
||||
void obstack_ptr_grow (struct obstack *obstack, void *data);
|
||||
void obstack_ptr_grow (struct obstack *obstack, const void *data);
|
||||
void obstack_int_grow (struct obstack *obstack, int data);
|
||||
|
||||
void * obstack_finish (struct obstack *obstack);
|
||||
@@ -240,7 +241,7 @@ 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_ptr_grow_fast (struct obstack *obstack, const void *data);
|
||||
void obstack_int_grow_fast (struct obstack *obstack, int data);
|
||||
void obstack_blank_fast (struct obstack *obstack, int size);
|
||||
|
||||
@@ -290,21 +291,24 @@ extern int obstack_exit_failure;
|
||||
standard C version. */
|
||||
#if defined __STDC__ && __STDC__
|
||||
|
||||
# define obstack_init(h) \
|
||||
_obstack_begin ((h), 0, 0, \
|
||||
(void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
|
||||
# define obstack_init(h) \
|
||||
_obstack_begin ((h), 0, 0, \
|
||||
(void *(*) (long)) obstack_chunk_alloc, \
|
||||
(void (*) (void *)) obstack_chunk_free)
|
||||
|
||||
# define obstack_begin(h, size) \
|
||||
_obstack_begin ((h), (size), 0, \
|
||||
(void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
|
||||
# define obstack_begin(h, size) \
|
||||
_obstack_begin ((h), (size), 0, \
|
||||
(void *(*) (long)) obstack_chunk_alloc, \
|
||||
(void (*) (void *)) obstack_chunk_free)
|
||||
|
||||
# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
|
||||
_obstack_begin ((h), (size), (alignment), \
|
||||
(void *(*) (long)) (chunkfun), (void (*) (void *)) (freefun))
|
||||
_obstack_begin ((h), (size), (alignment), \
|
||||
(void *(*) (long)) (chunkfun), \
|
||||
(void (*) (void *)) (freefun))
|
||||
|
||||
# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
|
||||
_obstack_begin_1 ((h), (size), (alignment), \
|
||||
(void *(*) (void *, long)) (chunkfun), \
|
||||
_obstack_begin_1 ((h), (size), (alignment), \
|
||||
(void *(*) (void *, long)) (chunkfun), \
|
||||
(void (*) (void *, void *)) (freefun), (arg))
|
||||
|
||||
# define obstack_chunkfun(h, newchunkfun) \
|
||||
@@ -315,21 +319,25 @@ extern int obstack_exit_failure;
|
||||
|
||||
#else
|
||||
|
||||
# define obstack_init(h) \
|
||||
_obstack_begin ((h), 0, 0, \
|
||||
(void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
|
||||
# define obstack_init(h) \
|
||||
_obstack_begin ((h), 0, 0, \
|
||||
(void *(*) ()) obstack_chunk_alloc, \
|
||||
(void (*) ()) obstack_chunk_free)
|
||||
|
||||
# define obstack_begin(h, size) \
|
||||
_obstack_begin ((h), (size), 0, \
|
||||
(void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
|
||||
# define obstack_begin(h, size) \
|
||||
_obstack_begin ((h), (size), 0, \
|
||||
(void *(*) ()) obstack_chunk_alloc, \
|
||||
(void (*) ()) obstack_chunk_free)
|
||||
|
||||
# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
|
||||
_obstack_begin ((h), (size), (alignment), \
|
||||
(void *(*) ()) (chunkfun), (void (*) ()) (freefun))
|
||||
_obstack_begin ((h), (size), (alignment), \
|
||||
(void *(*) ()) (chunkfun), \
|
||||
(void (*) ()) (freefun))
|
||||
|
||||
# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
|
||||
_obstack_begin_1 ((h), (size), (alignment), \
|
||||
(void *(*) ()) (chunkfun), (void (*) ()) (freefun), (arg))
|
||||
_obstack_begin_1 ((h), (size), (alignment), \
|
||||
(void *(*) ()) (chunkfun), \
|
||||
(void (*) ()) (freefun), (arg))
|
||||
|
||||
# define obstack_chunkfun(h, newchunkfun) \
|
||||
((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun))
|
||||
@@ -387,7 +395,7 @@ __extension__ \
|
||||
int __len = (length); \
|
||||
if (__o->next_free + __len > __o->chunk_limit) \
|
||||
_obstack_newchunk (__o, __len); \
|
||||
_obstack_memcpy (__o->next_free, (char *) (where), __len); \
|
||||
_obstack_memcpy (__o->next_free, (where), __len); \
|
||||
__o->next_free += __len; \
|
||||
(void) 0; })
|
||||
|
||||
@@ -397,7 +405,7 @@ __extension__ \
|
||||
int __len = (length); \
|
||||
if (__o->next_free + __len + 1 > __o->chunk_limit) \
|
||||
_obstack_newchunk (__o, __len + 1); \
|
||||
_obstack_memcpy (__o->next_free, (char *) (where), __len); \
|
||||
_obstack_memcpy (__o->next_free, (where), __len); \
|
||||
__o->next_free += __len; \
|
||||
*(__o->next_free)++ = 0; \
|
||||
(void) 0; })
|
||||
@@ -410,8 +418,8 @@ __extension__ \
|
||||
*(__o->next_free)++ = (datum); \
|
||||
(void) 0; })
|
||||
|
||||
/* These assume that the obstack alignment is good enough for pointers or ints,
|
||||
and that the data added so far to the current object
|
||||
/* These assume that the obstack alignment is good enough for pointers
|
||||
or ints, and that the data added so far to the current object
|
||||
shares that much alignment. */
|
||||
|
||||
# define obstack_ptr_grow(OBSTACK,datum) \
|
||||
@@ -419,7 +427,7 @@ __extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
|
||||
_obstack_newchunk (__o, sizeof (void *)); \
|
||||
*((void **)__o->next_free)++ = ((void *)datum); \
|
||||
*((void **)__o->next_free)++ = (datum); \
|
||||
(void) 0; })
|
||||
|
||||
# define obstack_int_grow(OBSTACK,datum) \
|
||||
@@ -427,11 +435,14 @@ __extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
if (__o->next_free + sizeof (int) > __o->chunk_limit) \
|
||||
_obstack_newchunk (__o, sizeof (int)); \
|
||||
*((int *)__o->next_free)++ = ((int)datum); \
|
||||
*((int *)__o->next_free)++ = (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)++ = (aptr))
|
||||
|
||||
# define obstack_int_grow_fast(h,aint) \
|
||||
(*((int *) (h)->next_free)++ = (aint))
|
||||
|
||||
# define obstack_blank(OBSTACK,length) \
|
||||
__extension__ \
|
||||
@@ -512,14 +523,14 @@ __extension__ \
|
||||
( (h)->temp = (length), \
|
||||
(((h)->next_free + (h)->temp > (h)->chunk_limit) \
|
||||
? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
|
||||
_obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
|
||||
_obstack_memcpy ((h)->next_free, (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), \
|
||||
_obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
|
||||
_obstack_memcpy ((h)->next_free, (where), (h)->temp), \
|
||||
(h)->next_free += (h)->temp, \
|
||||
*((h)->next_free)++ = 0)
|
||||
|
||||
@@ -531,15 +542,18 @@ __extension__ \
|
||||
# define obstack_ptr_grow(h,datum) \
|
||||
( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \
|
||||
? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \
|
||||
(*((char **) (((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *) datum)))
|
||||
(*((const char **) (((h)->next_free+=sizeof(char *))-sizeof(char *))) = (datum)))
|
||||
|
||||
# define obstack_int_grow(h,datum) \
|
||||
( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \
|
||||
? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \
|
||||
(*((int *) (((h)->next_free+=sizeof(int))-sizeof(int))) = ((int) datum)))
|
||||
(*((int *) (((h)->next_free+=sizeof(int))-sizeof(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) \
|
||||
(*((const char **) (h)->next_free)++ = (aptr))
|
||||
|
||||
# define obstack_int_grow_fast(h,aint) \
|
||||
(*((int *) (h)->next_free)++ = (aint))
|
||||
|
||||
# define obstack_blank(h,length) \
|
||||
( (h)->temp = (length), \
|
||||
|
||||
@@ -26,12 +26,31 @@
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#if HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
|
||||
#if HAVE_STRING_H
|
||||
# if !STDC_HEADERS && HAVE_MEMORY_H
|
||||
# include <memory.h>
|
||||
# endif
|
||||
# include <string.h>
|
||||
#else
|
||||
# if HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
# endif
|
||||
#endif
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_MALLOC
|
||||
"this configure-time declaration test was not run"
|
||||
#endif
|
||||
#if !HAVE_DECL_MALLOC
|
||||
char *malloc ();
|
||||
#endif
|
||||
|
||||
#ifndef strdup
|
||||
char *strdup ();
|
||||
#endif
|
||||
|
||||
58
lib/physmem.c
Normal file
58
lib/physmem.c
Normal file
@@ -0,0 +1,58 @@
|
||||
/* Calculate the size of physical memory.
|
||||
Copyright 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "physmem.h"
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* Return the total amount of physical memory. */
|
||||
double
|
||||
physmem_total (void)
|
||||
{
|
||||
#if defined _SC_PHYS_PAGES && defined _SC_PAGESIZE
|
||||
double pages = sysconf (_SC_PHYS_PAGES);
|
||||
double pagesize = sysconf (_SC_PAGESIZE);
|
||||
if (0 <= pages && 0 <= pagesize)
|
||||
return pages * pagesize;
|
||||
#endif
|
||||
|
||||
/* Guess 64 MB. It's probably an older host, so guess small. */
|
||||
return 64 * 1024 * 1024;
|
||||
}
|
||||
|
||||
/* Return the amount of physical memory available. */
|
||||
double
|
||||
physmem_available (void)
|
||||
{
|
||||
#if defined _SC_AVPHYS_PAGES && defined _SC_PAGESIZE
|
||||
double pages = sysconf (_SC_AVPHYS_PAGES);
|
||||
double pagesize = sysconf (_SC_PAGESIZE);
|
||||
if (0 <= pages && 0 <= pagesize)
|
||||
return pages * pagesize;
|
||||
#endif
|
||||
|
||||
/* Guess 25% of physical memory. */
|
||||
return physmem_total () / 4;
|
||||
}
|
||||
19
lib/physmem.h
Normal file
19
lib/physmem.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef PHYSMEM_H_
|
||||
# define PHYSMEM_H_ 1
|
||||
|
||||
# if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
# endif
|
||||
|
||||
# ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
# endif
|
||||
|
||||
double physmem_total PARAMS ((void));
|
||||
double physmem_available PARAMS ((void));
|
||||
|
||||
#endif /* PHYSMEM_H_ */
|
||||
12
lib/quote.h
12
lib/quote.h
@@ -1,4 +1,12 @@
|
||||
/* prototypes for quote.c */
|
||||
|
||||
char const *quote_n (int n, char const *name);
|
||||
char const *quote (char const *name);
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
char const *quote_n PARAMS ((int n, char const *name));
|
||||
char const *quote PARAMS ((char const *name));
|
||||
|
||||
@@ -92,15 +92,14 @@ size_t mbrtowc ();
|
||||
#define INT_BITS (sizeof (int) * CHAR_BIT)
|
||||
|
||||
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
|
||||
/* Undefine to protect against the definition in wctype.h of solaris2.6. */
|
||||
# undef ISASCII
|
||||
# define ISASCII(c) 1
|
||||
# define IN_CTYPE_DOMAIN(c) 1
|
||||
#else
|
||||
# define ISASCII(c) isascii (c)
|
||||
# define IN_CTYPE_DOMAIN(c) isascii(c)
|
||||
#endif
|
||||
|
||||
/* Undefine to protect against the definition in wctype.h of solaris2.6. */
|
||||
#undef ISPRINT
|
||||
#define ISPRINT(c) (ISASCII (c) && isprint (c))
|
||||
#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
|
||||
|
||||
struct quoting_options
|
||||
{
|
||||
|
||||
89
lib/regex.c
89
lib/regex.c
@@ -89,6 +89,10 @@
|
||||
/* This is for other GNU distributions with internationalized messages. */
|
||||
#if HAVE_LIBINTL_H || defined _LIBC
|
||||
# include <libintl.h>
|
||||
# ifdef _LIBC
|
||||
# undef gettext
|
||||
# define gettext(msgid) __dcgettext ("libc", msgid, LC_MESSAGES)
|
||||
# endif
|
||||
#else
|
||||
# define gettext(msgid) (msgid)
|
||||
#endif
|
||||
@@ -197,35 +201,34 @@ char *realloc ();
|
||||
eliminate the && through constant folding."
|
||||
Solaris defines some of these symbols so we must undefine them first. */
|
||||
|
||||
#undef ISASCII
|
||||
#if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII)
|
||||
# define ISASCII(c) 1
|
||||
# define IN_CTYPE_DOMAIN(c) 1
|
||||
#else
|
||||
# define ISASCII(c) isascii(c)
|
||||
# define IN_CTYPE_DOMAIN(c) isascii(c)
|
||||
#endif
|
||||
|
||||
#ifdef isblank
|
||||
# define ISBLANK(c) (ISASCII (c) && isblank (c))
|
||||
# define ISBLANK(c) (IN_CTYPE_DOMAIN (c) && isblank (c))
|
||||
#else
|
||||
# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
|
||||
#endif
|
||||
#ifdef isgraph
|
||||
# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
|
||||
# define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isgraph (c))
|
||||
#else
|
||||
# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
|
||||
# define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isprint (c) && !isspace (c))
|
||||
#endif
|
||||
|
||||
#undef ISPRINT
|
||||
#define ISPRINT(c) (ISASCII (c) && isprint (c))
|
||||
#define ISDIGIT(c) (ISASCII (c) && isdigit (c))
|
||||
#define ISALNUM(c) (ISASCII (c) && isalnum (c))
|
||||
#define ISALPHA(c) (ISASCII (c) && isalpha (c))
|
||||
#define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
|
||||
#define ISLOWER(c) (ISASCII (c) && islower (c))
|
||||
#define ISPUNCT(c) (ISASCII (c) && ispunct (c))
|
||||
#define ISSPACE(c) (ISASCII (c) && isspace (c))
|
||||
#define ISUPPER(c) (ISASCII (c) && isupper (c))
|
||||
#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
|
||||
#define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c))
|
||||
#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
|
||||
#define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c))
|
||||
#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
|
||||
#define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (c))
|
||||
#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c))
|
||||
#define ISPUNCT(c) (IN_CTYPE_DOMAIN (c) && ispunct (c))
|
||||
#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
|
||||
#define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
|
||||
#define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c))
|
||||
|
||||
#ifdef _tolower
|
||||
# define TOLOWER(c) _tolower(c)
|
||||
@@ -1234,7 +1237,7 @@ typedef struct
|
||||
# if defined MATCH_MAY_ALLOCATE
|
||||
/* 4400 was enough to cause a crash on Alpha OSF/1,
|
||||
whose default stack limit is 2mb. */
|
||||
int re_max_failures = 20000;
|
||||
int re_max_failures = 4000;
|
||||
# else
|
||||
int re_max_failures = 2000;
|
||||
# endif
|
||||
@@ -2712,7 +2715,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
PATFETCH (c);
|
||||
|
||||
/* Now add the multibyte character(s) we found
|
||||
to the acceptabed list.
|
||||
to the accept list.
|
||||
|
||||
XXX Note that this is not entirely correct.
|
||||
we would have to match multibyte sequences
|
||||
@@ -2725,7 +2728,10 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
if (c1 == 1)
|
||||
range_start = extra[idx];
|
||||
while (c1-- > 0)
|
||||
SET_LIST_BIT (extra[idx++]);
|
||||
{
|
||||
SET_LIST_BIT (extra[idx]);
|
||||
++idx;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
had_char_class = false;
|
||||
@@ -3507,23 +3513,19 @@ compile_range (range_start_char, p_ptr, pend, translate, syntax, b)
|
||||
unsigned char *b;
|
||||
{
|
||||
unsigned this_char;
|
||||
|
||||
const char *p = *p_ptr;
|
||||
reg_errcode_t ret;
|
||||
char range_start[2];
|
||||
char range_end[2];
|
||||
char ch[2];
|
||||
#if _LIBC
|
||||
const unsigned char *collseq;
|
||||
unsigned int start_colseq;
|
||||
unsigned int end_colseq;
|
||||
#else
|
||||
unsigned end_char;
|
||||
#endif
|
||||
|
||||
if (p == pend)
|
||||
return REG_ERANGE;
|
||||
|
||||
/* Fetch the endpoints without translating them; the
|
||||
appropriate translation is done in the bit-setting loop below. */
|
||||
range_start[0] = range_start_char;
|
||||
range_start[1] = '\0';
|
||||
range_end[0] = p[0];
|
||||
range_end[1] = '\0';
|
||||
|
||||
/* Have to increment the pointer into the pattern string, so the
|
||||
caller isn't still at the ending character. */
|
||||
(*p_ptr)++;
|
||||
@@ -3531,19 +3533,34 @@ compile_range (range_start_char, p_ptr, pend, translate, syntax, b)
|
||||
/* Report an error if the range is empty and the syntax prohibits this. */
|
||||
ret = syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
|
||||
|
||||
/* Here we see why `this_char' has to be larger than an `unsigned
|
||||
char' -- we would otherwise go into an infinite loop, since all
|
||||
characters <= 0xff. */
|
||||
ch[1] = '\0';
|
||||
#if _LIBC
|
||||
collseq = (const unsigned char *) _NL_CURRENT (LC_COLLATE,
|
||||
_NL_COLLATE_COLLSEQMB);
|
||||
|
||||
start_colseq = collseq[(unsigned char) TRANSLATE (range_start_char)];
|
||||
end_colseq = collseq[(unsigned char) TRANSLATE (p[0])];
|
||||
for (this_char = 0; this_char <= (unsigned char) -1; ++this_char)
|
||||
{
|
||||
ch[0] = this_char;
|
||||
if (strcoll (range_start, ch) <= 0 && strcoll (ch, range_end) <= 0)
|
||||
unsigned int this_colseq = collseq[(unsigned char) TRANSLATE (this_char)];
|
||||
|
||||
if (start_colseq <= this_colseq && this_colseq <= end_colseq)
|
||||
{
|
||||
SET_LIST_BIT (TRANSLATE (this_char));
|
||||
ret = REG_NOERROR;
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* Here we see why `this_char' has to be larger than an `unsigned
|
||||
char' -- we would otherwise go into an infinite loop, since all
|
||||
characters <= 0xff. */
|
||||
range_start_char = TRANSLATE (range_start_char);
|
||||
end_char = TRANSLATE (p[0]);
|
||||
for (this_char = range_start_char; this_char <= end_char; ++this_char)
|
||||
{
|
||||
SET_LIST_BIT (TRANSLATE (this_char));
|
||||
ret = REG_NOERROR;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
26
lib/regex.h
26
lib/regex.h
@@ -513,13 +513,31 @@ extern int re_exec _RE_ARGS ((const char *));
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* GCC 2.95 and later have "__restrict"; C99 compilers have
|
||||
"restrict", and "configure" may have defined "restrict". */
|
||||
#ifndef __restrict
|
||||
# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
|
||||
# if defined restrict || 199901L <= __STDC_VERSION__
|
||||
# define __restrict restrict
|
||||
# else
|
||||
# define __restrict
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
/* For now unconditionally define __restrict_arr to expand to nothing.
|
||||
Ideally we would have a test for the compiler which allows defining
|
||||
it to restrict. */
|
||||
#define __restrict_arr
|
||||
|
||||
/* POSIX compatibility. */
|
||||
extern int regcomp _RE_ARGS ((regex_t *__preg, const char *__pattern,
|
||||
extern int regcomp _RE_ARGS ((regex_t *__restrict __preg,
|
||||
const char *__restrict __pattern,
|
||||
int __cflags));
|
||||
|
||||
extern int regexec _RE_ARGS ((const regex_t *__preg,
|
||||
const char *__string, size_t __nmatch,
|
||||
regmatch_t __pmatch[], int __eflags));
|
||||
extern int regexec _RE_ARGS ((const regex_t *__restrict __preg,
|
||||
const char *__restrict __string, size_t __nmatch,
|
||||
regmatch_t __pmatch[__restrict_arr],
|
||||
int __eflags));
|
||||
|
||||
extern size_t regerror _RE_ARGS ((int __errcode, const regex_t *__preg,
|
||||
char *__errbuf, size_t __errbuf_size));
|
||||
|
||||
68
lib/rename.c
Normal file
68
lib/rename.c
Normal file
@@ -0,0 +1,68 @@
|
||||
/* Work around the bug in some systems whereby rename fails when the source
|
||||
path has a trailing slash. The rename from SunOS 4.1.1_U1 has this bug.
|
||||
Copyright (C) 2001 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 Volker Borchert */
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <xalloc.h>
|
||||
|
||||
#ifndef HAVE_DECL_FREE
|
||||
"this configure-time declaration test was not run"
|
||||
#endif
|
||||
#if !HAVE_DECL_FREE
|
||||
void free ();
|
||||
#endif
|
||||
|
||||
void strip_trailing_slashes ();
|
||||
|
||||
/* Rename the file SRC_PATH to DST_PATH, removing any trailing
|
||||
slashes from SRC_PATH. Needed for SunOS 4.1.1_U1. */
|
||||
|
||||
int
|
||||
rpl_rename (const char *src_path, const char *dst_path)
|
||||
{
|
||||
char *src_temp;
|
||||
int ret_val;
|
||||
size_t s_len = strlen (src_path);
|
||||
|
||||
if (s_len && src_path[s_len - 1] == '/')
|
||||
{
|
||||
src_temp = xstrdup (src_path);
|
||||
strip_trailing_slashes (src_temp);
|
||||
}
|
||||
else
|
||||
src_temp = (char *) src_path;
|
||||
|
||||
ret_val = rename (src_temp, dst_path);
|
||||
|
||||
if (src_temp != src_path)
|
||||
free (src_temp);
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
@@ -42,6 +42,10 @@
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#ifndef O_DIRECTORY
|
||||
# define O_DIRECTORY 0
|
||||
#endif
|
||||
|
||||
#include "save-cwd.h"
|
||||
#include "error.h"
|
||||
|
||||
@@ -67,7 +71,7 @@ save_cwd (struct saved_cwd *cwd)
|
||||
if (have_working_fchdir)
|
||||
{
|
||||
#if HAVE_FCHDIR
|
||||
cwd->desc = open (".", O_RDONLY);
|
||||
cwd->desc = open (".", O_RDONLY | O_DIRECTORY);
|
||||
if (cwd->desc < 0)
|
||||
{
|
||||
error (0, errno, "cannot open current directory");
|
||||
|
||||
376
lib/sha.c
Normal file
376
lib/sha.c
Normal file
@@ -0,0 +1,376 @@
|
||||
/* sha.c - Functions to compute the SHA1 hash (message-digest) of files
|
||||
or blocks of memory. Complies to the NIST specification FIPS-180-1.
|
||||
|
||||
Copyright (C) 2000 Scott G. Miller
|
||||
|
||||
Credits:
|
||||
Robert Klep <robert@ilse.nl> -- Expansion function fix
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#if STDC_HEADERS || defined _LIBC
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
#else
|
||||
# ifndef HAVE_MEMCPY
|
||||
# define memcpy(d, s, n) bcopy ((s), (d), (n))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "md5.h"
|
||||
#include "sha.h"
|
||||
|
||||
/*
|
||||
Not-swap is a macro that does an endian swap on architectures that are
|
||||
big-endian, as SHA needs some data in a little-endian format
|
||||
*/
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
# define NOTSWAP(n) (n)
|
||||
# define SWAP(n) \
|
||||
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
|
||||
#else
|
||||
# define NOTSWAP(n) \
|
||||
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
|
||||
# define SWAP(n) (n)
|
||||
#endif
|
||||
|
||||
/* This array contains the bytes used to pad the buffer to the next
|
||||
64-byte boundary. (RFC 1321, 3.1: Step 1) */
|
||||
static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
|
||||
|
||||
|
||||
/*
|
||||
Takes a pointer to a 160 bit block of data (five 32 bit ints) and
|
||||
intializes it to the start constants of the SHA1 algorithm. This
|
||||
must be called before using hash in the call to sha_hash
|
||||
*/
|
||||
void
|
||||
sha_init_ctx (struct sha_ctx *ctx)
|
||||
{
|
||||
ctx->A = 0x67452301;
|
||||
ctx->B = 0xefcdab89;
|
||||
ctx->C = 0x98badcfe;
|
||||
ctx->D = 0x10325476;
|
||||
ctx->E = 0xc3d2e1f0;
|
||||
|
||||
ctx->total[0] = ctx->total[1] = 0;
|
||||
ctx->buflen = 0;
|
||||
}
|
||||
|
||||
/* Put result from CTX in first 20 bytes following RESBUF. The result
|
||||
must be in little endian byte order.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
void *
|
||||
sha_read_ctx (const struct sha_ctx *ctx, void *resbuf)
|
||||
{
|
||||
((md5_uint32 *) resbuf)[0] = NOTSWAP (ctx->A);
|
||||
((md5_uint32 *) resbuf)[1] = NOTSWAP (ctx->B);
|
||||
((md5_uint32 *) resbuf)[2] = NOTSWAP (ctx->C);
|
||||
((md5_uint32 *) resbuf)[3] = NOTSWAP (ctx->D);
|
||||
((md5_uint32 *) resbuf)[4] = NOTSWAP (ctx->E);
|
||||
|
||||
return resbuf;
|
||||
}
|
||||
|
||||
/* Process the remaining bytes in the internal buffer and the usual
|
||||
prolog according to the standard and write the result to RESBUF.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
void *
|
||||
sha_finish_ctx (struct sha_ctx *ctx, void *resbuf)
|
||||
{
|
||||
/* Take yet unprocessed bytes into account. */
|
||||
md5_uint32 bytes = ctx->buflen;
|
||||
size_t pad;
|
||||
|
||||
/* Now count remaining bytes. */
|
||||
ctx->total[0] += bytes;
|
||||
if (ctx->total[0] < bytes)
|
||||
++ctx->total[1];
|
||||
|
||||
pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
|
||||
memcpy (&ctx->buffer[bytes], fillbuf, pad);
|
||||
|
||||
/* Put the 64-bit file length in *bits* at the end of the buffer. */
|
||||
*(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = NOTSWAP (ctx->total[0] << 3);
|
||||
*(md5_uint32 *) &ctx->buffer[bytes + pad] = NOTSWAP ((ctx->total[1] << 3) |
|
||||
(ctx->total[0] >> 29));
|
||||
|
||||
/* Process last bytes. */
|
||||
sha_process_block (ctx->buffer, bytes + pad + 8, ctx);
|
||||
|
||||
return sha_read_ctx (ctx, resbuf);
|
||||
}
|
||||
|
||||
/* Compute SHA1 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 16 bytes
|
||||
beginning at RESBLOCK. */
|
||||
int
|
||||
sha_stream (FILE *stream, void *resblock)
|
||||
{
|
||||
/* Important: BLOCKSIZE must be a multiple of 64. */
|
||||
#define BLOCKSIZE 4096
|
||||
struct sha_ctx ctx;
|
||||
char buffer[BLOCKSIZE + 72];
|
||||
size_t sum;
|
||||
|
||||
/* Initialize the computation context. */
|
||||
sha_init_ctx (&ctx);
|
||||
|
||||
/* Iterate over full file contents. */
|
||||
while (1)
|
||||
{
|
||||
/* We read the file in blocks of BLOCKSIZE bytes. One call of the
|
||||
computation function processes the whole buffer so that with the
|
||||
next round of the loop another block can be read. */
|
||||
size_t n;
|
||||
sum = 0;
|
||||
|
||||
/* Read block. Take care for partial reads. */
|
||||
do
|
||||
{
|
||||
n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
|
||||
|
||||
sum += n;
|
||||
}
|
||||
while (sum < BLOCKSIZE && n != 0);
|
||||
if (n == 0 && ferror (stream))
|
||||
return 1;
|
||||
|
||||
/* If end of file is reached, end the loop. */
|
||||
if (n == 0)
|
||||
break;
|
||||
|
||||
/* Process buffer with BLOCKSIZE bytes. Note that
|
||||
BLOCKSIZE % 64 == 0
|
||||
*/
|
||||
sha_process_block (buffer, BLOCKSIZE, &ctx);
|
||||
}
|
||||
|
||||
/* Add the last bytes if necessary. */
|
||||
if (sum > 0)
|
||||
sha_process_bytes (buffer, sum, &ctx);
|
||||
|
||||
/* Construct result in desired memory. */
|
||||
sha_finish_ctx (&ctx, resblock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
digest. */
|
||||
void *
|
||||
sha_buffer (const char *buffer, size_t len, void *resblock)
|
||||
{
|
||||
struct sha_ctx ctx;
|
||||
|
||||
/* Initialize the computation context. */
|
||||
sha_init_ctx (&ctx);
|
||||
|
||||
/* Process whole buffer but last len % 64 bytes. */
|
||||
sha_process_bytes (buffer, len, &ctx);
|
||||
|
||||
/* Put result in desired memory area. */
|
||||
return sha_finish_ctx (&ctx, resblock);
|
||||
}
|
||||
|
||||
void
|
||||
sha_process_bytes (const void *buffer, size_t len, struct sha_ctx *ctx)
|
||||
{
|
||||
/* When we already have some bits in our internal buffer concatenate
|
||||
both inputs first. */
|
||||
if (ctx->buflen != 0)
|
||||
{
|
||||
size_t left_over = ctx->buflen;
|
||||
size_t add = 128 - left_over > len ? len : 128 - left_over;
|
||||
|
||||
memcpy (&ctx->buffer[left_over], buffer, add);
|
||||
ctx->buflen += add;
|
||||
|
||||
if (left_over + add > 64)
|
||||
{
|
||||
sha_process_block (ctx->buffer, (left_over + add) & ~63, ctx);
|
||||
/* The regions in the following copy operation cannot overlap. */
|
||||
memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63],
|
||||
(left_over + add) & 63);
|
||||
ctx->buflen = (left_over + add) & 63;
|
||||
}
|
||||
|
||||
buffer = (const char *) buffer + add;
|
||||
len -= add;
|
||||
}
|
||||
|
||||
/* Process available complete blocks. */
|
||||
if (len > 64)
|
||||
{
|
||||
sha_process_block (buffer, len & ~63, ctx);
|
||||
buffer = (const char *) buffer + (len & ~63);
|
||||
len &= 63;
|
||||
}
|
||||
|
||||
/* Move remaining bytes in internal buffer. */
|
||||
if (len > 0)
|
||||
{
|
||||
memcpy (ctx->buffer, buffer, len);
|
||||
ctx->buflen = len;
|
||||
}
|
||||
}
|
||||
|
||||
/* --- Code below is the primary difference between md5.c and sha.c --- */
|
||||
|
||||
/* SHA1 round constants */
|
||||
#define K1 0x5a827999L
|
||||
#define K2 0x6ed9eba1L
|
||||
#define K3 0x8f1bbcdcL
|
||||
#define K4 0xca62c1d6L
|
||||
|
||||
/* Round functions. Note that F2 is the same as F4. */
|
||||
#define F1(B,C,D) ( D ^ ( B & ( C ^ D ) ) )
|
||||
#define F2(B,C,D) (B ^ C ^ D)
|
||||
#define F3(B,C,D) ( ( B & C ) | ( D & ( B | C ) ) )
|
||||
#define F4(B,C,D) (B ^ C ^ D)
|
||||
|
||||
/* Process LEN bytes of BUFFER, accumulating context into CTX.
|
||||
It is assumed that LEN % 64 == 0.
|
||||
Most of this code comes from GnuPG's cipher/sha1.c. */
|
||||
|
||||
void
|
||||
sha_process_block (const void *buffer, size_t len, struct sha_ctx *ctx)
|
||||
{
|
||||
const md5_uint32 *words = buffer;
|
||||
size_t nwords = len / sizeof (md5_uint32);
|
||||
const md5_uint32 *endp = words + nwords;
|
||||
md5_uint32 x[16];
|
||||
md5_uint32 a = ctx->A;
|
||||
md5_uint32 b = ctx->B;
|
||||
md5_uint32 c = ctx->C;
|
||||
md5_uint32 d = ctx->D;
|
||||
md5_uint32 e = ctx->E;
|
||||
|
||||
/* First increment the byte count. RFC 1321 specifies the possible
|
||||
length of the file up to 2^64 bits. Here we only compute the
|
||||
number of bytes. Do a double word increment. */
|
||||
ctx->total[0] += len;
|
||||
if (ctx->total[0] < len)
|
||||
++ctx->total[1];
|
||||
|
||||
#define M(I) ( tm = x[I&0x0f] ^ x[(I-14)&0x0f] \
|
||||
^ x[(I-8)&0x0f] ^ x[(I-3)&0x0f] \
|
||||
, (x[I&0x0f] = rol(tm, 1)) )
|
||||
|
||||
#define R(A,B,C,D,E,F,K,M) do { E += rol( A, 5 ) \
|
||||
+ F( B, C, D ) \
|
||||
+ K \
|
||||
+ M; \
|
||||
B = rol( B, 30 ); \
|
||||
} while(0)
|
||||
|
||||
while (words < endp)
|
||||
{
|
||||
md5_uint32 tm;
|
||||
int t;
|
||||
/* FIXME: see sha1.c for a better implementation. */
|
||||
for (t = 0; t < 16; t++)
|
||||
{
|
||||
x[t] = NOTSWAP (*words);
|
||||
words++;
|
||||
}
|
||||
|
||||
R( a, b, c, d, e, F1, K1, x[ 0] );
|
||||
R( e, a, b, c, d, F1, K1, x[ 1] );
|
||||
R( d, e, a, b, c, F1, K1, x[ 2] );
|
||||
R( c, d, e, a, b, F1, K1, x[ 3] );
|
||||
R( b, c, d, e, a, F1, K1, x[ 4] );
|
||||
R( a, b, c, d, e, F1, K1, x[ 5] );
|
||||
R( e, a, b, c, d, F1, K1, x[ 6] );
|
||||
R( d, e, a, b, c, F1, K1, x[ 7] );
|
||||
R( c, d, e, a, b, F1, K1, x[ 8] );
|
||||
R( b, c, d, e, a, F1, K1, x[ 9] );
|
||||
R( a, b, c, d, e, F1, K1, x[10] );
|
||||
R( e, a, b, c, d, F1, K1, x[11] );
|
||||
R( d, e, a, b, c, F1, K1, x[12] );
|
||||
R( c, d, e, a, b, F1, K1, x[13] );
|
||||
R( b, c, d, e, a, F1, K1, x[14] );
|
||||
R( a, b, c, d, e, F1, K1, x[15] );
|
||||
R( e, a, b, c, d, F1, K1, M(16) );
|
||||
R( d, e, a, b, c, F1, K1, M(17) );
|
||||
R( c, d, e, a, b, F1, K1, M(18) );
|
||||
R( b, c, d, e, a, F1, K1, M(19) );
|
||||
R( a, b, c, d, e, F2, K2, M(20) );
|
||||
R( e, a, b, c, d, F2, K2, M(21) );
|
||||
R( d, e, a, b, c, F2, K2, M(22) );
|
||||
R( c, d, e, a, b, F2, K2, M(23) );
|
||||
R( b, c, d, e, a, F2, K2, M(24) );
|
||||
R( a, b, c, d, e, F2, K2, M(25) );
|
||||
R( e, a, b, c, d, F2, K2, M(26) );
|
||||
R( d, e, a, b, c, F2, K2, M(27) );
|
||||
R( c, d, e, a, b, F2, K2, M(28) );
|
||||
R( b, c, d, e, a, F2, K2, M(29) );
|
||||
R( a, b, c, d, e, F2, K2, M(30) );
|
||||
R( e, a, b, c, d, F2, K2, M(31) );
|
||||
R( d, e, a, b, c, F2, K2, M(32) );
|
||||
R( c, d, e, a, b, F2, K2, M(33) );
|
||||
R( b, c, d, e, a, F2, K2, M(34) );
|
||||
R( a, b, c, d, e, F2, K2, M(35) );
|
||||
R( e, a, b, c, d, F2, K2, M(36) );
|
||||
R( d, e, a, b, c, F2, K2, M(37) );
|
||||
R( c, d, e, a, b, F2, K2, M(38) );
|
||||
R( b, c, d, e, a, F2, K2, M(39) );
|
||||
R( a, b, c, d, e, F3, K3, M(40) );
|
||||
R( e, a, b, c, d, F3, K3, M(41) );
|
||||
R( d, e, a, b, c, F3, K3, M(42) );
|
||||
R( c, d, e, a, b, F3, K3, M(43) );
|
||||
R( b, c, d, e, a, F3, K3, M(44) );
|
||||
R( a, b, c, d, e, F3, K3, M(45) );
|
||||
R( e, a, b, c, d, F3, K3, M(46) );
|
||||
R( d, e, a, b, c, F3, K3, M(47) );
|
||||
R( c, d, e, a, b, F3, K3, M(48) );
|
||||
R( b, c, d, e, a, F3, K3, M(49) );
|
||||
R( a, b, c, d, e, F3, K3, M(50) );
|
||||
R( e, a, b, c, d, F3, K3, M(51) );
|
||||
R( d, e, a, b, c, F3, K3, M(52) );
|
||||
R( c, d, e, a, b, F3, K3, M(53) );
|
||||
R( b, c, d, e, a, F3, K3, M(54) );
|
||||
R( a, b, c, d, e, F3, K3, M(55) );
|
||||
R( e, a, b, c, d, F3, K3, M(56) );
|
||||
R( d, e, a, b, c, F3, K3, M(57) );
|
||||
R( c, d, e, a, b, F3, K3, M(58) );
|
||||
R( b, c, d, e, a, F3, K3, M(59) );
|
||||
R( a, b, c, d, e, F4, K4, M(60) );
|
||||
R( e, a, b, c, d, F4, K4, M(61) );
|
||||
R( d, e, a, b, c, F4, K4, M(62) );
|
||||
R( c, d, e, a, b, F4, K4, M(63) );
|
||||
R( b, c, d, e, a, F4, K4, M(64) );
|
||||
R( a, b, c, d, e, F4, K4, M(65) );
|
||||
R( e, a, b, c, d, F4, K4, M(66) );
|
||||
R( d, e, a, b, c, F4, K4, M(67) );
|
||||
R( c, d, e, a, b, F4, K4, M(68) );
|
||||
R( b, c, d, e, a, F4, K4, M(69) );
|
||||
R( a, b, c, d, e, F4, K4, M(70) );
|
||||
R( e, a, b, c, d, F4, K4, M(71) );
|
||||
R( d, e, a, b, c, F4, K4, M(72) );
|
||||
R( c, d, e, a, b, F4, K4, M(73) );
|
||||
R( b, c, d, e, a, F4, K4, M(74) );
|
||||
R( a, b, c, d, e, F4, K4, M(75) );
|
||||
R( e, a, b, c, d, F4, K4, M(76) );
|
||||
R( d, e, a, b, c, F4, K4, M(77) );
|
||||
R( c, d, e, a, b, F4, K4, M(78) );
|
||||
R( b, c, d, e, a, F4, K4, M(79) );
|
||||
|
||||
a = ctx->A += a;
|
||||
b = ctx->B += b;
|
||||
c = ctx->C += c;
|
||||
d = ctx->D += d;
|
||||
e = ctx->E += e;
|
||||
}
|
||||
}
|
||||
75
lib/sha.h
Normal file
75
lib/sha.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/* sha.h - Declaration of functions and datatypes for SHA1 sum computing
|
||||
library functions.
|
||||
|
||||
Copyright (C) 1999, Scott G. Miller
|
||||
*/
|
||||
|
||||
#ifndef _SHA_H
|
||||
# define _SHA_H 1
|
||||
|
||||
# include <stdio.h>
|
||||
# include "md5.h"
|
||||
|
||||
/* Structure to save state of computation between the single steps. */
|
||||
struct sha_ctx
|
||||
{
|
||||
md5_uint32 A;
|
||||
md5_uint32 B;
|
||||
md5_uint32 C;
|
||||
md5_uint32 D;
|
||||
md5_uint32 E;
|
||||
|
||||
md5_uint32 total[2];
|
||||
md5_uint32 buflen;
|
||||
char buffer[128];
|
||||
};
|
||||
|
||||
|
||||
/* Starting with the result of former calls of this function (or the
|
||||
initialization function update the context for the next LEN bytes
|
||||
starting at BUFFER.
|
||||
It is necessary that LEN is a multiple of 64!!! */
|
||||
extern void sha_process_block __P ((const void *buffer, size_t len,
|
||||
struct sha_ctx *ctx));
|
||||
|
||||
/* Starting with the result of former calls of this function (or the
|
||||
initialization function update the context for the next LEN bytes
|
||||
starting at BUFFER.
|
||||
It is NOT required that LEN is a multiple of 64. */
|
||||
extern void sha_process_bytes __P((const void *buffer, size_t len,
|
||||
struct sha_ctx *ctx));
|
||||
|
||||
/* Initialize structure containing state of computation. */
|
||||
extern void sha_init_ctx __P ((struct sha_ctx *ctx));
|
||||
|
||||
/* Process the remaining bytes in the buffer and put result from CTX
|
||||
in first 16 bytes following RESBUF. The result is always in little
|
||||
endian byte order, so that a byte-wise output yields to the wanted
|
||||
ASCII representation of the message digest.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
extern void *sha_finish_ctx __P ((struct sha_ctx *ctx, void *resbuf));
|
||||
|
||||
|
||||
/* Put result from CTX in first 16 bytes following RESBUF. The result is
|
||||
always in little endian byte order, so that a byte-wise output yields
|
||||
to the wanted ASCII representation of the message digest.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
extern void *sha_read_ctx __P ((const struct sha_ctx *ctx, void *resbuf));
|
||||
|
||||
|
||||
/* Compute MD5 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 16 bytes
|
||||
beginning at RESBLOCK. */
|
||||
extern int sha_stream __P ((FILE *stream, void *resblock));
|
||||
|
||||
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
digest. */
|
||||
extern void *sha_buffer __P ((const char *buffer, size_t len, void *resblock));
|
||||
|
||||
#endif
|
||||
@@ -98,8 +98,8 @@ extern char *tzname[];
|
||||
# define L_(Str) L##Str
|
||||
# define NLW(Sym) _NL_W##Sym
|
||||
|
||||
# define MEMCPY(d, s, n) wmemcpy (d, s, n)
|
||||
# define STRLEN(s) wcslen (s)
|
||||
# define MEMCPY(d, s, n) __wmemcpy (d, s, n)
|
||||
# define STRLEN(s) __wcslen (s)
|
||||
|
||||
#else
|
||||
# define CHAR_T char
|
||||
@@ -289,7 +289,7 @@ static const CHAR_T zeroes[16] = /* "0000000000000000" */
|
||||
else if (to_uppcase) \
|
||||
memcpy_uppcase (p, (s), _n); \
|
||||
else \
|
||||
MEMCPY ((PTR) p, (PTR) (s), _n))
|
||||
MEMCPY ((PTR) p, (const PTR) (s), _n))
|
||||
|
||||
#ifdef COMPILE_WIDE
|
||||
# define widen(os, ws, l) \
|
||||
@@ -457,8 +457,7 @@ static CHAR_T const month_name[][10] =
|
||||
return _strftime_copytm (s, maxsize, format, &tmcopy ut_argument);
|
||||
}
|
||||
# undef my_strftime
|
||||
# define my_strftime(S, Maxsize, Format, Tp) \
|
||||
_strftime_copytm (S, Maxsize, Format, Tp)
|
||||
# define my_strftime _strftime_copytm
|
||||
#endif
|
||||
|
||||
|
||||
@@ -516,6 +515,9 @@ my_strftime (s, maxsize, format, tp ut_argument)
|
||||
size_t i = 0;
|
||||
CHAR_T *p = s;
|
||||
const CHAR_T *f;
|
||||
#if DO_MULTIBYTE && !defined COMPILE_WIDE
|
||||
const char *format_end = NULL;
|
||||
#endif
|
||||
|
||||
zone = NULL;
|
||||
#if HAVE_TM_ZONE
|
||||
@@ -608,10 +610,15 @@ my_strftime (s, maxsize, format, tp ut_argument)
|
||||
{
|
||||
mbstate_t mbstate = mbstate_zero;
|
||||
size_t len = 0;
|
||||
size_t fsize;
|
||||
|
||||
if (! format_end)
|
||||
format_end = f + strlen (f) + 1;
|
||||
fsize = format_end - f;
|
||||
|
||||
do
|
||||
{
|
||||
size_t bytes = mbrlen (f + len, (size_t) -1, &mbstate);
|
||||
size_t bytes = mbrlen (f + len, fsize - len, &mbstate);
|
||||
|
||||
if (bytes == 0)
|
||||
break;
|
||||
@@ -752,6 +759,11 @@ my_strftime (s, maxsize, format, tp ut_argument)
|
||||
|
||||
case L_('b'):
|
||||
case L_('h'): /* POSIX.2 extension. */
|
||||
if (change_case)
|
||||
{
|
||||
to_uppcase = 1;
|
||||
to_lowcase = 0;
|
||||
}
|
||||
if (modifier != 0)
|
||||
goto bad_format;
|
||||
#if defined _NL_CURRENT || !HAVE_STRFTIME
|
||||
@@ -781,10 +793,11 @@ my_strftime (s, maxsize, format, tp ut_argument)
|
||||
goto bad_format;
|
||||
#ifdef _NL_CURRENT
|
||||
if (! (modifier == 'E'
|
||||
&& (*(subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME,
|
||||
NLW(ERA_D_T_FMT)))
|
||||
&& (*(subfmt =
|
||||
(const CHAR_T *) _NL_CURRENT (LC_TIME,
|
||||
NLW(ERA_D_T_FMT)))
|
||||
!= '\0')))
|
||||
subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_T_FMT));
|
||||
subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_T_FMT));
|
||||
#else
|
||||
# if HAVE_STRFTIME
|
||||
goto underlying_strftime;
|
||||
@@ -796,8 +809,10 @@ my_strftime (s, maxsize, format, tp ut_argument)
|
||||
subformat:
|
||||
{
|
||||
CHAR_T *old_start = p;
|
||||
size_t len = my_strftime (NULL, (size_t) -1, subfmt, tp);
|
||||
add (len, my_strftime (p, maxsize - i, subfmt, tp));
|
||||
size_t len = my_strftime (NULL, (size_t) -1, subfmt,
|
||||
tp ut_argument);
|
||||
add (len, my_strftime (p, maxsize - i, subfmt,
|
||||
tp ut_argument));
|
||||
|
||||
if (to_uppcase)
|
||||
while (old_start < p)
|
||||
@@ -848,7 +863,7 @@ my_strftime (s, maxsize, format, tp ut_argument)
|
||||
if (era)
|
||||
{
|
||||
# ifdef COMPILE_WIDE
|
||||
size_t len = wcslen (era->era_wname);
|
||||
size_t len = __wcslen (era->era_wname);
|
||||
cpy (len, era->era_wname);
|
||||
# else
|
||||
size_t len = strlen (era->era_name);
|
||||
@@ -873,10 +888,10 @@ my_strftime (s, maxsize, format, tp ut_argument)
|
||||
goto bad_format;
|
||||
#ifdef _NL_CURRENT
|
||||
if (! (modifier == L_('E')
|
||||
&& (*(subfmt = (CHAR_T *)_NL_CURRENT (LC_TIME,
|
||||
NLW(ERA_D_FMT)))
|
||||
&& (*(subfmt =
|
||||
(const CHAR_T *)_NL_CURRENT (LC_TIME, NLW(ERA_D_FMT)))
|
||||
!= L_('\0'))))
|
||||
subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_FMT));
|
||||
subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(D_FMT));
|
||||
goto subformat;
|
||||
#else
|
||||
# if HAVE_STRFTIME
|
||||
@@ -1059,8 +1074,9 @@ my_strftime (s, maxsize, format, tp ut_argument)
|
||||
|
||||
case L_('r'): /* POSIX.2 extension. */
|
||||
#ifdef _NL_CURRENT
|
||||
if (*(subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME,
|
||||
NLW(T_FMT_AMPM))) == L_('\0'))
|
||||
if (*(subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME,
|
||||
NLW(T_FMT_AMPM)))
|
||||
== L_('\0'))
|
||||
#endif
|
||||
subfmt = L_("%I:%M:%S %p");
|
||||
goto subformat;
|
||||
@@ -1115,10 +1131,10 @@ my_strftime (s, maxsize, format, tp ut_argument)
|
||||
goto bad_format;
|
||||
#ifdef _NL_CURRENT
|
||||
if (! (modifier == L_('E')
|
||||
&& (*(subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME,
|
||||
NLW(ERA_T_FMT)))
|
||||
&& (*(subfmt =
|
||||
(const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ERA_T_FMT)))
|
||||
!= L_('\0'))))
|
||||
subfmt = (CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT));
|
||||
subfmt = (const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(T_FMT));
|
||||
goto subformat;
|
||||
#else
|
||||
# if HAVE_STRFTIME
|
||||
|
||||
@@ -19,12 +19,16 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
|
||||
#if STDC_HEADERS || HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#ifndef ISSLASH
|
||||
# define ISSLASH(C) ((C) == '/')
|
||||
#endif
|
||||
|
||||
/* Remove trailing slashes from PATH.
|
||||
This is useful when using filename completion from a shell that
|
||||
adds a "/" after directory names (such as tcsh and bash), because
|
||||
@@ -37,6 +41,6 @@ strip_trailing_slashes (char *path)
|
||||
int last;
|
||||
|
||||
last = strlen (path) - 1;
|
||||
while (last > 0 && path[last] == '/')
|
||||
while (0 < last && ISSLASH (path[last]))
|
||||
path[last--] = '\0';
|
||||
}
|
||||
|
||||
@@ -28,11 +28,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#if defined _LIBC || defined HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef unsigned chartype;
|
||||
|
||||
#undef strstr
|
||||
|
||||
char *
|
||||
strstr (const char *phaystack, const char *pneedle)
|
||||
{
|
||||
@@ -105,7 +109,7 @@ jin: a = *++haystack;
|
||||
}
|
||||
while (*rhaystack == a);
|
||||
|
||||
needle = rneedle; /* took the register-poor aproach */
|
||||
needle = rneedle; /* took the register-poor approach */
|
||||
|
||||
if (a == '\0')
|
||||
break;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#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 */
|
||||
fractional parts, S_Z: idem but with leading Zeroes only */
|
||||
#define S_N 0x0
|
||||
#define S_I 0x4
|
||||
#define S_F 0x8
|
||||
@@ -36,6 +36,7 @@
|
||||
#define CMP 2
|
||||
#define LEN 3
|
||||
|
||||
|
||||
/* 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.
|
||||
@@ -46,13 +47,20 @@
|
||||
host does not conform to Posix. */
|
||||
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
|
||||
|
||||
#undef __strverscmp
|
||||
#undef strverscmp
|
||||
|
||||
#ifndef weak_alias
|
||||
# define __strverscmp strverscmp
|
||||
#endif
|
||||
|
||||
/* 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 (const char *s1, const char *s2)
|
||||
__strverscmp (const char *s1, const char *s2)
|
||||
{
|
||||
const unsigned char *p1 = (const unsigned char *) s1;
|
||||
const unsigned char *p2 = (const unsigned char *) s2;
|
||||
@@ -120,3 +128,6 @@ strverscmp (const char *s1, const char *s2)
|
||||
return state;
|
||||
}
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (__strverscmp, strverscmp)
|
||||
#endif
|
||||
|
||||
@@ -170,7 +170,9 @@ print_unicode_char (FILE *stream, unsigned int code)
|
||||
outbytesleft = sizeof (outbuf);
|
||||
|
||||
/* Convert the character from UTF-8 to the locale's charset. */
|
||||
res = iconv (utf8_to_local, &inptr, &inbytesleft, &outptr, &outbytesleft);
|
||||
res = iconv (utf8_to_local,
|
||||
(ICONV_CONST char **)&inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if (inbytesleft > 0 || res == (size_t)(-1)
|
||||
/* Irix iconv() inserts a NUL byte if it cannot convert. */
|
||||
# if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi)
|
||||
|
||||
@@ -40,6 +40,14 @@ char *alloca ();
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
|
||||
#if HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
@@ -58,6 +66,7 @@ char *alloca ();
|
||||
#endif
|
||||
|
||||
#include "xalloc.h"
|
||||
#include "xstrtol.h"
|
||||
|
||||
#if ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
@@ -81,6 +90,34 @@ struct group *getgrgid ();
|
||||
# define endpwent() ((void) 0)
|
||||
#endif
|
||||
|
||||
#ifndef CHAR_BIT
|
||||
# define CHAR_BIT 8
|
||||
#endif
|
||||
|
||||
/* The extra casts work around common compiler bugs. */
|
||||
#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
|
||||
/* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
|
||||
It is necessary at least when t == time_t. */
|
||||
#define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
|
||||
? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0))
|
||||
#define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t)))
|
||||
|
||||
#ifndef UID_T_MAX
|
||||
# define UID_T_MAX TYPE_MAXIMUM (uid_t)
|
||||
#endif
|
||||
|
||||
#ifndef GID_T_MAX
|
||||
# define GID_T_MAX TYPE_MAXIMUM (gid_t)
|
||||
#endif
|
||||
|
||||
/* MAXUID may come from limits.h or sys/params.h. */
|
||||
#ifndef MAXUID
|
||||
# define MAXUID UID_T_MAX
|
||||
#endif
|
||||
#ifndef MAXGID
|
||||
# define MAXGID GID_T_MAX
|
||||
#endif
|
||||
|
||||
/* Perform the equivalent of the statement `dest = strdup (src);',
|
||||
but obtaining storage via alloca instead of from the heap. */
|
||||
|
||||
@@ -126,8 +163,8 @@ is_number (const char *str)
|
||||
use the given user's login group.
|
||||
If SPEC_ARG contains a `:', then use that as the separator, ignoring
|
||||
any `.'s. If there is no `:', but there is a `.', then first look
|
||||
up SPEC_ARG as a login name. If that look-up fails, then try again
|
||||
interpreting the `.' as a separator.
|
||||
up the entire SPEC_ARG as a login name. If that look-up fails, then
|
||||
try again interpreting the `.' as a separator.
|
||||
|
||||
USERNAME and GROUPNAME will be in newly malloc'd memory.
|
||||
Either one might be NULL instead, indicating that it was not
|
||||
@@ -220,8 +257,11 @@ parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid,
|
||||
error_msg = E_bad_spec;
|
||||
else
|
||||
{
|
||||
/* FIXME: don't use atoi! */
|
||||
*uid = atoi (u);
|
||||
unsigned long int tmp_long;
|
||||
if (xstrtoul (u, NULL, 0, &tmp_long, NULL) != LONGINT_OK
|
||||
|| tmp_long > MAXUID)
|
||||
return _(E_invalid_user);
|
||||
*uid = tmp_long;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -263,8 +303,11 @@ parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid,
|
||||
error_msg = E_invalid_group;
|
||||
else
|
||||
{
|
||||
/* FIXME: don't use atoi! */
|
||||
*gid = atoi (g);
|
||||
unsigned long int tmp_long;
|
||||
if (xstrtoul (g, NULL, 0, &tmp_long, NULL) != LONGINT_OK
|
||||
|| tmp_long > MAXGID)
|
||||
return _(E_invalid_group);
|
||||
*gid = tmp_long;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* xalloc.h -- malloc with out-of-memory checking
|
||||
Copyright (C) 1990-1998, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990-1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -52,7 +52,7 @@ void free ();
|
||||
|
||||
char *xmalloc ();
|
||||
|
||||
/* lstat works different on Linux and Solaris systems. POSIX (see
|
||||
/* lstat works differently on Linux and Solaris systems. POSIX (see
|
||||
`pathname resolution' in the glossary) requires that programs like `ls'
|
||||
take into consideration the fact that FILE has a trailing slash when
|
||||
FILE is a symbolic link. On Linux systems, the lstat function already
|
||||
|
||||
@@ -199,6 +199,7 @@ __xstrtol (const char *s, char **ptr, int strtol_base,
|
||||
break;
|
||||
|
||||
case 'G': /* Giga */
|
||||
case 'g': /* 'g' is undocumented; for compatibility only */
|
||||
overflow = bkm_scale_by_power (&tmp, base, 3);
|
||||
break;
|
||||
|
||||
@@ -207,7 +208,7 @@ __xstrtol (const char *s, char **ptr, int strtol_base,
|
||||
break;
|
||||
|
||||
case 'M': /* Mega */
|
||||
case 'm': /* 'm' is undocumented; for backward compatibility only */
|
||||
case 'm': /* 'm' is undocumented; for compatibility only */
|
||||
overflow = bkm_scale_by_power (&tmp, base, 2);
|
||||
break;
|
||||
|
||||
@@ -216,6 +217,7 @@ __xstrtol (const char *s, char **ptr, int strtol_base,
|
||||
break;
|
||||
|
||||
case 'T': /* Tera */
|
||||
case 't': /* 't' is undocumented; for compatibility only */
|
||||
overflow = bkm_scale_by_power (&tmp, base, 4);
|
||||
break;
|
||||
|
||||
|
||||
138
m4/ChangeLog
138
m4/ChangeLog
@@ -1,3 +1,137 @@
|
||||
2001-01-15 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* iconv.m4 (jm_ICONV): Also check whether the iconv declaration
|
||||
has const.
|
||||
|
||||
2001-01-20 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Be sure that headers are checked before used in code compiled
|
||||
for the type checks.
|
||||
* jm-macros.m4 (jm_MACROS): Remove all header checks.
|
||||
In place of that, invoke jm_CHECK_ALL_TYPES.
|
||||
(jm_CHECK_ALL_HEADERS): New functions with the above checks.
|
||||
(jm_CHECK_ALL_TYPES): Require jm_CHECK_ALL_HEADERS.
|
||||
Alan Iwi reported a build failure on an f300-fujitsu-uxpv4.1_ES;
|
||||
The check for ssize_t was mistakenly run before the test for unistd.h.
|
||||
|
||||
The configure-time check for stdbool.h was missing.
|
||||
* prereq.m4 (jm_PREREQ): Add jm_PREREQ_HASH.
|
||||
(jm_PREREQ_HASH): New function.
|
||||
|
||||
2001-01-17 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* fsusage.m4 (jm_FILE_SYSTEM_USAGE): Use AS_IF, not AS_IFELSE,
|
||||
for autoconf-2.49c.
|
||||
* ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS): Likewise.
|
||||
|
||||
2001-01-14 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* rename.m4: Use temporary directories named conftestdir{,2}, not
|
||||
foo and bar. Create conftestdir/ in the script, not in the C code.
|
||||
Remove directories in the script, not in the C code.
|
||||
Remove conftestdir{,2} before trying to create the directory.
|
||||
Make the entire configure script fail if the mkdir fails.
|
||||
|
||||
2001-01-02 Volker Borchert <bt@teknon.de>
|
||||
|
||||
* rename.m4: New file.
|
||||
* jm-macros.m4 (jm_MACROS): Require vb_FUNC_RENAME.
|
||||
|
||||
2001-01-01 Alexandre Duret-Lutz <duret_g@epita.fr>
|
||||
|
||||
* libintl.m4 (AM_GNU_GETTEXT): Define MKINSTALLDIRS by
|
||||
expanding the value of $ac_aux_dir, as in AM_MISSING_HAS_RUN,
|
||||
so `make install' also works in VPATH builds.
|
||||
|
||||
2001-01-01 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* prereq.m4 (jm_PREREQ_READUTMP): Include utmp.h (if available), even
|
||||
on systems with utmpx.h. It's necessary for the declaration of utmp's
|
||||
ut_user member. Reported by Andreas Jaeger.
|
||||
|
||||
* check-decl.m4 (jm_CHECK_DECLS): Include grp.h and pwd.h if available.
|
||||
They are required for the declarations of getgrgid and getpwuid resp.
|
||||
(_jm_DECL_HEADERS): Check for grp.h and pwd.h.
|
||||
Reported by Andreas Jaeger.
|
||||
|
||||
2000-12-25 Alexandre Duret-Lutz <duret_g@epita.fr>
|
||||
|
||||
* libintl.m4 (AM_WITH_NLS): When using AC_CONFIG_AUX_DIR,
|
||||
prepend $(top_srcdir) to the value of MKINSTALLDIRS so that it
|
||||
can be used in subdirectories.
|
||||
|
||||
2000-12-26 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* dos.m4 (jm_AC_DOS): Rewrite (though it's still a stub) to work better
|
||||
with autoheader.
|
||||
|
||||
2000-12-17 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* dos.m4 (jm_AC_DOS): New file and macro.
|
||||
* jm-macros.m4 (jm_MACROS): Require jm_AC_DOS.
|
||||
|
||||
2000-12-06 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* off_t-format.m4: Remove this file.
|
||||
* jm-macros.m4 (jm_MACROS): Remove jm_SYS_OFF_T_PRINTF_FORMAT.
|
||||
|
||||
2000-12-06 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): If we need the replacement
|
||||
strtoull, we may well need the replacement strtoul, too.
|
||||
Check for declarations of strtoul and strtoull.
|
||||
Check for strtol. Mainly as a cue to cause automake to include
|
||||
strtol.c -- that file is included by each of strtoul.c and strtoull.c.
|
||||
Check for limits.h -- strtol.c needs it.
|
||||
|
||||
2000-12-02 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* off_t-format.m4 (OFF_T_PRINTF_FORMAT_STRING): New file/macro.
|
||||
* jm-macros.m4 (jm_MACROS): require it.
|
||||
|
||||
2000-11-30 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* jm-macros.m4 (jm_MACROS): Check for stdint.h.
|
||||
|
||||
2000-11-30 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* getloadavg.m4: s/ifval/m4_ifval/ to accommodate new autoconf.
|
||||
|
||||
2000-11-03 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* jm-macros.m4 (jm_MACROS): Add test for wcrtomb.
|
||||
|
||||
2000-11-04 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* regex.m4: Use the `m4_' prefix on `syscmd' and `m4_sysval'.
|
||||
|
||||
2000-10-29 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* fsusage.m4: s/AC_SHELL_IFELSE/AS_IFELSE/ to match autoconf renaming.
|
||||
* ls-mntd-fs.m4: Likewise
|
||||
|
||||
2000-10-28 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* prereq.m4 (jm_PREREQ): Add jm_PREREQ_MEMCHR.
|
||||
(jm_PREREQ_MEMCHR): New function.
|
||||
|
||||
2000-10-21 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* check-decl.m4 (jm_CHECK_DECLS): Also check for memrchr.
|
||||
* prereq.m4 (jm_PREREQ_DIRNAME): New macro.
|
||||
* jm-macros.m4 (AC_REPLACE_FUNCS): Add memrchr.
|
||||
|
||||
2000-09-18 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* getloadavg.m4 (AC_FUNC_GETLOADAVG): Restore the initial value of LIBS.
|
||||
Otherwise, everyone ends up linking with -lelf for some configurations.
|
||||
Reported by Mike Stone.
|
||||
|
||||
2000-08-26 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* jm-macros.m4: Use jm_FUNC_FPENDING.
|
||||
* fpending.m4: New file.
|
||||
|
||||
2000-08-20 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* check-decl.m4: Include utmp.h `#if HAVE_UTMP_H', rather than
|
||||
@@ -27,8 +161,8 @@
|
||||
|
||||
2000-07-16 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* mbswidth.m4: New file.
|
||||
* prereq.m4 (jm_PREREQ): Call jm_PREREQ_MBSWIDTH.
|
||||
* mbswidth.m4: New file.
|
||||
* prereq.m4 (jm_PREREQ): Call jm_PREREQ_MBSWIDTH.
|
||||
|
||||
2000-07-14 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
|
||||
@@ -11,8 +11,10 @@ chown.m4 \
|
||||
codeset.m4 \
|
||||
d-ino.m4 \
|
||||
d-type.m4 \
|
||||
dos.m4 \
|
||||
error.m4 \
|
||||
fnmatch.m4 \
|
||||
fpending.m4 \
|
||||
fstypename.m4 \
|
||||
fsusage.m4 \
|
||||
ftruncate.m4 \
|
||||
@@ -50,6 +52,7 @@ putenv.m4 \
|
||||
readdir.m4 \
|
||||
realloc.m4 \
|
||||
regex.m4 \
|
||||
rename.m4 \
|
||||
rmdir-errno.m4 \
|
||||
search-libs.m4 \
|
||||
st_dm_mode.m4 \
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Makefile.in generated automatically by automake 1.4a from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.4b from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
|
||||
# Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
@@ -125,8 +126,10 @@ chown.m4 \
|
||||
codeset.m4 \
|
||||
d-ino.m4 \
|
||||
d-type.m4 \
|
||||
dos.m4 \
|
||||
error.m4 \
|
||||
fnmatch.m4 \
|
||||
fpending.m4 \
|
||||
fstypename.m4 \
|
||||
fsusage.m4 \
|
||||
ftruncate.m4 \
|
||||
@@ -164,6 +167,7 @@ putenv.m4 \
|
||||
readdir.m4 \
|
||||
realloc.m4 \
|
||||
regex.m4 \
|
||||
rename.m4 \
|
||||
rmdir-errno.m4 \
|
||||
search-libs.m4 \
|
||||
st_dm_mode.m4 \
|
||||
|
||||
@@ -3,7 +3,7 @@ and textutils packages.
|
||||
|
||||
These files are used by a program called aclocal (part of the GNU automake
|
||||
package). aclocal uses these files to create aclocal.m4 which is in turn
|
||||
used by autoconf to create the configure script at the the top level in
|
||||
used by autoconf to create the configure script at the top level in
|
||||
this distribution.
|
||||
|
||||
The Makefile.am file in this directory is automatically generated
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 15
|
||||
#serial 17
|
||||
|
||||
dnl This is just a wrapper function to encapsulate this kludge.
|
||||
dnl Putting it in a separate file like this helps share it between
|
||||
@@ -41,6 +41,14 @@ AC_DEFUN(jm_CHECK_DECLS,
|
||||
#if HAVE_UTMP_H
|
||||
# include <utmp.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_GRP_H
|
||||
# include <grp.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_PWD_H
|
||||
# include <pwd.h>
|
||||
#endif
|
||||
'
|
||||
|
||||
AC_CHECK_DECLS([
|
||||
@@ -55,6 +63,7 @@ AC_DEFUN(jm_CHECK_DECLS,
|
||||
lseek,
|
||||
malloc,
|
||||
memchr,
|
||||
memrchr,
|
||||
nanosleep,
|
||||
realloc,
|
||||
stpcpy,
|
||||
@@ -71,6 +80,6 @@ dnl This is a little helper so we can require these header checks.
|
||||
AC_DEFUN(_jm_DECL_HEADERS,
|
||||
[
|
||||
AC_REQUIRE([AC_HEADER_STDC])
|
||||
AC_CHECK_HEADERS(memory.h string.h strings.h stdlib.h unistd.h sys/time.h \
|
||||
utmp.h utmpx.h)
|
||||
AC_CHECK_HEADERS(grp.h memory.h pwd.h string.h strings.h stdlib.h \
|
||||
unistd.h sys/time.h utmp.h utmpx.h)
|
||||
])
|
||||
|
||||
41
m4/dos.m4
Normal file
41
m4/dos.m4
Normal file
@@ -0,0 +1,41 @@
|
||||
# serial 2
|
||||
|
||||
# Define some macros required for proper operation of code in lib/*.c
|
||||
# on MSDOS/Windows systems.
|
||||
|
||||
# From Jim Meyering.
|
||||
|
||||
AC_DEFUN(jm_AC_DOS,
|
||||
[
|
||||
# FIXME: this is incomplete. Add a compile-test that does something
|
||||
# like this:
|
||||
#if defined _WIN32 || defined __WIN32__ || defined __MSDOS__
|
||||
|
||||
AH_VERBATIM(FILESYSTEM_PREFIX_LEN,
|
||||
[#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
|
||||
# define FILESYSTEM_PREFIX_LEN(Filename) \
|
||||
((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
|
||||
else
|
||||
# define FILESYSTEM_PREFIX_LEN(Filename) 0
|
||||
#endif])
|
||||
|
||||
ac_fs_accepts_drive_letter_prefix=0
|
||||
AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
|
||||
$ac_fs_accepts_drive_letter_prefix,
|
||||
[Define on systems for which file names may have a so-called
|
||||
`drive letter' prefix, define this to compute the length of that
|
||||
prefix, including the colon.])
|
||||
|
||||
AH_VERBATIM(ISSLASH,
|
||||
[#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
|
||||
# define ISSLASH(C) ((C) == '/' || (C) == '\\\\')
|
||||
#else
|
||||
# define ISSLASH(C) ((C) == '/')
|
||||
#endif])
|
||||
|
||||
ac_fs_backslash_is_file_name_separator=0
|
||||
AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
|
||||
$ac_fs_backslash_is_file_name_separator,
|
||||
[Define if the backslash character may also serve as a file name
|
||||
component separator.])
|
||||
])
|
||||
75
m4/fpending.m4
Normal file
75
m4/fpending.m4
Normal file
@@ -0,0 +1,75 @@
|
||||
#serial 1
|
||||
|
||||
dnl From Jim Meyering
|
||||
dnl Using code from emacs, based on suggestions from Paul Eggert
|
||||
dnl and Ulrich Drepper.
|
||||
|
||||
dnl Find out how to determine the number of pending output bytes on a stream.
|
||||
dnl glibc (2.1.93 and newer) and Solaris provide __fpending. On other systems,
|
||||
dnl we have to grub around in the FILE struct.
|
||||
|
||||
AC_DEFUN(jm_FUNC_FPENDING,
|
||||
[
|
||||
AC_CHECK_HEADERS(stdio_ext.h)
|
||||
AC_REPLACE_FUNCS([__fpending])
|
||||
fp_headers='
|
||||
# if HAVE_STDIO_EXT_H
|
||||
# include <stdio_ext.h>
|
||||
# endif
|
||||
'
|
||||
AC_CHECK_DECLS([__fpending], , , $fp_headers)
|
||||
if test $ac_cv_func___fpending = no; then
|
||||
AC_CACHE_CHECK(
|
||||
[how to determine the number of pending output bytes on a stream],
|
||||
ac_cv_sys_pending_output_n_bytes,
|
||||
[
|
||||
fp_save_DEFS=$DEFS
|
||||
for ac_expr in \
|
||||
\
|
||||
'# glibc2' \
|
||||
'fp->_IO_write_ptr - fp->_IO_write_base' \
|
||||
\
|
||||
'# traditional Unix' \
|
||||
'fp->_ptr - fp->_base' \
|
||||
\
|
||||
'# BSD' \
|
||||
'fp->_p - fp->_bf._base' \
|
||||
\
|
||||
'# SCO, Unixware' \
|
||||
'fp->__ptr - fp->__base' \
|
||||
\
|
||||
'# old glibc?' \
|
||||
'fp->__bufp - fp->__buffer' \
|
||||
\
|
||||
'# old glibc iostream?' \
|
||||
'fp->_pptr - fp->_pbase' \
|
||||
\
|
||||
'# VMS' \
|
||||
'(*fp)->_ptr - (*fp)->_base' \
|
||||
\
|
||||
'# e.g., DGUX R4.11; the info is not available' \
|
||||
1 \
|
||||
; do
|
||||
|
||||
# Skip each embedded comment.
|
||||
case "$ac_expr" in '#'*) continue;; esac
|
||||
|
||||
DEFS="$DEFS -DPENDING_OUTPUT_N_BYTES=$ac_expr"
|
||||
AC_TRY_COMPILE(
|
||||
[#include <stdio.h>
|
||||
],
|
||||
[FILE *fp = stdin; (void) ($ac_expr);],
|
||||
fp_done=yes
|
||||
)
|
||||
DEFS=$fp_save_DEFS
|
||||
test "$fp_done" = yes && break
|
||||
done
|
||||
|
||||
ac_cv_sys_pending_output_n_bytes=$ac_expr
|
||||
]
|
||||
)
|
||||
AC_DEFINE_UNQUOTED(PENDING_OUTPUT_N_BYTES,
|
||||
$ac_cv_sys_pending_output_n_bytes,
|
||||
[the number of pending output bytes on stream `fp'])
|
||||
fi
|
||||
])
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 3
|
||||
#serial 5
|
||||
|
||||
# From fileutils/configure.in
|
||||
|
||||
@@ -187,6 +187,6 @@ AC_TRY_CPP([#include <sys/filsys.h>],
|
||||
ac_fsusage_space=yes)
|
||||
fi
|
||||
|
||||
AC_SHELL_IFELSE([test $ac_fsusage_space = yes], [$1], [$2])dnl
|
||||
AS_IF([test $ac_fsusage_space = yes], [$1], [$2])dnl
|
||||
|
||||
])
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 7
|
||||
#serial 8
|
||||
|
||||
# A replacement for autoconf's macro by the same name. This version
|
||||
# accepts an optional argument specifying the name of the $srcdir-relative
|
||||
@@ -15,7 +15,7 @@ AC_DEFUN([AC_FUNC_GETLOADAVG],
|
||||
# By default, expect to find getloadavg.c in $srcdir/.
|
||||
ac_lib_dir_getloadavg=$srcdir
|
||||
# But if there's an argument, DIR, expect to find getloadavg.c in $srcdir/DIR.
|
||||
ifval([$1], [ac_lib_dir_getloadavg=$srcdir/$1])
|
||||
m4_ifval([$1], [ac_lib_dir_getloadavg=$srcdir/$1])
|
||||
# Make sure getloadavg.c is where it belongs, at ./configure-time.
|
||||
test -f $ac_lib_dir_getloadavg/getloadavg.c \
|
||||
|| AC_MSG_ERROR([getloadavg.c is not in $ac_lib_dir_getloadavg])
|
||||
@@ -99,5 +99,7 @@ if test "x$ac_save_LIBS" = x; then
|
||||
else
|
||||
GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$ac_save_LIBS!!"`
|
||||
fi
|
||||
LIBS=$ac_save_LIBS
|
||||
|
||||
AC_SUBST(GETLOADAVG_LIBS)dnl
|
||||
])# AC_FUNC_GETLOADAVG
|
||||
|
||||
23
m4/iconv.m4
23
m4/iconv.m4
@@ -1,4 +1,4 @@
|
||||
#serial 1
|
||||
#serial 2
|
||||
|
||||
dnl From Bruno Haible.
|
||||
|
||||
@@ -30,6 +30,27 @@ AC_DEFUN(jm_ICONV,
|
||||
])
|
||||
if test "$jm_cv_func_iconv" = yes; then
|
||||
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
|
||||
AC_MSG_CHECKING([for iconv declaration])
|
||||
AC_CACHE_VAL(jm_cv_proto_iconv, [
|
||||
AC_TRY_COMPILE([
|
||||
#include <stdlib.h>
|
||||
#include <iconv.h>
|
||||
extern
|
||||
#ifdef __cplusplus
|
||||
"C"
|
||||
#endif
|
||||
#if defined(__STDC__) || defined(__cplusplus)
|
||||
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t* outbytesleft);
|
||||
#else
|
||||
size_t iconv();
|
||||
#endif
|
||||
], [], jm_cv_proto_iconv_arg1="", jm_cv_proto_iconv_arg1="const")
|
||||
jm_cv_proto_iconv="extern size_t iconv (iconv_t cd, $jm_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t* outbytesleft);"])
|
||||
jm_cv_proto_iconv=`echo "[$]jm_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
|
||||
AC_MSG_RESULT([$]{ac_t:-
|
||||
}[$]jm_cv_proto_iconv)
|
||||
AC_DEFINE_UNQUOTED(ICONV_CONST, $jm_cv_proto_iconv_arg1,
|
||||
[Define as const if the declaration of iconv() needs const.])
|
||||
fi
|
||||
LIBICONV=
|
||||
if test "$jm_cv_lib_iconv" = yes; then
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 25
|
||||
#serial 31 -*- autoconf -*-
|
||||
|
||||
dnl Misc type-related macros for fileutils, sh-utils, textutils.
|
||||
|
||||
@@ -19,44 +19,7 @@ AC_DEFUN(jm_MACROS,
|
||||
dnl This macro actually runs replacement code. See isc-posix.m4.
|
||||
AC_REQUIRE([AC_ISC_POSIX])dnl
|
||||
|
||||
AC_CHECK_HEADERS( \
|
||||
errno.h \
|
||||
fcntl.h \
|
||||
fenv.h \
|
||||
float.h \
|
||||
limits.h \
|
||||
memory.h \
|
||||
mntent.h \
|
||||
mnttab.h \
|
||||
netdb.h \
|
||||
paths.h \
|
||||
stdlib.h \
|
||||
stddef.h \
|
||||
string.h \
|
||||
sys/acl.h \
|
||||
sys/filsys.h \
|
||||
sys/fs/s5param.h \
|
||||
sys/fs_types.h \
|
||||
sys/fstyp.h \
|
||||
sys/ioctl.h \
|
||||
sys/mntent.h \
|
||||
sys/mount.h \
|
||||
sys/param.h \
|
||||
sys/socket.h \
|
||||
sys/statfs.h \
|
||||
sys/statvfs.h \
|
||||
sys/systeminfo.h \
|
||||
sys/time.h \
|
||||
sys/timeb.h \
|
||||
sys/vfs.h \
|
||||
sys/wait.h \
|
||||
syslog.h \
|
||||
termios.h \
|
||||
unistd.h \
|
||||
utime.h \
|
||||
values.h \
|
||||
)
|
||||
|
||||
jm_CHECK_ALL_TYPES
|
||||
jm_INCLUDED_REGEX([lib/regex.c])
|
||||
|
||||
AC_REQUIRE([jm_BISON])
|
||||
@@ -92,6 +55,7 @@ AC_DEFUN(jm_MACROS,
|
||||
AC_REQUIRE([AM_FUNC_ERROR_AT_LINE])
|
||||
AC_REQUIRE([jm_FUNC_GNU_STRFTIME])
|
||||
AC_REQUIRE([jm_FUNC_MKTIME])
|
||||
AC_REQUIRE([jm_FUNC_FPENDING])
|
||||
|
||||
AC_REQUIRE([jm_FUNC_GETGROUPS])
|
||||
test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
|
||||
@@ -101,6 +65,7 @@ AC_DEFUN(jm_MACROS,
|
||||
AC_FUNC_GETLOADAVG([lib])
|
||||
AC_REQUIRE([jm_SYS_PROC_UPTIME])
|
||||
AC_REQUIRE([jm_FUNC_FTRUNCATE])
|
||||
AC_REQUIRE([vb_FUNC_RENAME])
|
||||
|
||||
AC_REPLACE_FUNCS(strcasecmp strncasecmp)
|
||||
AC_REPLACE_FUNCS(dup2)
|
||||
@@ -115,7 +80,7 @@ AC_DEFUN(jm_MACROS,
|
||||
dnl used by e.g. intl/*domain.c and lib/canon-host.c
|
||||
AC_REPLACE_FUNCS(strdup)
|
||||
|
||||
AC_REPLACE_FUNCS(memchr memmove memcpy memset)
|
||||
AC_REPLACE_FUNCS(memchr memcpy memmove memrchr memset)
|
||||
AC_CHECK_FUNCS(getpagesize)
|
||||
|
||||
# By default, argmatch should fail calling usage (1).
|
||||
@@ -175,6 +140,7 @@ AC_DEFUN(jm_MACROS,
|
||||
strerror \
|
||||
strrchr \
|
||||
sysinfo \
|
||||
wcrtomb \
|
||||
tzset \
|
||||
)
|
||||
|
||||
@@ -220,9 +186,55 @@ AC_DEFUN(jm_MACROS,
|
||||
AC_LIBOBJ(fsusage)
|
||||
AC_LIBOBJ(mountlist)
|
||||
fi
|
||||
AC_REQUIRE([jm_AC_DOS])
|
||||
|
||||
])
|
||||
|
||||
# These tests must be run before any use of AC_CHECK_TYPE,
|
||||
# because that macro compiles code that tests e.g., HAVE_UNISTD_H.
|
||||
# See the definition of ac_includes_default in `configure'.
|
||||
AC_DEFUN(jm_CHECK_ALL_HEADERS,
|
||||
[
|
||||
AC_CHECK_HEADERS( \
|
||||
errno.h \
|
||||
fcntl.h \
|
||||
fenv.h \
|
||||
float.h \
|
||||
limits.h \
|
||||
memory.h \
|
||||
mntent.h \
|
||||
mnttab.h \
|
||||
netdb.h \
|
||||
paths.h \
|
||||
stdlib.h \
|
||||
stddef.h \
|
||||
stdint.h \
|
||||
string.h \
|
||||
sys/acl.h \
|
||||
sys/filsys.h \
|
||||
sys/fs/s5param.h \
|
||||
sys/fs_types.h \
|
||||
sys/fstyp.h \
|
||||
sys/ioctl.h \
|
||||
sys/mntent.h \
|
||||
sys/mount.h \
|
||||
sys/param.h \
|
||||
sys/socket.h \
|
||||
sys/statfs.h \
|
||||
sys/statvfs.h \
|
||||
sys/systeminfo.h \
|
||||
sys/time.h \
|
||||
sys/timeb.h \
|
||||
sys/vfs.h \
|
||||
sys/wait.h \
|
||||
syslog.h \
|
||||
termios.h \
|
||||
unistd.h \
|
||||
utime.h \
|
||||
values.h \
|
||||
)
|
||||
])
|
||||
|
||||
# This macro must be invoked before any tests that run the compiler.
|
||||
AC_DEFUN(jm_CHECK_ALL_TYPES,
|
||||
[
|
||||
@@ -249,6 +261,7 @@ AC_DEFUN(jm_CHECK_ALL_TYPES,
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
AC_REQUIRE([AC_C_LONG_DOUBLE])
|
||||
|
||||
AC_REQUIRE([jm_CHECK_ALL_HEADERS])
|
||||
AC_REQUIRE([AC_HEADER_DIRENT])
|
||||
AC_REQUIRE([AC_HEADER_STDC])
|
||||
AC_CHECK_MEMBERS([struct stat.st_blksize],,,[$ac_includes_default
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
# serial 109
|
||||
# serial 110
|
||||
|
||||
AC_PREREQ(2.13) dnl Minimum Autoconf version required.
|
||||
|
||||
@@ -289,7 +289,7 @@ strdup __argz_count __argz_stringify __argz_next])
|
||||
dnl Try to locate it.
|
||||
MKINSTALLDIRS=
|
||||
if test -n "$ac_aux_dir"; then
|
||||
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
|
||||
MKINSTALLDIRS="`CDPATH=:; cd $ac_aux_dir && pwd`/mkinstalldirs"
|
||||
fi
|
||||
if test -z "$MKINSTALLDIRS"; then
|
||||
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 5
|
||||
#serial 7
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl
|
||||
@@ -6,8 +6,6 @@ dnl This is not pretty. I've just taken the autoconf code and wrapped
|
||||
dnl it in an AC_DEFUN.
|
||||
dnl
|
||||
|
||||
AC_PREREQ(2.14a)
|
||||
|
||||
# jm_LIST_MOUNTED_FILESYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
AC_DEFUN(jm_LIST_MOUNTED_FILESYSTEMS,
|
||||
[
|
||||
@@ -239,6 +237,6 @@ if test -z "$ac_list_mounted_fs"; then
|
||||
# Can't build mountlist.c or anything that needs its functions
|
||||
fi
|
||||
|
||||
AC_SHELL_IFELSE([test $ac_list_mounted_fs = found], [$1], [$2])dnl
|
||||
AS_IF([test $ac_list_mounted_fs = found], [$1], [$2])dnl
|
||||
|
||||
])
|
||||
|
||||
31
m4/prereq.m4
31
m4/prereq.m4
@@ -1,4 +1,4 @@
|
||||
#serial 11
|
||||
#serial 15
|
||||
|
||||
dnl These are the prerequisite macros for files in the lib/
|
||||
dnl directories of the fileutils, sh-utils, and textutils packages.
|
||||
@@ -7,10 +7,13 @@ AC_DEFUN(jm_PREREQ,
|
||||
[
|
||||
jm_PREREQ_ADDEXT
|
||||
jm_PREREQ_CANON_HOST
|
||||
jm_PREREQ_DIRNAME
|
||||
jm_PREREQ_ERROR
|
||||
jm_PREREQ_GETPAGESIZE
|
||||
jm_PREREQ_HASH
|
||||
jm_PREREQ_HUMAN
|
||||
jm_PREREQ_MBSWIDTH
|
||||
jm_PREREQ_MEMCHR
|
||||
jm_PREREQ_QUOTEARG
|
||||
jm_PREREQ_READUTMP
|
||||
jm_PREREQ_REGEX
|
||||
@@ -39,6 +42,24 @@ AC_DEFUN(jm_PREREQ_CANON_HOST,
|
||||
netinet/in.h arpa/inet.h)
|
||||
])
|
||||
|
||||
AC_DEFUN(jm_PREREQ_DIRNAME,
|
||||
[
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(string.h)
|
||||
])
|
||||
|
||||
AC_DEFUN(jm_PREREQ_GETPAGESIZE,
|
||||
[
|
||||
AC_CHECK_FUNCS(getpagesize)
|
||||
AC_CHECK_HEADERS(OS.h unistd.h)
|
||||
])
|
||||
|
||||
AC_DEFUN(jm_PREREQ_HASH,
|
||||
[
|
||||
AC_CHECK_HEADERS(stdlib.h stdbool.h)
|
||||
AC_REQUIRE([jm_CHECK_DECLS])
|
||||
])
|
||||
|
||||
# If you use human.c, you need the following files:
|
||||
# uintmax_t.m4 inttypes_h.m4 ulonglong.m4
|
||||
AC_DEFUN(jm_PREREQ_HUMAN,
|
||||
@@ -49,10 +70,9 @@ AC_DEFUN(jm_PREREQ_HUMAN,
|
||||
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
|
||||
])
|
||||
|
||||
AC_DEFUN(jm_PREREQ_GETPAGESIZE,
|
||||
AC_DEFUN(jm_PREREQ_MEMCHR,
|
||||
[
|
||||
AC_CHECK_FUNCS(getpagesize)
|
||||
AC_CHECK_HEADERS(OS.h unistd.h)
|
||||
AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h)
|
||||
])
|
||||
|
||||
AC_DEFUN(jm_PREREQ_QUOTEARG,
|
||||
@@ -78,7 +98,8 @@ AC_DEFUN(jm_PREREQ_READUTMP,
|
||||
$ac_includes_default
|
||||
#ifdef HAVE_UTMPX_H
|
||||
# include <utmpx.h>
|
||||
#else
|
||||
#endif
|
||||
#ifdef HAVE_UTMP_H
|
||||
# include <utmp.h>
|
||||
#endif
|
||||
"
|
||||
|
||||
@@ -51,10 +51,9 @@ AC_DEFUN(jm_INCLUDED_REGEX,
|
||||
fi
|
||||
|
||||
test -n "$1" || AC_MSG_ERROR([missing argument])
|
||||
syscmd([test -f $1])
|
||||
ifelse(sysval, 0,
|
||||
m4_syscmd([test -f $1])
|
||||
ifelse(m4_sysval, 0,
|
||||
[
|
||||
|
||||
AC_ARG_WITH(included-regex,
|
||||
[ --without-included-regex don't compile regex; this is the default on
|
||||
systems with version 2 of the GNU C library
|
||||
|
||||
40
m4/rename.m4
Normal file
40
m4/rename.m4
Normal file
@@ -0,0 +1,40 @@
|
||||
#serial 1
|
||||
|
||||
dnl From Volker Borchert.
|
||||
dnl Determine whether rename works for source paths with a trailing slash.
|
||||
dnl The rename from SunOS 4.1.1_U1 doesn't.
|
||||
dnl
|
||||
dnl If it doesn't, then define RENAME_TRAILING_SLASH_BUG and arrange
|
||||
dnl to compile the wrapper function.
|
||||
dnl
|
||||
|
||||
AC_DEFUN(vb_FUNC_RENAME,
|
||||
[
|
||||
AC_CACHE_CHECK([whether rename is broken],
|
||||
vb_cv_func_rename_trailing_slash_bug,
|
||||
[
|
||||
rm -rf conftestdir conftestdir2
|
||||
mkdir conftestdir ||
|
||||
AC_MSG_ERROR([cannot create temporary directory])
|
||||
AC_TRY_RUN([
|
||||
# include <stdio.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
exit (rename ("conftestdir/", "conftestdir2") ? 1 : 0);
|
||||
}
|
||||
],
|
||||
vb_cv_func_rename_trailing_slash_bug=no,
|
||||
vb_cv_func_rename_trailing_slash_bug=yes,
|
||||
dnl When crosscompiling, assume rename is broken.
|
||||
vb_cv_func_rename_trailing_slash_bug=yes)
|
||||
|
||||
rm -rf conftestdir conftestdir2
|
||||
])
|
||||
if test $vb_cv_func_rename_trailing_slash_bug = yes; then
|
||||
AC_LIBOBJ(rename)
|
||||
AC_DEFINE_UNQUOTED(RENAME_TRAILING_SLASH_BUG, 1,
|
||||
[Define if rename does not work for source paths with a trailing slash,
|
||||
like the one from SunOS 4.1.1_U1.])
|
||||
fi
|
||||
])
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 2
|
||||
#serial 3
|
||||
|
||||
# autoconf tests required for use of xstrtoumax.c
|
||||
|
||||
@@ -7,7 +7,8 @@ AC_DEFUN(jm_AC_PREREQ_XSTRTOUMAX,
|
||||
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
|
||||
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
|
||||
AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
|
||||
AC_CHECK_HEADERS(stdlib.h)
|
||||
AC_CHECK_DECLS([strtoul, strtoull])
|
||||
AC_CHECK_HEADERS(limits.h stdlib.h)
|
||||
|
||||
AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro],
|
||||
jm_cv_func_strtoumax_macro,
|
||||
@@ -28,7 +29,13 @@ AC_DEFUN(jm_AC_PREREQ_XSTRTOUMAX,
|
||||
dnl so we need the replacement strtoull only if strtoumax does not exist.
|
||||
case "$ac_cv_type_unsigned_long_long,$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in
|
||||
yes,no,no)
|
||||
AC_REPLACE_FUNCS(strtoull)
|
||||
AC_REPLACE_FUNCS(strtoull strtol)
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in
|
||||
no,no)
|
||||
AC_REPLACE_FUNCS(strtoul strtol)
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
65
man/help2man
65
man/help2man
@@ -27,7 +27,7 @@ use Text::Tabs qw(expand);
|
||||
use POSIX qw(strftime setlocale LC_TIME);
|
||||
|
||||
my $this_program = 'help2man';
|
||||
my $this_version = '1.022';
|
||||
my $this_version = '1.24';
|
||||
my $version_info = <<EOT;
|
||||
GNU $this_program $this_version
|
||||
|
||||
@@ -59,18 +59,20 @@ EOT
|
||||
|
||||
my $section = 1;
|
||||
my ($opt_name, @opt_include, $opt_output, $opt_no_info);
|
||||
|
||||
# Parse options.
|
||||
Getopt::Long::config('bundling');
|
||||
GetOptions (
|
||||
my %opt_def = (
|
||||
'n|name=s' => \$opt_name,
|
||||
's|section=s' => \$section,
|
||||
'i|include=s' => sub { push @opt_include, [ pop, 1 ] },
|
||||
'I|opt-include=s' => sub { push @opt_include, [ pop, 0 ] },
|
||||
'o|output=s' => \$opt_output,
|
||||
'N|no-info' => \$opt_no_info,
|
||||
help => sub { print $help_info; exit },
|
||||
version => sub { print $version_info; exit },
|
||||
);
|
||||
|
||||
# Parse options.
|
||||
Getopt::Long::config('bundling');
|
||||
GetOptions (%opt_def,
|
||||
help => sub { print $help_info; exit },
|
||||
version => sub { print $version_info; exit },
|
||||
) or die $help_info;
|
||||
|
||||
die $help_info unless @ARGV == 1;
|
||||
@@ -93,9 +95,9 @@ BEGIN { eval q(sub qr { '' =~ $_[0]; $_[0] }) if $] < 5.005 }
|
||||
# verbatim text
|
||||
#
|
||||
|
||||
for (@opt_include)
|
||||
while (@opt_include)
|
||||
{
|
||||
my ($inc, $required) = @$_;
|
||||
my ($inc, $required) = @{shift @opt_include};
|
||||
|
||||
next unless -f $inc or $required;
|
||||
die "$this_program: can't open `$inc' ($!)\n"
|
||||
@@ -134,9 +136,20 @@ for (@opt_include)
|
||||
next;
|
||||
}
|
||||
|
||||
# Silently ignore anything before the first
|
||||
# section--allows for comments and revision info.
|
||||
next unless $key;
|
||||
# Check for options before the first section--anything else is
|
||||
# silently ignored, allowing the first for comments and
|
||||
# revision info.
|
||||
unless ($key)
|
||||
{
|
||||
# handle options
|
||||
if (/^-/)
|
||||
{
|
||||
local @ARGV = split;
|
||||
GetOptions %opt_def;
|
||||
}
|
||||
|
||||
next;
|
||||
}
|
||||
|
||||
$hash->{$key} ||= '';
|
||||
$hash->{$key} .= $_;
|
||||
@@ -269,9 +282,11 @@ s/^\n+//;
|
||||
s/\n*$/\n/;
|
||||
s/\n\n+/\n\n/g;
|
||||
|
||||
# Temporarily exchange leading dots and backslashes for tokens.
|
||||
# Temporarily exchange leading dots, apostrophes and backslashes for
|
||||
# tokens.
|
||||
s/^\./\x80/mg;
|
||||
s/\\/\x81/g;
|
||||
s/^'/\x81/mg;
|
||||
s/\\/\x82/g;
|
||||
|
||||
# Start a new paragraph (if required) for these.
|
||||
s/([^\n])\n(Report +bugs|Email +bug +reports +to|Written +by)/$1\n\n$2/g;
|
||||
@@ -366,7 +381,7 @@ while (length)
|
||||
{
|
||||
$matched .= $& if %append;
|
||||
$indent = length ($4 || "$1$3");
|
||||
$content = ".TP\n\x82$2\n\x82$5\n";
|
||||
$content = ".TP\n\x83$2\n\x83$5\n";
|
||||
unless ($4)
|
||||
{
|
||||
# Indent may be different on second line.
|
||||
@@ -378,7 +393,7 @@ while (length)
|
||||
elsif (s/^ {1,10}([+-]\S.*)\n//)
|
||||
{
|
||||
$matched .= $& if %append;
|
||||
$content = ".HP\n\x82$1\n";
|
||||
$content = ".HP\n\x83$1\n";
|
||||
$indent = 80; # not continued
|
||||
}
|
||||
|
||||
@@ -387,7 +402,7 @@ while (length)
|
||||
{
|
||||
$matched .= $& if %append;
|
||||
$indent = length $1;
|
||||
$content = ".TP\n\x82$2\n\x82$3\n";
|
||||
$content = ".TP\n\x83$2\n\x83$3\n";
|
||||
}
|
||||
|
||||
# Indented paragraph.
|
||||
@@ -395,7 +410,7 @@ while (length)
|
||||
{
|
||||
$matched .= $& if %append;
|
||||
$indent = length $1;
|
||||
$content = ".IP\n\x82$2\n";
|
||||
$content = ".IP\n\x83$2\n";
|
||||
}
|
||||
|
||||
# Left justified paragraph.
|
||||
@@ -411,7 +426,7 @@ while (length)
|
||||
while (s/^ {$indent}(\S.*)\n//)
|
||||
{
|
||||
$matched .= $& if %append;
|
||||
$content .= "\x82$1\n"
|
||||
$content .= "\x83$1\n"
|
||||
}
|
||||
|
||||
# Move to next paragraph.
|
||||
@@ -419,9 +434,10 @@ while (length)
|
||||
|
||||
for ($content)
|
||||
{
|
||||
# Leading dot protection.
|
||||
s/\x82\./\x80/g;
|
||||
s/\x82//g;
|
||||
# Leading dot and apostrophe protection.
|
||||
s/\x83\./\x80/g;
|
||||
s/\x83'/\x81/g;
|
||||
s/\x83//g;
|
||||
|
||||
# Convert options.
|
||||
s/(^| )(-[][\w=-]+)/$1 . convert_option $2/mge;
|
||||
@@ -485,9 +501,10 @@ for (@pre, (grep ! /^($filter)$/o, @include), @post)
|
||||
|
||||
for ($include{$_})
|
||||
{
|
||||
# Replace leading dot an backslash tokens.
|
||||
# Replace leading dot, apostrophe and backslash tokens.
|
||||
s/\x80/\\&./g;
|
||||
s/\x81/\\e/g;
|
||||
s/\x81/\\&'/g;
|
||||
s/\x82/\\e/g;
|
||||
print;
|
||||
}
|
||||
}
|
||||
|
||||
4
man/sha1sum.x
Normal file
4
man/sha1sum.x
Normal file
@@ -0,0 +1,4 @@
|
||||
[NAME]
|
||||
shasum \- compute and check SHA1 message digest
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,86 @@
|
||||
Changes in release 4.1:
|
||||
Changes in release 4.01:
|
||||
[4.0.37]
|
||||
[4.0.36]
|
||||
* `mv dir/ new-name' no longer fails on SunOS4.1.1U
|
||||
* attempting to use mv to move a symlink onto itself no longer removes
|
||||
the symlink
|
||||
* `cp -R directory file' no longer removes `file'. now it fails and gives
|
||||
a diagnostic
|
||||
* The manual now warns that ls's --full-time format string is planned
|
||||
to change in a future release.
|
||||
* ls -l's time stamp format now depends on LC_TIME, not LC_MESSAGES,
|
||||
as POSIX requires.
|
||||
* ls -l now reports the year for files even slightly in the future, as
|
||||
POSIX requires. This helps warn users about clock skew problems.
|
||||
* `cp -d file symlink-to-some-other-file' no longer fails
|
||||
* performance improvements for ls
|
||||
[4.0.35]
|
||||
* ln --backup=simple --suffix=SUFFIX once again uses SUFFIX
|
||||
* install: Likewise.
|
||||
[4.0.34]
|
||||
* fix a bug (introduced in 4.0z) that made `chown 123:456 file' act like
|
||||
`chown 123:123 file'. Other uses with a numeric group ID would cause
|
||||
chown to fail when it shouldn't have.
|
||||
* the chown and chgrp programs preserve set-uid and set-gid bits, even on
|
||||
systems for which the chown function call resets those bits.
|
||||
* `ls -L dangling-symlink' now fails (per POSIX) rather than printing the
|
||||
link name
|
||||
* dd no longer honors the just-added `B' suffix on skip= and seek= arguments.
|
||||
* `mkdir no-such-dir/' no longer fails on NetBSD systems
|
||||
[4.0.33]
|
||||
* dd now accepts skip=nB and seek=nB, to advance past some number of bytes, n,
|
||||
that need not be a multiple of the block size.
|
||||
* dd (without conv=notrunc) now complains only when ftruncate fails on a
|
||||
regular file, a directory, or a shared memory object -- not when it fails
|
||||
to truncate other types of files, like /dev/fd0.
|
||||
* chmod --changes (-c) once again issues diagnostics only for the files
|
||||
with changed permissions
|
||||
* mkdir now gives one diagnostic (rather than two) for certain failures
|
||||
* mkdir portability fix for NetBSD
|
||||
[4.0.32]
|
||||
* touch now interprets a lone numeric argument of 8 or 10 digits as a file name,
|
||||
rather than as a date/time in the obsolescent `MMDDhhmm[YY]' format.
|
||||
* mkdir no longer sets the permissions of the final directory component
|
||||
if it already exists (this bug, too, was introduced recently)
|
||||
* ls's --full-time format string is now locale dependent
|
||||
[4.0.31]
|
||||
* mkdir: fix a bug introduced in 4.0.30 whereby `mkdir existing-dir' would
|
||||
succeed. Now it fails, as it should (and used to).
|
||||
[4.0.30]
|
||||
* mkdir: fix a bug introduced in 4.0.28 whereby parent directories created
|
||||
via `mkdir -p' would have permissions that did not account for the umask
|
||||
[4.0.29]
|
||||
* ls.c wouldn't compile on some systems: fix it
|
||||
* `cp -R --parents dir1/ dir2' failed on NetBSD, due to a portability problem
|
||||
[4.0.28]
|
||||
* ls is much more efficient on systems (e.g., linux-2.4.*) that store file
|
||||
type information in directory entries.
|
||||
* shred now automatically determines the size of each block device argument
|
||||
* ls's date/time format strings are now local dependent
|
||||
* mkdir, mknod, mkfifo, and chmod work better in conjunction with ACLs
|
||||
* `cp --parents dir1/ dir2' no longer gets a failed assertion
|
||||
* shred now determines the size of block devices like /dev/fd0
|
||||
* `shred --exact file1 file2' now erases `file1', too
|
||||
[4.0.27]
|
||||
* install once again unlinks an existing destination before trying to open it
|
||||
* mv no longer gets a failed assertion when moving a directory (specified with
|
||||
a trailing slash) from one partition to another, and giving it a different
|
||||
name at the destination.
|
||||
* `cp --link -f src existing-dest' no longer fails (bug introduced in 4.0z)
|
||||
* cp's new --remove-destination option now works with -R
|
||||
[4.0z]
|
||||
* `cp -p' once again preserves `special' permission bits (this bug was
|
||||
introduced in 4.0y)
|
||||
* mv's --force (-f) option now controls solely whether mv prompts (per POSIX)
|
||||
* `cp -f' now first attempts to open an existing destination file, and only
|
||||
if that fails does it resort to unlinking the file and retrying the open.
|
||||
Before, it would unlink the file before trying to open it.
|
||||
* cp accepts a new option, --remove-destination, that provides the old behavior
|
||||
* cp's -f option no longer cancels the effect of --interactive (-i) (per POSIX)
|
||||
* when ls sorts directory entries, it now honors the current locale settings
|
||||
* dd's `skip=BLOCKS' operator once again works on systems with a buggy lseek
|
||||
function (Linux, at least on SCSI tape devices)
|
||||
* fix a typo in install-sh
|
||||
[4.0y]
|
||||
* cp now accepts the POSIX-mandated -H and -L options.
|
||||
* cp -p and mv now try to preserve uid even if you're not root, as per POSIX.2.
|
||||
|
||||
@@ -1,3 +1,140 @@
|
||||
2001-01-20 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure.in: Remove jm_CHECK_ALL_TYPES.
|
||||
Now it's invoked by jm_MACROS.
|
||||
|
||||
2001-01-04 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/date.c (main): Fail when --rfc-822 (-R) is specified along
|
||||
with a format string. Reported by Jochen Hein.
|
||||
|
||||
2000-12-17 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* doc/texinfo.tex: Update from master repository.
|
||||
* config.sub: Likewise.
|
||||
* config.guess: Likewise.
|
||||
|
||||
* djgpp: New directory.
|
||||
* djgpp/*: New files.
|
||||
* Makefile.am (SUBDIRS): Add djgpp.
|
||||
* configure.in (AC_OUTPUT): Add djgpp/Makefile.
|
||||
From Prashant TR.
|
||||
|
||||
2000-12-08 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/dirname.c: Include xalloc.h.
|
||||
(main): Use dir_name rather than the underlying dir_name_r.
|
||||
The former now handles cwd-relative names with drive-letter prefixes.
|
||||
|
||||
2000-12-02 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/seq.c (valid_format): Move pre-increment to a separate statement
|
||||
to avoid a warning.
|
||||
|
||||
* src/id.c: Move dcls of globals used only in main...
|
||||
(main): ...to here.
|
||||
(usage): Clarify option descriptions.
|
||||
|
||||
2000-11-18 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* po/Makefile.in.in: Sync with the one from fileutils.
|
||||
|
||||
* configure, config.h.in, Makefile.in, etc.: Regenerate using the
|
||||
very latest version (in CVS) of autoconf.
|
||||
|
||||
2000-11-17 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* GNUmakefile (.NOTPARALLEL): New target. Prevent unwanted parallelism.
|
||||
Suggestion from Ulrich Drepper.
|
||||
|
||||
* src/pinky.c: Explicitly include sys/types.h before including system.h.
|
||||
* src/uptime.c: Likewise.
|
||||
* src/users.c: Likewise.
|
||||
* src/who.c: Likewise.
|
||||
|
||||
2000-11-13 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/sys2.h (ST_TIME_CMP_NS): Fix typo: ST_MTIM_NSEC should
|
||||
be tested with #ifdef, not with #if.
|
||||
|
||||
2000-11-12 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/date.c (show_date): Add a comment explaining why the
|
||||
format string must not be translatable via _(). From Paul Eggert.
|
||||
|
||||
2000-10-31 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* doc/sh-utils.texi: Clean up indentation and punctuation.
|
||||
Fix a couple typos. From Brian Youmans.
|
||||
|
||||
2000-10-30 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure, config.h.in, Makefile.in, etc.: Regenerate using the
|
||||
very latest version (in CVS) of autoconf.
|
||||
|
||||
2000-10-29 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 2.0.11.
|
||||
|
||||
2000-10-27 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/date.c (usage): Mention the time zone, UTC, and write the date
|
||||
in ISO format in the description of %s. Suggestion from Karl Berry.
|
||||
|
||||
2000-10-25 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/dirname.c: Include dirname.h.
|
||||
(main): Use dir_name_r rather than open-coding it.
|
||||
|
||||
2000-10-23 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add .prev-version.
|
||||
|
||||
2000-10-18 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/date.c (universal_time): Remove; it's just a temptation to
|
||||
do the wrong thing.
|
||||
(main): The -u option now just sets TZ; it doesn't do anything else.
|
||||
(show_date): Do not do anything special if -u is set.
|
||||
This affects the behavior of the -I and -R options.
|
||||
* doc/sh-utils.texi: Document the above.
|
||||
|
||||
2000-10-18 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* doc/sh-utils.texi (Examples of date): Fix a typo.
|
||||
|
||||
2000-10-11 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* doc/sh-utils.texi (Time directives) [%S]: Range is 0..60, not 0..61.
|
||||
|
||||
2000-10-06 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
Undo the effect of the 1997-07-12 change to date.c; it
|
||||
broke "date -u MMDDhhmm" and it wasn't documented.
|
||||
This reverts to the behavior of the 1996-01-03 patch.
|
||||
|
||||
* src/date.c (TZ_UTC0, MAYBE_SET_TZ_UTC0, set_tz): Remove.
|
||||
(batch_convert): Don't futz with TZ.
|
||||
(main): -u now parses all dates as UTC, not just some.
|
||||
Reported by Karl-Michael Schneider.
|
||||
* tests/date/Test.pm (utc-0, utc-1, relative-2): Adjust to
|
||||
above change.
|
||||
|
||||
2000-09-29 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/yes.c (usage): Add a separate usage line, just for `OPTION'.
|
||||
Suggestion from M. P. Suzuki.
|
||||
|
||||
2000-09-09 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/date.c (usage): Make the second `Usage' line more precise
|
||||
(also making it match the texinfo documentation).
|
||||
From Karl Eichwalder.
|
||||
|
||||
* doc/sh-utils.texi (Setting the time): Correct the capitalization of
|
||||
`HHMM' in the info-rendering of the texinfo documentation.
|
||||
Reported by Karl Eichwalder.
|
||||
|
||||
2000-08-14 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/tee.c (main): Remove incorrect `FIXME' comment.
|
||||
@@ -431,8 +568,8 @@
|
||||
|
||||
2000-01-21 Bruno Haible <haible@linuix.math.u-bordeaux.fr>
|
||||
|
||||
Add support for octal and hexadecimal output.
|
||||
* seq.c (intconv): New variable.
|
||||
Add support for octal and hexadecimal output.
|
||||
* seq.c (intconv): New variable.
|
||||
(usage): Update.
|
||||
(main): Call scan_arg instead of scan_double_arg. Call check_format
|
||||
before scan_arg.
|
||||
@@ -1793,8 +1930,8 @@
|
||||
1997-08-31 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/who.c (main): New option --lookup (-l).
|
||||
(print_entry): Only call canon_host if user explicitly asks for it.
|
||||
(usage): Describe --lookup.
|
||||
(print_entry): Only call canon_host if user explicitly asks for it.
|
||||
(usage): Describe --lookup.
|
||||
From Galen Hazelwood.
|
||||
|
||||
* configure.in (ALL_LINGUAS): Add Spanish (es).
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
Changes in release 2.1
|
||||
[2.0k]
|
||||
[2.0.11]
|
||||
* setting the date now works properly, even when using -u
|
||||
* `date -f - < /dev/null' no longer dumps core
|
||||
* some DOS/Windows portability changes
|
||||
[2.0j]
|
||||
* `date -d DATE' now parses certain relative DATEs correctly
|
||||
[2.0i]
|
||||
|
||||
@@ -1,3 +1,368 @@
|
||||
2001-01-20 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure.in: Remove jm_CHECK_ALL_TYPES.
|
||||
Now it's invoked by jm_MACROS.
|
||||
|
||||
2001-01-17 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/cksum.c (main): Use PACKAGE, not GNU_PACKAGE.
|
||||
* src/tsort.c (main): Likewise.
|
||||
* src/sort.c (main): Likewise.
|
||||
(usage): Convert each TAB in --help output to a sequence of 8 spaces.
|
||||
|
||||
2001-01-07 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/tail.c (usage): Split a string that was longer than 2048 bytes.
|
||||
|
||||
2001-01-03 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/sort.c (main): Remove embedded \n from diagnostic.
|
||||
|
||||
2001-01-02 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/od.c (ulonglong_t): Define place-holder type to avoid some #if
|
||||
directives.
|
||||
(LONGEST_INTEGRAL_TYPE): Remove definition.
|
||||
(MAX_INTEGRAL_TYPE_SIZE): Use ulonglong_t instead of
|
||||
LONGEST_INTEGRAL_TYPE.
|
||||
(print_long_long): Compile this function even on systems without
|
||||
long long support.
|
||||
(decode_one_format): Remove #if directive.
|
||||
|
||||
* src/od.c (decode_one_format): Guard use of print_long_long with
|
||||
`#if HAVE_UNSIGNED_LONG_LONG'. From Darren Salt.
|
||||
Change all `#ifdef HAVE_UNSIGNED_LONG_LONG' to use `#if' instead.
|
||||
|
||||
2000-12-23 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/sys2.h [HAVE_INTTYPES_H]: Include <inttypes.h>.
|
||||
|
||||
2000-12-19 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 2.0.11.
|
||||
|
||||
2000-12-18 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* NEWS, doc/textutils.texi: New "sort" option -S SIZE.
|
||||
|
||||
* src/sys2.h (UINTMAX_MAX): New macro, taken from C99.
|
||||
|
||||
* src/sort.c: Include physmem.h.
|
||||
(SORTALLOC, mergealloc, LINEALLOC): Remove.
|
||||
(sortalloc): Default to zero at program startup.
|
||||
(SORTALLOC_MIN, SORTALLOC_DEFAULT_MIN): New macros.
|
||||
(usage, main): Add support for new -S SIZE option.
|
||||
(specify_sort_size, default_sort_size): New functions.
|
||||
(initlines): Do not let alloc exceed limit.
|
||||
(findlines): Likewise.
|
||||
(checkfp, mergefps, sort): Use sortalloc to size everything
|
||||
else, instead of relying on precomputed sizes.
|
||||
|
||||
2000-12-17 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* doc/texinfo.tex: Update from master repository.
|
||||
* config.sub: Likewise.
|
||||
* config.guess: Likewise.
|
||||
|
||||
2000-12-11 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 2.0.10.
|
||||
|
||||
2000-12-07 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/od.c (address_base): Declare to be static.
|
||||
|
||||
2000-12-06 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/od.c (address_base, address_pad_len): New var.
|
||||
(output_address_fmt_string, address_fmt_buffer, address_pad): Remove.
|
||||
(flag_pseudo_start): Now int, not long int.
|
||||
(pseudo_offset): Now off_t, not long int.
|
||||
(n_specs, n_specs_allocated): Now size_t, not unsigned int.
|
||||
(format_address, format_address_none, format_address_std,
|
||||
format_address_label): Now accepts an extra char argument (an extra
|
||||
char to print if nonzero), and prints instead of returning a string.
|
||||
All callers changed.
|
||||
(bytes_per_block): Now size_t, not int.
|
||||
(format_address_none): Do not even print the extra char argument.
|
||||
This simplifies the callers.
|
||||
(format_address_std, format_address_label): Print off_t ourself
|
||||
instead of trying to use autoconfigured format. This is faster and
|
||||
more portable.
|
||||
(format_address_paren): New function.
|
||||
(dump): Remove unnecessary cast.
|
||||
(expand_address_fmt): Remove.
|
||||
(main): Use size_t, off_t, etc. instead of builtin types where this is
|
||||
advisable. Adjust to above changes. Remove unnecessary cast.
|
||||
|
||||
2000-12-03 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/tail.c (tail_file): Initialize ignore, dev, and ino members,
|
||||
when tailing forever and the open failed. Otherwise, we could get
|
||||
uninitialized memory references of those fields in recheck.
|
||||
* tests/tail-2/Makefile.am (TESTS): Add assert-2.
|
||||
* tests/tail-2/assert-2: New file.
|
||||
|
||||
* Version 2.0.9.
|
||||
|
||||
Make od print valid addresses for offsets of 2^32 and larger, and
|
||||
allow byte offset (-j) and byte count (-N) to be 2^32 and larger.
|
||||
|
||||
* src/od.c (MAX_ADDRESS_LENGTH): Don't hard-code as a literal.
|
||||
Rather, define in terms of the type, off_t.
|
||||
(string_min): Declare to be of type size_t.
|
||||
(flag_dump_strings): Declare to be of type int.
|
||||
(print_s_char): Declare the n_bytes parameter and the local, `i',
|
||||
to be of type off_t.
|
||||
(print_char): Likewise.
|
||||
(print_s_short): Likewise.
|
||||
(print_short): Likewise.
|
||||
(print_int): Likewise.
|
||||
(print_long): Likewise.
|
||||
(print_long_long): Likewise.
|
||||
(print_float): Likewise.
|
||||
(print_double): Likewise.
|
||||
(print_long_double): Likewise.
|
||||
(dump_hexl_mode_trailer): Likewise.
|
||||
(print_named_ascii): Likewise.
|
||||
(print_ascii): Likewise.
|
||||
(write_block): Likewise.
|
||||
(print_ascii): Declare local, `print_function' with a prototype.
|
||||
Change a few `>' comparisons to the equivalent `<' form.
|
||||
(parse_options): Declare `tmp' to be of type uintmax_t.
|
||||
Use xstrtoumax, not xstrtoul.
|
||||
Fail if the specified offset if larger than OFF_T_MAX.
|
||||
(dump_strings): Declare local `i' to be of type size_t.
|
||||
Remove the now-unnecessary cast-to-off_t.
|
||||
(main) [IF_LINT]: Initialize desired_width to avoid a warning.
|
||||
Declare `tmp' to be of type uintmax_t.
|
||||
Use xstrtoumax, not xstrtoul.
|
||||
Fail if minimum string length is larger than SIZE_MAX.
|
||||
Fail if specified width is larger than ULONG_MAX.
|
||||
|
||||
* src/od.c (format_address): Use off_t, not long unsigned_int as the
|
||||
parameter type.
|
||||
(format_address_none): Likewise. Mark parameter as unused.
|
||||
(format_address_std): Likewise.
|
||||
(format_address_label): Likewise.
|
||||
(print_ascii): Mark format string parameter as unused.
|
||||
(write_block): Use off_t, not long unsigned_int as offset type.
|
||||
(expand_address_fmt): New function.
|
||||
(main): Use it to expand each address format string template.
|
||||
Reported by Mark Nudelman, via Andreas Jaeger.
|
||||
|
||||
* src/sys2.h (OFF_T_MIN): Define here instead.
|
||||
(OFF_T_MAX): Likewise.
|
||||
(CHAR_BIT): Define.
|
||||
|
||||
* src/tail.c (parse_options): Use xstrtoumax to parse the byte and line
|
||||
offset. Give a better diagnostic when the requested offset is still
|
||||
representable but larger than OFF_T_MAX.
|
||||
(OFF_T_MIN): Remove definition.
|
||||
(OFF_T_MAX): Likewise.
|
||||
|
||||
2000-12-02 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/sort.c (checkfp): Rename local `buf' to avoid shadowing previous
|
||||
declaration.
|
||||
|
||||
* src/sort.c (NONZERO): Define and use it to make the code a tiny
|
||||
bit more readable.
|
||||
|
||||
* doc/textutils.texi (sort invocation): Clarify how -t works
|
||||
when a sort key specifies a range of fields. From Karl O. Pinc.
|
||||
|
||||
2000-11-26 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/od.c (skip): Use lseek instead of worrying about fseeko or fseek.
|
||||
This should be portable, as we seek before doing any I/O.
|
||||
(fseeko): Remove; no longer used.
|
||||
|
||||
2000-11-30 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/sort.c: s/SIZE_T_MAX/SIZE_MAX/.
|
||||
|
||||
2000-11-30 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/sys2.h: Include <stdint.h> if HAVE_STDINT_H.
|
||||
(SIZE_MAX): Renamed from SIZE_T_MAX, as C99 uses SIZE_MAX.
|
||||
All uses changed.
|
||||
|
||||
2000-11-30 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/sort.c: SIZE_MAX is not defined, so s/SIZE_MAX/SIZE_T_MAX/, and...
|
||||
* src/sys2.h (SIZE_T_MAX): ... define.
|
||||
|
||||
2000-11-29 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
Port GNU "sort" to hosts where sizes don't fit in "int",
|
||||
e.g. 64-bit Solaris (sparc).
|
||||
|
||||
* src/sort.c ("human.h", "xstrtol.h"): Include.
|
||||
(struct line): length member is now size_t, not int.
|
||||
(struct lines): Likewise for used, alloc, limit members.
|
||||
(struct buffer): Likewise for used, alloc, left, newline_free members.
|
||||
(struct keyfield): Likewise for sword, schar, eword, echar members.
|
||||
(sortalloc, mergealloc, linelength): Now size_t, not int.
|
||||
|
||||
(initbuf, fillbuf, initlines, begfield, limfield, findlines,
|
||||
numcompare, getmonth, keycompare, compare, checkfp, mergefps,
|
||||
sortlines, sort): Accept, return, and use size_t for sizes, not int.
|
||||
|
||||
(fillbuf, initlines, findlines, checkfp, sort): Check for overflow
|
||||
when computing buffer sizes.
|
||||
|
||||
(begfield, limfield): Do not index past end of array.
|
||||
|
||||
(checkfp): Return a boolean, not a line number, as the line
|
||||
number may not fit in int. All callers changed. Use
|
||||
uintmax_t for line numbers, not int.
|
||||
|
||||
(sort): Don't allocate tmp until we need it (and know the right size).
|
||||
|
||||
(parse_field_count): New function.
|
||||
|
||||
(main): Use it to check for overflow in field counts.
|
||||
"outfile" is now a pointer to const.
|
||||
|
||||
2000-11-27 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/checksum.h: Don't include system.h here.
|
||||
* src/md5.c: Include config.h, stdio.h, sys/types.h. and system.h here
|
||||
instead.
|
||||
* src/sha1sum.c: Likewise.
|
||||
|
||||
2000-11-18 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/pr.c (main): Do not assume EOF == -1.
|
||||
Handle the case correctly when digits options immediately precede a
|
||||
non-option.
|
||||
|
||||
2000-11-18 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* doc/textutils.texi: Change GNU to @sc{gnu} in many places.
|
||||
Update to use the Free Documentation Licence.
|
||||
|
||||
* configure, config.h.in, Makefile.in, etc.: Regenerate using the
|
||||
very latest version (in CVS) of autoconf.
|
||||
|
||||
2000-11-17 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* GNUmakefile (.NOTPARALLEL): New target. Prevent unwanted parallelism.
|
||||
Suggestion from Ulrich Drepper.
|
||||
|
||||
2000-11-16 John David Anglin <dave@hiauly1.hia.nrc.ca>
|
||||
|
||||
* tsort.c: Include sys/types.h before system.h.
|
||||
|
||||
2000-11-16 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/join.c: Declare global `tab' to be of type *unsigned* char,
|
||||
so join works with 8-bit delimiter characters.
|
||||
Reported by Antonio Rendas.
|
||||
* tests/join/Test.pm (8-bit-t): New test for the above fix.
|
||||
|
||||
2000-11-13 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/sys2.h (ST_TIME_CMP_NS): Fix typo: ST_MTIM_NSEC should
|
||||
be tested with #ifdef, not with #if.
|
||||
|
||||
2000-11-11 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* doc/textutils.texi: More minor rewording and grammar correction.
|
||||
From Brian Youmans.
|
||||
|
||||
2000-11-06 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/od.c (skip): st_size is not defined for directories.
|
||||
|
||||
2000-11-03 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/sha1sum/sample-vec: New file, with tests derived from
|
||||
http://csrc.nist.gov/cryptval/shs/sha1-vectors.zip
|
||||
* tests/sha1sum/Makefile.am (TESTS): Add sample-vec.
|
||||
|
||||
2000-10-30 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure, config.h.in, Makefile.in, etc.: Regenerate using the
|
||||
very latest version (in CVS) of autoconf.
|
||||
|
||||
* src/wc.c: Include "system.h" after wctype.h (not before)
|
||||
to avoid a compilation error on Solaris 5.5.1 systems.
|
||||
Reported by Vin Shelton.
|
||||
|
||||
2000-10-23 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Makefile.maint: Clean up version-related variables.
|
||||
|
||||
* Version 2.0.8.
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add .prev-version.
|
||||
|
||||
2000-10-22 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/Makefile.am (SUBDIRS): Add sha1sum.
|
||||
* tests/sha1sum/basic-1: New file.
|
||||
* configure.in (AC_OUTPUT): Add tests/sha1sum/Makefile.
|
||||
|
||||
* src/Makefile.am (bin_PROGRAMS): Add sha1sum.
|
||||
(md5sum_SOURCES): Define.
|
||||
(sha1sum_SOURCES): Define.
|
||||
(noinst_HEADERS): Add checksum.h.
|
||||
|
||||
* src/md5sum.c: Factor out the differences between MD5 and SHA1,
|
||||
and parameterize so this code may be used by both md5sum and the new
|
||||
program, sha1sum. Loosely based on a patch from Scott Miller.
|
||||
* src/checksum.h: New file.
|
||||
* src/md5.c: New file that simply defines `algorithm'.
|
||||
* src/sha1sum.c: Likewise.
|
||||
|
||||
* man/Makefile.am (man_MANS): Add sha1sum.1.
|
||||
* man/sha1sum.x: New file.
|
||||
|
||||
Support 8-byte integers, assuming they're printable with e.g., %lld.
|
||||
* src/od.c: Add support for printing data as unsigned
|
||||
long long integers.
|
||||
|
||||
2000-10-21 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
The command, `yes ''|./cat -n' would stop printing after INT_MAX lines.
|
||||
* src/cat.c (cat): Never let `newlines' exceed 3.
|
||||
|
||||
2000-10-21 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Prevent a counter buffer overrun when numbering lines and when
|
||||
processing 100 billion lines (or more) of input.
|
||||
* src/cat.c (LINE_COUNTER_BUF_LEN): Define to allow numbering as
|
||||
many as 10^18 - 1 lines (the old limit was 10^11 - 1, and could
|
||||
be exceeded without too much trouble). Use this symbol rather
|
||||
than hard-coding the constant everywhere.
|
||||
(next_line_num): Rather than overrunning for input with more lines,
|
||||
mark the line number by putting a `>' in the leftmost slot.
|
||||
Patch by Jan Nieuwenhuizen.
|
||||
|
||||
* src/sort.c (SORT_OUT_OF_ORDER): Define.
|
||||
(main): Use it instead of hard-coding the `1'.
|
||||
|
||||
2000-10-10 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/sort.c (main): Use EXIT_SUCCESS rather than 0.
|
||||
Fail when checking (-c) with more than one file argument,
|
||||
rather than simply ignoring the extra arguments.
|
||||
|
||||
2000-09-07 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/cut.c: Remove obsolete comment block.
|
||||
(usage): Note that when using -f, lines with no delimiters are
|
||||
also printed.
|
||||
* doc/textutils.texi (cut invocation): Likewise.
|
||||
|
||||
2000-08-23 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/md5sum.c: Include <config.h> unconditionally, to be consistent
|
||||
with all the other programs in this directory.
|
||||
* src/tsort.c: Likewise.
|
||||
|
||||
2000-08-19 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/comm.c (writeline): Correct comments. From Bruno Haible.
|
||||
@@ -71,7 +436,7 @@
|
||||
|
||||
2000-08-06 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/sort.c (usage): Warn more succintly about the effects of
|
||||
* src/sort.c (usage): Warn more succinctly about the effects of
|
||||
the locale on sort order.
|
||||
|
||||
2000-08-06 Jim Meyering <meyering@lucent.com>
|
||||
@@ -2147,8 +2512,8 @@
|
||||
|
||||
1998-02-16 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* configure.in (jm_FUNC_LSTAT): Use it.
|
||||
(jm_FUNC_STAT): Use it.
|
||||
* configure.in (jm_FUNC_LSTAT): Use it.
|
||||
(jm_FUNC_STAT): Use it.
|
||||
* lib/Makefile.am (EXTRA_DIST): Add lstat.c and stat.c.
|
||||
|
||||
1998-02-06 Jim Meyering <meyering@eng.ascend.com>
|
||||
@@ -2177,8 +2542,8 @@
|
||||
|
||||
1998-01-30 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* configure.in (AC_LFS): Put before anything that can affect or use
|
||||
CPPFLAGS, LDFLAGS, or LIBS.
|
||||
* configure.in (AC_LFS): Put before anything that can affect or use
|
||||
CPPFLAGS, LDFLAGS, or LIBS.
|
||||
|
||||
1998-01-25 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
Changes in release 2.1
|
||||
[2.0h]
|
||||
[2.0.11]
|
||||
* sort accepts new -S SIZE option, to specify main-memory usage.
|
||||
[2.0.10]
|
||||
* od is faster and more portable than it was in 2.0.9
|
||||
* tail avoids an uninitialized memory reference
|
||||
[2.0.9]
|
||||
* od now prints valid addresses for offsets of 2^32 and larger, and allows
|
||||
the byte offset (-j) and byte count (-N) arguments to be 2^32 and larger.
|
||||
* tail now works with line and byte counts of 2^32 and larger, on systems
|
||||
with large file support
|
||||
* join now works with an 8-bit delimiter
|
||||
* fix a compilation failure on some Solaris systems with wc.c
|
||||
[2.0.8]
|
||||
* od now supports 8-byte integers, assuming they're printable with e.g., %lld
|
||||
* new program: sha1sum
|
||||
* wc accepts new -m option: count (potentially multi-byte) characters
|
||||
* wc's `--chars' option is now equivalent to -m, not --bytes as it used to be
|
||||
* `cat -n' works properly when processing 2^31 or more lines
|
||||
[2.0g]
|
||||
* sort's --help output now warns that it is locale-aware
|
||||
* tail: fix a buffer underrun error that occurred on an empty pipe,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Makefile for program source directory in GNU NLS utilities package.
|
||||
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
# -*- Makefile -*- for program source directory in GNU NLS utilities package.
|
||||
# Copyright (C) 1995, 1996, 1997, 2000 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
#
|
||||
# This file file be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU Public License
|
||||
@@ -150,6 +150,13 @@ install-data-yes: all
|
||||
true; \
|
||||
fi; \
|
||||
fi; \
|
||||
if test "$(PACKAGE)" = "fileutils"; then \
|
||||
timedir=$$destdir/$$lang/LC_TIME; \
|
||||
rm -fr $$timedir; \
|
||||
ln -s LC_MESSAGES $$timedir \
|
||||
|| (mkdir $$timedir && ln $$dir/* $$timedir); \
|
||||
echo "installing $$timedir as an alias for $$dir"; \
|
||||
fi; \
|
||||
done
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
if test -x "$(MKINSTALLDIRS)"; then \
|
||||
@@ -176,7 +183,6 @@ uninstall:
|
||||
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
|
||||
rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
done
|
||||
rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in
|
||||
|
||||
check: all
|
||||
|
||||
@@ -202,26 +208,30 @@ distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
dist distdir: update-po $(DISTFILES)
|
||||
dists="$(DISTFILES)"; \
|
||||
for file in $$dists; do \
|
||||
ln $(srcdir)/$$file $(distdir) 2> /dev/null \
|
||||
|| cp -p $(srcdir)/$$file $(distdir); \
|
||||
cp -p $(srcdir)/$$file $(distdir); \
|
||||
done
|
||||
|
||||
update-po: Makefile
|
||||
$(MAKE) $(PACKAGE).pot
|
||||
PATH=`pwd`/../src:$$PATH; \
|
||||
cd $(srcdir); \
|
||||
catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
mv $$lang.po $$lang.old.po; \
|
||||
echo "$$lang:"; \
|
||||
if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
|
||||
rm -f $$lang.old.po; \
|
||||
if $(MSGMERGE) $(srcdir)/$$lang.po \
|
||||
$(srcdir)/$(PACKAGE).pot -o $$lang.new.po; then \
|
||||
if cmp $$lang.new.po $(srcdir)/$$lang.po >/dev/null; then \
|
||||
echo "$$lang.po is unchanged"; \
|
||||
rm -f $$lang.new.po; \
|
||||
else \
|
||||
echo "updating $$lang.po"; \
|
||||
rm -f $(srcdir)/$$lang.po; \
|
||||
mv $$lang.new.po $(srcdir)/$$lang.po; \
|
||||
fi; \
|
||||
else \
|
||||
echo "msgmerge for $$cat failed!"; \
|
||||
rm -f $$lang.po; \
|
||||
mv $$lang.old.po $$lang.po; \
|
||||
rm -f $$lang.new.po; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
@@ -246,3 +256,7 @@ Makefile: Makefile.in.in ../config.status POTFILES
|
||||
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
||||
# Tell version 3.79 and up of GNU make to not build goals in this
|
||||
# directory in parallel.
|
||||
.NOTPARALLEL:
|
||||
|
||||
56
src/cat.c
56
src/cat.c
@@ -55,19 +55,26 @@ static char *infile;
|
||||
/* Descriptor on which input file is open. */
|
||||
static int input_desc;
|
||||
|
||||
/* Buffer for line numbers. */
|
||||
static char line_buf[13] =
|
||||
{' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0', '\t', '\0'};
|
||||
/* Buffer for line numbers.
|
||||
An 11 digit counter may overflow within an hour on a P2/466,
|
||||
an 18 digit counter needs about 1000y */
|
||||
#define LINE_COUNTER_BUF_LEN 20
|
||||
static char line_buf[LINE_COUNTER_BUF_LEN] =
|
||||
{
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0',
|
||||
'\t', '\0'
|
||||
};
|
||||
|
||||
/* Position in `line_buf' where printing starts. This will not change
|
||||
unless the number of lines is larger than 999999. */
|
||||
static char *line_num_print = line_buf + 5;
|
||||
static char *line_num_print = line_buf + LINE_COUNTER_BUF_LEN - 8;
|
||||
|
||||
/* Position of the first digit in `line_buf'. */
|
||||
static char *line_num_start = line_buf + 10;
|
||||
static char *line_num_start = line_buf + LINE_COUNTER_BUF_LEN - 3;
|
||||
|
||||
/* Position of the last digit in `line_buf'. */
|
||||
static char *line_num_end = line_buf + 10;
|
||||
static char *line_num_end = line_buf + LINE_COUNTER_BUF_LEN - 3;
|
||||
|
||||
/* Preserves the `cat' function's local `newlines' between invocations. */
|
||||
static int newlines2 = 0;
|
||||
@@ -129,7 +136,10 @@ next_line_num (void)
|
||||
*endp-- = '0';
|
||||
}
|
||||
while (endp >= line_num_start);
|
||||
*--line_num_start = '1';
|
||||
if (line_num_start > line_buf)
|
||||
*--line_num_start = '1';
|
||||
else
|
||||
*line_buf = '>';
|
||||
if (line_num_start < line_num_print)
|
||||
line_num_print--;
|
||||
}
|
||||
@@ -340,13 +350,21 @@ cat (
|
||||
|
||||
if (++newlines > 0)
|
||||
{
|
||||
/* Are multiple adjacent empty lines to be substituted by
|
||||
single ditto (-s), and this was the second empty line? */
|
||||
|
||||
if (squeeze_empty_lines && newlines >= 2)
|
||||
if (newlines >= 2)
|
||||
{
|
||||
ch = *bpin++;
|
||||
continue;
|
||||
/* Limit this to 2 here. Otherwise, with lots of
|
||||
consecutive newlines, the counter could wrap
|
||||
around at INT_MAX. */
|
||||
newlines = 2;
|
||||
|
||||
/* Are multiple adjacent empty lines to be substituted
|
||||
by single ditto (-s), and this was the second empty
|
||||
line? */
|
||||
if (squeeze_empty_lines)
|
||||
{
|
||||
ch = *bpin++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* Are line numbers to be written at empty lines (-n)? */
|
||||
@@ -775,8 +793,8 @@ main (int argc, char **argv)
|
||||
{
|
||||
inbuf = (unsigned char *) xmalloc (insize + 1);
|
||||
|
||||
/* Why are (OUTSIZE - 1 + INSIZE * 4 + 13) bytes allocated for
|
||||
the output buffer?
|
||||
/* Why are (OUTSIZE - 1 + INSIZE * 4 + LINE_COUNTER_BUF_LEN)
|
||||
bytes allocated for the output buffer?
|
||||
|
||||
A test whether output needs to be written is done when the input
|
||||
buffer empties or when a newline appears in the input. After
|
||||
@@ -788,10 +806,12 @@ main (int argc, char **argv)
|
||||
If the last character in the preceding block of input was a
|
||||
newline, a line number may be written (according to the given
|
||||
options) as the first thing in the output buffer. (Done after the
|
||||
new input is read, but before processing of the input begins.) A
|
||||
line number requires seldom more than 13 positions. */
|
||||
new input is read, but before processing of the input begins.)
|
||||
A line number requires seldom more than LINE_COUNTER_BUF_LEN
|
||||
positions. */
|
||||
|
||||
outbuf = (unsigned char *) xmalloc (outsize - 1 + insize * 4 + 13);
|
||||
outbuf = (unsigned char *) xmalloc (outsize - 1 + insize * 4
|
||||
+ LINE_COUNTER_BUF_LEN);
|
||||
|
||||
cat (inbuf, insize, outbuf, outsize, quote,
|
||||
output_tabs, numbers, numbers_at_empty_lines, mark_line_ends,
|
||||
|
||||
15
src/checksum.h
Normal file
15
src/checksum.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* For long options that have no equivalent short option, use a
|
||||
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
|
||||
enum
|
||||
{
|
||||
ALG_UNSPECIFIED = 0,
|
||||
ALG_MD5 = CHAR_MAX + 1,
|
||||
ALG_SHA1
|
||||
};
|
||||
|
||||
extern int algorithm;
|
||||
251
src/chgrp.c
251
src/chgrp.c
@@ -1,5 +1,5 @@
|
||||
/* chgrp -- change group ownership of files
|
||||
Copyright (C) 89, 90, 91, 1995-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 89, 90, 91, 1995-2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "quote.h"
|
||||
#include "savedir.h"
|
||||
#include "xstrtol.h"
|
||||
#include "chown-core.h"
|
||||
|
||||
/* The official name of this program (e.g., no `g' prefix). */
|
||||
#define PROGRAM_NAME "chgrp"
|
||||
@@ -52,54 +53,9 @@ struct group *getgrnam ();
|
||||
# define endgrent() ((void) 0)
|
||||
#endif
|
||||
|
||||
enum Change_status
|
||||
{
|
||||
CH_NOT_APPLIED,
|
||||
CH_SUCCEEDED,
|
||||
CH_FAILED,
|
||||
CH_NO_CHANGE_REQUESTED
|
||||
};
|
||||
|
||||
enum Verbosity
|
||||
{
|
||||
/* Print a message for each file that is processed. */
|
||||
V_high,
|
||||
|
||||
/* Print a message for each file whose attributes we change. */
|
||||
V_changes_only,
|
||||
|
||||
/* Do not be verbose. This is the default. */
|
||||
V_off
|
||||
};
|
||||
|
||||
int lstat ();
|
||||
|
||||
static int change_dir_group PARAMS ((const char *dir, gid_t group,
|
||||
const struct stat *statp));
|
||||
|
||||
/* The name the program was run with. */
|
||||
char *program_name;
|
||||
|
||||
/* If nonzero, and the systems has support for it, change the ownership
|
||||
of symbolic links rather than any files they point to. */
|
||||
static int change_symlinks = 1;
|
||||
|
||||
/* When change_symlinks is set, this should be set to `lstat', otherwise,
|
||||
it should be `stat'. */
|
||||
static int (*xstat) ();
|
||||
|
||||
/* If nonzero, change the ownership of directories recursively. */
|
||||
static int recurse;
|
||||
|
||||
/* If nonzero, force silence (no error messages). */
|
||||
static int force_silent;
|
||||
|
||||
/* Level of verbosity. */
|
||||
static enum Verbosity verbosity = V_off;
|
||||
|
||||
/* 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;
|
||||
@@ -127,38 +83,6 @@ static struct option const long_options[] =
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
/* Tell the user how/if the group of FILE has been changed.
|
||||
CHANGED describes what (if anything) has happened. */
|
||||
|
||||
static void
|
||||
describe_change (const char *file, enum Change_status changed)
|
||||
{
|
||||
const char *fmt;
|
||||
|
||||
if (changed == CH_NOT_APPLIED)
|
||||
{
|
||||
printf (_("neither symbolic link %s nor referent has been changed\n"),
|
||||
quote (file));
|
||||
return;
|
||||
}
|
||||
|
||||
switch (changed)
|
||||
{
|
||||
case CH_SUCCEEDED:
|
||||
fmt = _("group of %s changed to %s\n");
|
||||
break;
|
||||
case CH_FAILED:
|
||||
fmt = _("failed to change group of %s to %s\n");
|
||||
break;
|
||||
case CH_NO_CHANGE_REQUESTED:
|
||||
fmt = _("group of %s retained as %s\n");
|
||||
break;
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
printf (fmt, quote (file), groupname);
|
||||
}
|
||||
|
||||
/* Set *G according to NAME. */
|
||||
|
||||
static void
|
||||
@@ -166,9 +90,8 @@ parse_group (const char *name, gid_t *g)
|
||||
{
|
||||
struct group *grp;
|
||||
|
||||
groupname = name;
|
||||
if (*name == '\0')
|
||||
error (1, 0, _("can not change to null group"));
|
||||
error (1, 0, _("cannot change to null group"));
|
||||
|
||||
grp = getgrnam (name);
|
||||
if (grp == NULL)
|
||||
@@ -193,139 +116,6 @@ parse_group (const char *name, gid_t *g)
|
||||
endgrent (); /* Save a file descriptor. */
|
||||
}
|
||||
|
||||
/* Change the ownership of FILE to GID GROUP.
|
||||
If it is a directory and -R is given, recurse.
|
||||
Return 0 if successful, 1 if errors occurred. */
|
||||
|
||||
static int
|
||||
change_file_group (int cmdline_arg, const char *file, gid_t group)
|
||||
{
|
||||
struct stat file_stats;
|
||||
int errors = 0;
|
||||
|
||||
if ((*xstat) (file, &file_stats))
|
||||
{
|
||||
if (force_silent == 0)
|
||||
error (0, errno, _("getting attributes of %s"), quote (file));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (group != file_stats.st_gid)
|
||||
{
|
||||
int fail;
|
||||
int symlink_changed = 1;
|
||||
int saved_errno;
|
||||
|
||||
if (S_ISLNK (file_stats.st_mode) && change_symlinks)
|
||||
{
|
||||
fail = lchown (file, (uid_t) -1, group);
|
||||
|
||||
/* Ignore the failure if it's due to lack of support (ENOSYS)
|
||||
and this is not a command line argument. */
|
||||
if (!cmdline_arg && fail && errno == ENOSYS)
|
||||
{
|
||||
fail = 0;
|
||||
symlink_changed = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fail = chown (file, (uid_t) -1, group);
|
||||
}
|
||||
|
||||
/* Save errno, since in verbose mode, describe_change might change it. */
|
||||
saved_errno = errno;
|
||||
|
||||
if (verbosity == V_high || (verbosity == V_changes_only && !fail))
|
||||
{
|
||||
enum Change_status ch_status = (! symlink_changed ? CH_NOT_APPLIED
|
||||
: (fail ? CH_FAILED : CH_SUCCEEDED));
|
||||
describe_change (file, ch_status);
|
||||
}
|
||||
|
||||
if (fail)
|
||||
{
|
||||
errors = 1;
|
||||
if (force_silent == 0)
|
||||
{
|
||||
/* Give a more specific message. Some systems set errno
|
||||
to EPERM for both `inaccessible file' and `user not a member
|
||||
of the specified group' errors. */
|
||||
if (saved_errno == EPERM && !group_member (group))
|
||||
{
|
||||
error (0, saved_errno, _("you are not a member of group %s"),
|
||||
quote (groupname));
|
||||
}
|
||||
else if (saved_errno == EINVAL && group > MAXUID)
|
||||
{
|
||||
error (0, 0, _("%s: invalid group number"),
|
||||
quote (groupname));
|
||||
}
|
||||
else
|
||||
{
|
||||
error (0, saved_errno, _("changing group of %s"),
|
||||
quote (file));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (verbosity == V_high)
|
||||
{
|
||||
describe_change (file, CH_NO_CHANGE_REQUESTED);
|
||||
}
|
||||
|
||||
if (recurse && S_ISDIR (file_stats.st_mode))
|
||||
errors |= change_dir_group (file, group, &file_stats);
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
/* Recursively change the ownership of the files in directory DIR
|
||||
to GID GROUP.
|
||||
STATP points to the results of lstat on DIR.
|
||||
Return 0 if successful, 1 if errors occurred. */
|
||||
|
||||
static int
|
||||
change_dir_group (const char *dir, gid_t group, const struct stat *statp)
|
||||
{
|
||||
char *name_space, *namep;
|
||||
char *path; /* Full path of each entry to process. */
|
||||
unsigned dirlength; /* Length of `dir' and '\0'. */
|
||||
unsigned filelength; /* Length of each pathname to process. */
|
||||
unsigned pathlength; /* Bytes allocated for `path'. */
|
||||
int errors = 0;
|
||||
|
||||
name_space = savedir (dir, statp->st_size);
|
||||
if (name_space == NULL)
|
||||
{
|
||||
if (force_silent == 0)
|
||||
error (0, errno, "%s", quote (dir));
|
||||
return 1;
|
||||
}
|
||||
|
||||
dirlength = strlen (dir) + 1; /* + 1 is for the trailing '/'. */
|
||||
pathlength = dirlength + 1;
|
||||
/* Give `path' a dummy value; it will be reallocated before first use. */
|
||||
path = xmalloc (pathlength);
|
||||
strcpy (path, dir);
|
||||
path[dirlength - 1] = '/';
|
||||
|
||||
for (namep = name_space; *namep; namep += filelength - dirlength)
|
||||
{
|
||||
filelength = dirlength + strlen (namep) + 1;
|
||||
if (filelength > pathlength)
|
||||
{
|
||||
pathlength = filelength * 2;
|
||||
path = xrealloc (path, pathlength);
|
||||
}
|
||||
strcpy (path + dirlength, namep);
|
||||
errors |= change_file_group (0, path, group);
|
||||
}
|
||||
free (path);
|
||||
free (name_space);
|
||||
return errors;
|
||||
}
|
||||
|
||||
void
|
||||
usage (int status)
|
||||
{
|
||||
@@ -364,9 +154,10 @@ Change the group membership of each FILE to GROUP.\n\
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
gid_t group;
|
||||
gid_t gid;
|
||||
int errors = 0;
|
||||
int optc;
|
||||
struct Chown_option chopt;
|
||||
|
||||
program_name = argv[0];
|
||||
setlocale (LC_ALL, "");
|
||||
@@ -375,7 +166,7 @@ main (int argc, char **argv)
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
recurse = force_silent = 0;
|
||||
chopt_init (&chopt);
|
||||
|
||||
while ((optc = getopt_long (argc, argv, "Rcfhv", long_options, NULL)) != -1)
|
||||
{
|
||||
@@ -387,22 +178,22 @@ main (int argc, char **argv)
|
||||
reference_file = optarg;
|
||||
break;
|
||||
case DEREFERENCE_OPTION:
|
||||
change_symlinks = 0;
|
||||
chopt.dereference = DEREF_ALWAYS;
|
||||
break;
|
||||
case 'R':
|
||||
recurse = 1;
|
||||
chopt.recurse = 1;
|
||||
break;
|
||||
case 'c':
|
||||
verbosity = V_changes_only;
|
||||
chopt.verbosity = V_changes_only;
|
||||
break;
|
||||
case 'f':
|
||||
force_silent = 1;
|
||||
chopt.force_silent = 1;
|
||||
break;
|
||||
case 'h':
|
||||
change_symlinks = 1;
|
||||
chopt.dereference = DEREF_NEVER;
|
||||
break;
|
||||
case 'v':
|
||||
verbosity = V_high;
|
||||
chopt.verbosity = V_high;
|
||||
break;
|
||||
case_GETOPT_HELP_CHAR;
|
||||
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
|
||||
@@ -417,24 +208,26 @@ main (int argc, char **argv)
|
||||
usage (1);
|
||||
}
|
||||
|
||||
if (change_symlinks)
|
||||
xstat = lstat;
|
||||
else
|
||||
xstat = stat;
|
||||
|
||||
if (reference_file)
|
||||
{
|
||||
struct stat ref_stats;
|
||||
if (stat (reference_file, &ref_stats))
|
||||
error (1, errno, _("getting attributes of %s"), quote (reference_file));
|
||||
|
||||
group = ref_stats.st_gid;
|
||||
chopt.group_name = gid_to_name (ref_stats.st_gid);
|
||||
gid = ref_stats.st_gid;
|
||||
}
|
||||
else
|
||||
parse_group (argv[optind++], &group);
|
||||
{
|
||||
chopt.group_name = argv[optind++];
|
||||
parse_group (chopt.group_name, &gid);
|
||||
}
|
||||
|
||||
for (; optind < argc; ++optind)
|
||||
errors |= change_file_group (1, argv[optind], group);
|
||||
errors |= change_file_owner (1, argv[optind], (uid_t) -1, gid,
|
||||
(uid_t) -1, (gid_t) -1, &chopt);
|
||||
|
||||
chopt_free (&chopt);
|
||||
|
||||
exit (errors);
|
||||
}
|
||||
|
||||
65
src/chmod.c
65
src/chmod.c
@@ -95,6 +95,31 @@ static struct option const long_options[] =
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
static int
|
||||
mode_changed (const char *file, mode_t old_mode)
|
||||
{
|
||||
struct stat new_stats;
|
||||
|
||||
if (lstat (file, &new_stats))
|
||||
{
|
||||
if (force_silent == 0)
|
||||
error (0, errno, _("getting new attributes of %s"), quote (file));
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef S_ISLNK
|
||||
if (S_ISLNK (new_stats.st_mode)
|
||||
&& stat (file, &new_stats))
|
||||
{
|
||||
if (force_silent == 0)
|
||||
error (0, errno, _("getting new attributes of %s"), quote (file));
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
return old_mode != new_stats.st_mode;
|
||||
}
|
||||
|
||||
/* Tell the user how/if the MODE of FILE has been changed.
|
||||
CHANGED describes what (if anything) has happened. */
|
||||
|
||||
@@ -137,6 +162,8 @@ change_file_mode (const char *file, const struct mode_change *changes,
|
||||
struct stat file_stats;
|
||||
mode_t newmode;
|
||||
int errors = 0;
|
||||
int fail;
|
||||
int saved_errno;
|
||||
|
||||
if (lstat (file, &file_stats))
|
||||
{
|
||||
@@ -161,24 +188,21 @@ change_file_mode (const char *file, const struct mode_change *changes,
|
||||
|
||||
newmode = mode_adjust (file_stats.st_mode, changes);
|
||||
|
||||
if (newmode != (file_stats.st_mode & CHMOD_MODE_BITS))
|
||||
fail = chmod (file, newmode);
|
||||
saved_errno = errno;
|
||||
|
||||
if (verbosity == V_high
|
||||
|| (verbosity == V_changes_only
|
||||
&& !fail && mode_changed (file, file_stats.st_mode)))
|
||||
describe_change (file, newmode, (fail ? CH_FAILED : CH_SUCCEEDED));
|
||||
|
||||
if (fail)
|
||||
{
|
||||
int fail = chmod (file, newmode);
|
||||
int saved_errno = errno;
|
||||
|
||||
if (verbosity == V_high || (verbosity == V_changes_only && !fail))
|
||||
describe_change (file, newmode, (fail ? CH_FAILED : CH_SUCCEEDED));
|
||||
|
||||
if (fail)
|
||||
{
|
||||
if (force_silent == 0)
|
||||
error (0, saved_errno, _("changing permissions of %s"),
|
||||
quote (file));
|
||||
errors = 1;
|
||||
}
|
||||
if (force_silent == 0)
|
||||
error (0, saved_errno, _("changing permissions of %s"),
|
||||
quote (file));
|
||||
errors = 1;
|
||||
}
|
||||
else if (verbosity == V_high)
|
||||
describe_change (file, newmode, CH_NO_CHANGE_REQUESTED);
|
||||
|
||||
if (recurse && S_ISDIR (file_stats.st_mode))
|
||||
errors |= change_dir_mode (file, changes, &file_stats);
|
||||
@@ -313,7 +337,12 @@ main (int argc, char **argv)
|
||||
case '-':
|
||||
case '=':
|
||||
if (modeind != 0 && modeind != thisind)
|
||||
error (1, 0, _("invalid mode"));
|
||||
{
|
||||
static char char_string[2] = {0, 0};
|
||||
char_string[0] = c;
|
||||
error (1, 0, _("invalid character %s in mode string %s"),
|
||||
quote_n (0, char_string), quote_n (1, argv[thisind]));
|
||||
}
|
||||
modeind = thisind;
|
||||
break;
|
||||
case REFERENCE_FILE_OPTION:
|
||||
@@ -351,7 +380,7 @@ main (int argc, char **argv)
|
||||
: mode_compile (argv[modeind], MODE_MASK_ALL));
|
||||
|
||||
if (changes == MODE_INVALID)
|
||||
error (1, 0, _("invalid mode"));
|
||||
error (1, 0, _("invalid mode string: %s"), quote (argv[modeind]));
|
||||
else if (changes == MODE_MEMORY_EXHAUSTED)
|
||||
xalloc_die ();
|
||||
else if (changes == MODE_BAD_REFERENCE)
|
||||
|
||||
366
src/chown-core.c
Normal file
366
src/chown-core.c
Normal file
@@ -0,0 +1,366 @@
|
||||
/* chown-core.c -- core functions for changing ownership.
|
||||
Copyright (C) 2000 Free Software Foundation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
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. */
|
||||
|
||||
/* Extracted from chown.c/chgrp.c and librarified by Jim Meyering. */
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
|
||||
#include "system.h"
|
||||
#include "error.h"
|
||||
#include "lchown.h"
|
||||
#include "quote.h"
|
||||
#include "savedir.h"
|
||||
#include "chown-core.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
/* The number of decimal digits required to represent the largest value of
|
||||
type `unsigned int'. This is enough for an 8-byte unsigned int type. */
|
||||
#define UINT_MAX_DECIMAL_DIGITS 20
|
||||
|
||||
#ifndef _POSIX_VERSION
|
||||
struct group *getgrnam ();
|
||||
struct group *getgrgid ();
|
||||
#endif
|
||||
|
||||
int lstat ();
|
||||
|
||||
void
|
||||
chopt_init (struct Chown_option *chopt)
|
||||
{
|
||||
chopt->verbosity = V_off;
|
||||
chopt->dereference = DEREF_NEVER;
|
||||
chopt->recurse = 0;
|
||||
chopt->force_silent = 0;
|
||||
chopt->user_name = 0;
|
||||
chopt->group_name = 0;
|
||||
}
|
||||
|
||||
void
|
||||
chopt_free (struct Chown_option *chopt)
|
||||
{
|
||||
/* Deliberately do not free chopt->user_name or ->group_name.
|
||||
They're not always allocated. */
|
||||
}
|
||||
|
||||
/* Convert N to a string, and return a pointer to that string in memory
|
||||
allocated from the heap. */
|
||||
|
||||
static char *
|
||||
uint_to_string (unsigned int n)
|
||||
{
|
||||
char buf[UINT_MAX_DECIMAL_DIGITS + 1];
|
||||
char *p = buf + sizeof buf;
|
||||
|
||||
*--p = '\0';
|
||||
|
||||
do
|
||||
*--p = '0' + (n % 10);
|
||||
while ((n /= 10) != 0);
|
||||
|
||||
return xstrdup (p);
|
||||
}
|
||||
|
||||
/* Convert the numeric group-id, GID, to a string stored in xmalloc'd memory,
|
||||
and return it. If there's no corresponding group name, use the decimal
|
||||
representation of the ID. */
|
||||
|
||||
char *
|
||||
gid_to_name (gid_t gid)
|
||||
{
|
||||
struct group *grp = getgrgid (gid);
|
||||
return grp ? xstrdup (grp->gr_name) : uint_to_string (gid);
|
||||
}
|
||||
|
||||
/* Convert the numeric user-id, UID, to a string stored in xmalloc'd memory,
|
||||
and return it. If there's no corresponding user name, use the decimal
|
||||
representation of the ID. */
|
||||
|
||||
char *
|
||||
uid_to_name (uid_t uid)
|
||||
{
|
||||
struct passwd *pwd = getpwuid (uid);
|
||||
return pwd ? xstrdup (pwd->pw_name) : uint_to_string (uid);
|
||||
}
|
||||
|
||||
/* Tell the user how/if the user and group of FILE have been changed.
|
||||
If USER is NULL, give the group-oriented messages.
|
||||
CHANGED describes what (if anything) has happened. */
|
||||
|
||||
static void
|
||||
describe_change (const char *file, enum Change_status changed,
|
||||
char const *user, char const *group)
|
||||
{
|
||||
const char *fmt;
|
||||
char *spec;
|
||||
int spec_allocated = 0;
|
||||
|
||||
if (changed == CH_NOT_APPLIED)
|
||||
{
|
||||
printf (_("neither symbolic link %s nor referent has been changed\n"),
|
||||
quote (file));
|
||||
return;
|
||||
}
|
||||
|
||||
if (user)
|
||||
{
|
||||
if (group)
|
||||
{
|
||||
spec = xmalloc (strlen (user) + 1 + strlen (group) + 1);
|
||||
stpcpy (stpcpy (stpcpy (spec, user), ":"), group);
|
||||
spec_allocated = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
spec = (char *) user;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
spec = (char *) group;
|
||||
}
|
||||
|
||||
switch (changed)
|
||||
{
|
||||
case CH_SUCCEEDED:
|
||||
fmt = (user
|
||||
? _("changed ownership of %s to %s\n")
|
||||
: _("changed group of %s to %s\n"));
|
||||
break;
|
||||
case CH_FAILED:
|
||||
fmt = (user
|
||||
? _("failed to change ownership of %s to %s\n")
|
||||
: _("failed to change group of %s to %s\n"));
|
||||
break;
|
||||
case CH_NO_CHANGE_REQUESTED:
|
||||
fmt = (user
|
||||
? _("ownership of %s retained as %s\n")
|
||||
: _("group of %s retained as %s\n"));
|
||||
break;
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
|
||||
printf (fmt, quote (file), spec);
|
||||
|
||||
if (spec_allocated)
|
||||
free (spec);
|
||||
}
|
||||
|
||||
/* Recursively change the ownership of the files in directory DIR to user-id,
|
||||
UID, and group-id, GID, according to the options specified by CHOPT.
|
||||
STATP points to the results of lstat on DIR.
|
||||
Return 0 if successful, 1 if errors occurred. */
|
||||
|
||||
static int
|
||||
change_dir_owner (const char *dir, uid_t uid, gid_t gid,
|
||||
uid_t old_uid, gid_t old_gid,
|
||||
const struct stat *statp,
|
||||
struct Chown_option const *chopt)
|
||||
{
|
||||
char *name_space, *namep;
|
||||
char *path; /* Full path of each entry to process. */
|
||||
unsigned dirlength; /* Length of `dir' and '\0'. */
|
||||
unsigned filelength; /* Length of each pathname to process. */
|
||||
unsigned pathlength; /* Bytes allocated for `path'. */
|
||||
int errors = 0;
|
||||
|
||||
name_space = savedir (dir, statp->st_size);
|
||||
if (name_space == NULL)
|
||||
{
|
||||
if (chopt->force_silent == 0)
|
||||
error (0, errno, "%s", quote (dir));
|
||||
return 1;
|
||||
}
|
||||
|
||||
dirlength = strlen (dir) + 1; /* + 1 is for the trailing '/'. */
|
||||
pathlength = dirlength + 1;
|
||||
/* Give `path' a dummy value; it will be reallocated before first use. */
|
||||
path = xmalloc (pathlength);
|
||||
strcpy (path, dir);
|
||||
path[dirlength - 1] = '/';
|
||||
|
||||
for (namep = name_space; *namep; namep += filelength - dirlength)
|
||||
{
|
||||
filelength = dirlength + strlen (namep) + 1;
|
||||
if (filelength > pathlength)
|
||||
{
|
||||
pathlength = filelength * 2;
|
||||
path = xrealloc (path, pathlength);
|
||||
}
|
||||
strcpy (path + dirlength, namep);
|
||||
errors |= change_file_owner (0, path, uid, gid, old_uid, old_gid,
|
||||
chopt);
|
||||
}
|
||||
free (path);
|
||||
free (name_space);
|
||||
return errors;
|
||||
}
|
||||
|
||||
/* Change the ownership of FILE to user-id, UID, and group-id, GID,
|
||||
provided it presently has owner OLD_UID and group OLD_GID.
|
||||
Honor the options specified by CHOPT.
|
||||
If FILE is a directory and -R is given, recurse.
|
||||
Return 0 if successful, 1 if errors occurred. */
|
||||
|
||||
int
|
||||
change_file_owner (int cmdline_arg, const char *file, uid_t uid, gid_t gid,
|
||||
uid_t old_uid, gid_t old_gid,
|
||||
struct Chown_option const *chopt)
|
||||
{
|
||||
struct stat file_stats;
|
||||
uid_t new_uid;
|
||||
gid_t new_gid;
|
||||
int errors = 0;
|
||||
int is_symlink;
|
||||
int is_directory;
|
||||
|
||||
if (lstat (file, &file_stats))
|
||||
{
|
||||
if (chopt->force_silent == 0)
|
||||
error (0, errno, _("getting attributes of %s"), quote (file));
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* If it's a symlink and we're dereferencing, then use stat
|
||||
to get the attributes of the referent. */
|
||||
if (S_ISLNK (file_stats.st_mode))
|
||||
{
|
||||
if (chopt->dereference == DEREF_ALWAYS
|
||||
&& stat (file, &file_stats))
|
||||
{
|
||||
if (chopt->force_silent == 0)
|
||||
error (0, errno, _("getting attributes of %s"), quote (file));
|
||||
return 1;
|
||||
}
|
||||
|
||||
is_symlink = 1;
|
||||
|
||||
/* With -R, don't traverse through symlinks-to-directories.
|
||||
But of course, this will all change with POSIX's new
|
||||
-H, -L, -P options. */
|
||||
is_directory = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
is_symlink = 0;
|
||||
is_directory = S_ISDIR (file_stats.st_mode);
|
||||
}
|
||||
|
||||
if ((old_uid == (uid_t) -1 || file_stats.st_uid == old_uid)
|
||||
&& (old_gid == (gid_t) -1 || file_stats.st_gid == old_gid))
|
||||
{
|
||||
new_uid = (uid == (uid_t) -1 ? file_stats.st_uid : uid);
|
||||
new_gid = (gid == (gid_t) -1 ? file_stats.st_gid : gid);
|
||||
if (new_uid != file_stats.st_uid || new_gid != file_stats.st_gid)
|
||||
{
|
||||
int fail;
|
||||
int symlink_changed = 1;
|
||||
int saved_errno;
|
||||
int called_lchown = 0;
|
||||
|
||||
if (is_symlink)
|
||||
{
|
||||
if (chopt->dereference == DEREF_NEVER)
|
||||
{
|
||||
called_lchown = 1;
|
||||
fail = lchown (file, new_uid, new_gid);
|
||||
|
||||
/* Ignore the failure if it's due to lack of support (ENOSYS)
|
||||
and this is not a command line argument. */
|
||||
if (!cmdline_arg && fail && errno == ENOSYS)
|
||||
{
|
||||
fail = 0;
|
||||
symlink_changed = 0;
|
||||
}
|
||||
}
|
||||
else if (chopt->dereference == DEREF_ALWAYS)
|
||||
{
|
||||
/* Applying chown to a symlink and expecting it to affect
|
||||
the referent is not portable. So instead, open the
|
||||
file and use fchown on the resulting descriptor. */
|
||||
int fd = open (file, O_RDONLY | O_NONBLOCK | O_NOCTTY);
|
||||
fail = (fd == -1 ? 1 : fchown (fd, new_uid, new_gid));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* FIXME */
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fail = chown (file, new_uid, new_gid);
|
||||
}
|
||||
saved_errno = errno;
|
||||
|
||||
if (chopt->verbosity == V_high
|
||||
|| (chopt->verbosity == V_changes_only && !fail))
|
||||
{
|
||||
enum Change_status ch_status = (! symlink_changed
|
||||
? CH_NOT_APPLIED
|
||||
: (fail
|
||||
? CH_FAILED : CH_SUCCEEDED));
|
||||
describe_change (file, ch_status,
|
||||
chopt->user_name, chopt->group_name);
|
||||
}
|
||||
|
||||
if (fail)
|
||||
{
|
||||
if (chopt->force_silent == 0)
|
||||
error (0, saved_errno, (uid != (uid_t) -1
|
||||
? _("changing ownership of %s")
|
||||
: _("changing group of %s")),
|
||||
quote (file));
|
||||
errors = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The change succeeded. On some systems, the chown function
|
||||
resets the `special' permission bits. When run by a
|
||||
`privileged' user, this program must ensure that at least
|
||||
the set-uid and set-group ones are still set. */
|
||||
if (file_stats.st_mode & ~(S_IFMT | S_IRWXUGO)
|
||||
/* If we called lchown above (which means this is a symlink),
|
||||
then skip it. */
|
||||
&& ! called_lchown)
|
||||
{
|
||||
if (chmod (file, file_stats.st_mode))
|
||||
{
|
||||
error (0, saved_errno,
|
||||
_("unable to restore permissions of %s"),
|
||||
quote (file));
|
||||
fail = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (chopt->verbosity == V_high)
|
||||
{
|
||||
describe_change (file, CH_NO_CHANGE_REQUESTED,
|
||||
chopt->user_name, chopt->group_name);
|
||||
}
|
||||
}
|
||||
|
||||
if (chopt->recurse && is_directory)
|
||||
errors |= change_dir_owner (file, uid, gid,
|
||||
old_uid, old_gid, &file_stats, chopt);
|
||||
return errors;
|
||||
}
|
||||
89
src/chown-core.h
Normal file
89
src/chown-core.h
Normal file
@@ -0,0 +1,89 @@
|
||||
/* chown-core.h -- types and prototypes shared by chown and chgrp.
|
||||
Copyright (C) 2000 Free Software Foundation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef CHOWN_CORE_H
|
||||
# define CHOWN_CORE_H
|
||||
|
||||
enum Change_status
|
||||
{
|
||||
CH_NOT_APPLIED = 1,
|
||||
CH_SUCCEEDED,
|
||||
CH_FAILED,
|
||||
CH_NO_CHANGE_REQUESTED
|
||||
};
|
||||
|
||||
enum Verbosity
|
||||
{
|
||||
/* Print a message for each file that is processed. */
|
||||
V_high,
|
||||
|
||||
/* Print a message for each file whose attributes we change. */
|
||||
V_changes_only,
|
||||
|
||||
/* Do not be verbose. This is the default. */
|
||||
V_off
|
||||
};
|
||||
|
||||
enum Dereference_symlink
|
||||
{
|
||||
DEREF_UNDEFINED = 1,
|
||||
DEREF_NEVER, /* -P */
|
||||
DEREF_COMMAND_LINE_ARGUMENTS, /* -H */
|
||||
DEREF_ALWAYS /* -L */
|
||||
};
|
||||
|
||||
struct Chown_option
|
||||
{
|
||||
/* Level of verbosity. */
|
||||
enum Verbosity verbosity;
|
||||
|
||||
/* If nonzero, change the ownership of directories recursively. */
|
||||
int recurse;
|
||||
|
||||
/* This is useful only on systems with support for changing the
|
||||
ownership of symbolic links. */
|
||||
enum Dereference_symlink dereference;
|
||||
|
||||
/* If nonzero, force silence (no error messages). */
|
||||
int force_silent;
|
||||
|
||||
/* The name of the user to which ownership of the files is being given. */
|
||||
char *user_name;
|
||||
|
||||
/* The name of the group to which ownership of the files is being given. */
|
||||
char *group_name;
|
||||
};
|
||||
|
||||
void
|
||||
chopt_init (struct Chown_option *);
|
||||
|
||||
void
|
||||
chopt_free (struct Chown_option *);
|
||||
|
||||
char *
|
||||
gid_to_name (gid_t);
|
||||
|
||||
char *
|
||||
uid_to_name (uid_t);
|
||||
|
||||
int
|
||||
change_file_owner PARAMS ((int, const char *,
|
||||
uid_t, gid_t,
|
||||
uid_t, gid_t,
|
||||
struct Chown_option const *));
|
||||
|
||||
#endif /* CHOWN_CORE_H */
|
||||
260
src/chown.c
260
src/chown.c
@@ -1,5 +1,5 @@
|
||||
/* chown -- change user and group ownership of files
|
||||
Copyright (C) 89, 90, 91, 1995-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 89, 90, 91, 1995-2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -31,8 +31,6 @@
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include "system.h"
|
||||
@@ -40,6 +38,7 @@
|
||||
#include "lchown.h"
|
||||
#include "quote.h"
|
||||
#include "savedir.h"
|
||||
#include "chown-core.h"
|
||||
|
||||
/* The official name of this program (e.g., no `g' prefix). */
|
||||
#define PROGRAM_NAME "chown"
|
||||
@@ -59,52 +58,9 @@ struct group *getgrgid ();
|
||||
char *parse_user_spec ();
|
||||
void strip_trailing_slashes ();
|
||||
|
||||
enum Change_status
|
||||
{
|
||||
CH_NOT_APPLIED,
|
||||
CH_SUCCEEDED,
|
||||
CH_FAILED,
|
||||
CH_NO_CHANGE_REQUESTED
|
||||
};
|
||||
|
||||
enum Verbosity
|
||||
{
|
||||
/* Print a message for each file that is processed. */
|
||||
V_high,
|
||||
|
||||
/* Print a message for each file whose attributes we change. */
|
||||
V_changes_only,
|
||||
|
||||
/* Do not be verbose. This is the default. */
|
||||
V_off
|
||||
};
|
||||
|
||||
static int change_dir_owner PARAMS ((const char *dir, uid_t user, gid_t group,
|
||||
uid_t old_user, gid_t old_group,
|
||||
const struct stat *statp));
|
||||
|
||||
/* The name the program was run with. */
|
||||
char *program_name;
|
||||
|
||||
/* If nonzero, and the systems has support for it, change the ownership
|
||||
of symbolic links rather than any files they point to. */
|
||||
static int change_symlinks = 1;
|
||||
|
||||
/* If nonzero, change the ownership of directories recursively. */
|
||||
static int recurse;
|
||||
|
||||
/* If nonzero, force silence (no error messages). */
|
||||
static int force_silent;
|
||||
|
||||
/* Level of verbosity. */
|
||||
static enum Verbosity verbosity = V_off;
|
||||
|
||||
/* The name of the user to which ownership of the files is being given. */
|
||||
static char *username;
|
||||
|
||||
/* 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 owner and group IDs
|
||||
of this file. This file must exist. */
|
||||
static char *reference_file;
|
||||
@@ -134,169 +90,6 @@ static struct option const long_options[] =
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
/* Tell the user how/if the user and group of FILE have been changed.
|
||||
CHANGED describes what (if anything) has happened. */
|
||||
|
||||
static void
|
||||
describe_change (const char *file, enum Change_status changed)
|
||||
{
|
||||
const char *fmt;
|
||||
|
||||
if (changed == CH_NOT_APPLIED)
|
||||
{
|
||||
printf (_("neither symbolic link %s nor referent has been changed\n"),
|
||||
quote (file));
|
||||
return;
|
||||
}
|
||||
|
||||
switch (changed)
|
||||
{
|
||||
case CH_SUCCEEDED:
|
||||
fmt = _("owner of %s changed to ");
|
||||
break;
|
||||
case CH_FAILED:
|
||||
fmt = _("failed to change owner of %s to ");
|
||||
break;
|
||||
case CH_NO_CHANGE_REQUESTED:
|
||||
fmt = _("owner of %s retained as ");
|
||||
break;
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
printf (fmt, file);
|
||||
if (groupname)
|
||||
printf ("%s.%s\n", username, groupname);
|
||||
else
|
||||
printf ("%s\n", username);
|
||||
}
|
||||
|
||||
/* Change the ownership of FILE to UID USER and GID GROUP
|
||||
provided it presently has UID OLDUSER and GID OLDGROUP.
|
||||
If it is a directory and -R is given, recurse.
|
||||
Return 0 if successful, 1 if errors occurred. */
|
||||
|
||||
static int
|
||||
change_file_owner (int cmdline_arg, const char *file, uid_t user, gid_t group,
|
||||
uid_t old_user, gid_t old_group)
|
||||
{
|
||||
struct stat file_stats;
|
||||
uid_t newuser;
|
||||
gid_t newgroup;
|
||||
int errors = 0;
|
||||
|
||||
if (lstat (file, &file_stats))
|
||||
{
|
||||
if (force_silent == 0)
|
||||
error (0, errno, _("getting attributes of %s"), quote (file));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((old_user == (uid_t) -1 || file_stats.st_uid == old_user) &&
|
||||
(old_group == (gid_t) -1 || file_stats.st_gid == old_group))
|
||||
{
|
||||
newuser = user == (uid_t) -1 ? file_stats.st_uid : user;
|
||||
newgroup = group == (gid_t) -1 ? file_stats.st_gid : group;
|
||||
if (newuser != file_stats.st_uid || newgroup != file_stats.st_gid)
|
||||
{
|
||||
int fail;
|
||||
int symlink_changed = 1;
|
||||
int saved_errno;
|
||||
|
||||
if (S_ISLNK (file_stats.st_mode) && change_symlinks)
|
||||
{
|
||||
fail = lchown (file, newuser, newgroup);
|
||||
|
||||
/* Ignore the failure if it's due to lack of support (ENOSYS)
|
||||
and this is not a command line argument. */
|
||||
if (!cmdline_arg && fail && errno == ENOSYS)
|
||||
{
|
||||
fail = 0;
|
||||
symlink_changed = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fail = chown (file, newuser, newgroup);
|
||||
}
|
||||
saved_errno = errno;
|
||||
|
||||
if (verbosity == V_high || (verbosity == V_changes_only && !fail))
|
||||
{
|
||||
enum Change_status ch_status = (! symlink_changed
|
||||
? CH_NOT_APPLIED
|
||||
: (fail
|
||||
? CH_FAILED : CH_SUCCEEDED));
|
||||
describe_change (file, ch_status);
|
||||
}
|
||||
|
||||
if (fail)
|
||||
{
|
||||
if (force_silent == 0)
|
||||
error (0, saved_errno, _("changing ownership of %s"),
|
||||
quote (file));
|
||||
errors = 1;
|
||||
}
|
||||
}
|
||||
else if (verbosity == V_high)
|
||||
{
|
||||
describe_change (file, CH_NO_CHANGE_REQUESTED);
|
||||
}
|
||||
}
|
||||
|
||||
if (recurse && S_ISDIR (file_stats.st_mode))
|
||||
errors |= change_dir_owner (file, user, group,
|
||||
old_user, old_group, &file_stats);
|
||||
return errors;
|
||||
}
|
||||
|
||||
/* Recursively change the ownership of the files in directory DIR
|
||||
to UID USER and GID GROUP.
|
||||
STATP points to the results of lstat on DIR.
|
||||
Return 0 if successful, 1 if errors occurred. */
|
||||
|
||||
static int
|
||||
change_dir_owner (const char *dir, uid_t user, gid_t group,
|
||||
uid_t old_user, gid_t old_group,
|
||||
const struct stat *statp)
|
||||
{
|
||||
char *name_space, *namep;
|
||||
char *path; /* Full path of each entry to process. */
|
||||
unsigned dirlength; /* Length of `dir' and '\0'. */
|
||||
unsigned filelength; /* Length of each pathname to process. */
|
||||
unsigned pathlength; /* Bytes allocated for `path'. */
|
||||
int errors = 0;
|
||||
|
||||
name_space = savedir (dir, statp->st_size);
|
||||
if (name_space == NULL)
|
||||
{
|
||||
if (force_silent == 0)
|
||||
error (0, errno, "%s", quote (dir));
|
||||
return 1;
|
||||
}
|
||||
|
||||
dirlength = strlen (dir) + 1; /* + 1 is for the trailing '/'. */
|
||||
pathlength = dirlength + 1;
|
||||
/* Give `path' a dummy value; it will be reallocated before first use. */
|
||||
path = xmalloc (pathlength);
|
||||
strcpy (path, dir);
|
||||
path[dirlength - 1] = '/';
|
||||
|
||||
for (namep = name_space; *namep; namep += filelength - dirlength)
|
||||
{
|
||||
filelength = dirlength + strlen (namep) + 1;
|
||||
if (filelength > pathlength)
|
||||
{
|
||||
pathlength = filelength * 2;
|
||||
path = xrealloc (path, pathlength);
|
||||
}
|
||||
strcpy (path + dirlength, namep);
|
||||
errors |= change_file_owner (0, path, user, group, old_user, old_group);
|
||||
}
|
||||
free (path);
|
||||
free (name_space);
|
||||
return errors;
|
||||
}
|
||||
|
||||
void
|
||||
usage (int status)
|
||||
{
|
||||
@@ -333,6 +126,8 @@ Change the owner and/or group of each FILE to OWNER and/or GROUP.\n\
|
||||
--help display this help and exit\n\
|
||||
--version output version information and exit\n\
|
||||
\n\
|
||||
"));
|
||||
printf (_("\
|
||||
Owner is unchanged if missing. Group is unchanged if missing, but changed\n\
|
||||
to login group if implied by a `:'. OWNER and GROUP may be numeric as well\n\
|
||||
as symbolic.\n\
|
||||
@@ -345,10 +140,11 @@ as symbolic.\n\
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
uid_t user = (uid_t) -1; /* New uid; -1 if not to be changed. */
|
||||
gid_t group = (uid_t) -1; /* New gid; -1 if not to be changed. */
|
||||
uid_t old_user = (uid_t) -1; /* Old uid; -1 if unrestricted. */
|
||||
gid_t old_group = (uid_t) -1; /* Old gid; -1 if unrestricted. */
|
||||
uid_t uid = (uid_t) -1; /* New uid; -1 if not to be changed. */
|
||||
gid_t gid = (uid_t) -1; /* New gid; -1 if not to be changed. */
|
||||
uid_t old_uid = (uid_t) -1; /* Old uid; -1 if unrestricted. */
|
||||
gid_t old_gid = (uid_t) -1; /* Old gid; -1 if unrestricted. */
|
||||
struct Chown_option chopt;
|
||||
|
||||
int errors = 0;
|
||||
int optc;
|
||||
@@ -360,7 +156,7 @@ main (int argc, char **argv)
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
recurse = force_silent = 0;
|
||||
chopt_init (&chopt);
|
||||
|
||||
while ((optc = getopt_long (argc, argv, "Rcfhv", long_options, NULL)) != -1)
|
||||
{
|
||||
@@ -372,32 +168,32 @@ main (int argc, char **argv)
|
||||
reference_file = optarg;
|
||||
break;
|
||||
case DEREFERENCE_OPTION:
|
||||
change_symlinks = 0;
|
||||
chopt.dereference = DEREF_ALWAYS;
|
||||
break;
|
||||
case FROM_OPTION:
|
||||
{
|
||||
char *u_dummy, *g_dummy;
|
||||
const char *e = parse_user_spec (argv[optind],
|
||||
&old_user, &old_group,
|
||||
&old_uid, &old_gid,
|
||||
&u_dummy, &g_dummy);
|
||||
if (e)
|
||||
error (1, 0, "%s: %s", quote (argv[optind]), e);
|
||||
break;
|
||||
}
|
||||
case 'R':
|
||||
recurse = 1;
|
||||
chopt.recurse = 1;
|
||||
break;
|
||||
case 'c':
|
||||
verbosity = V_changes_only;
|
||||
chopt.verbosity = V_changes_only;
|
||||
break;
|
||||
case 'f':
|
||||
force_silent = 1;
|
||||
chopt.force_silent = 1;
|
||||
break;
|
||||
case 'h':
|
||||
change_symlinks = 1;
|
||||
chopt.dereference = DEREF_NEVER;
|
||||
break;
|
||||
case 'v':
|
||||
verbosity = V_high;
|
||||
chopt.verbosity = V_high;
|
||||
break;
|
||||
case_GETOPT_HELP_CHAR;
|
||||
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
|
||||
@@ -419,17 +215,21 @@ main (int argc, char **argv)
|
||||
if (stat (reference_file, &ref_stats))
|
||||
error (1, errno, _("getting attributes of %s"), quote (reference_file));
|
||||
|
||||
user = ref_stats.st_uid;
|
||||
group = ref_stats.st_gid;
|
||||
uid = ref_stats.st_uid;
|
||||
gid = ref_stats.st_gid;
|
||||
chopt.user_name = uid_to_name (ref_stats.st_uid);
|
||||
chopt.group_name = gid_to_name (ref_stats.st_gid);
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *e = parse_user_spec (argv[optind], &user, &group,
|
||||
&username, &groupname);
|
||||
const char *e = parse_user_spec (argv[optind], &uid, &gid,
|
||||
&chopt.user_name, &chopt.group_name);
|
||||
if (e)
|
||||
error (1, 0, "%s: %s", argv[optind], e);
|
||||
if (username == NULL)
|
||||
username = "";
|
||||
|
||||
/* FIXME: set it to the empty string? */
|
||||
if (chopt.user_name == NULL)
|
||||
chopt.user_name = "";
|
||||
|
||||
optind++;
|
||||
}
|
||||
@@ -437,9 +237,11 @@ main (int argc, char **argv)
|
||||
for (; optind < argc; ++optind)
|
||||
{
|
||||
strip_trailing_slashes (argv[optind]);
|
||||
errors |= change_file_owner (1, argv[optind], user, group,
|
||||
old_user, old_group);
|
||||
errors |= change_file_owner (1, argv[optind], uid, gid,
|
||||
old_uid, old_gid, &chopt);
|
||||
}
|
||||
|
||||
chopt_free (&chopt);
|
||||
|
||||
exit (errors);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* cksum -- calculate and print POSIX.2 checksums and sizes of files
|
||||
Copyright (C) 92, 1995-2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 92, 1995-2001 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
|
||||
@@ -296,7 +296,7 @@ main (int argc, char **argv)
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
|
||||
parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE, VERSION,
|
||||
AUTHORS, usage);
|
||||
|
||||
have_read_stdin = 0;
|
||||
|
||||
384
src/copy.c
384
src/copy.c
@@ -1,5 +1,5 @@
|
||||
/* copy.c -- core functions for copying files and directories
|
||||
Copyright (C) 89, 90, 91, 1995-2000 Free Software Foundation.
|
||||
Copyright (C) 89, 90, 91, 1995-2001 Free Software Foundation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -44,6 +44,10 @@
|
||||
or if the target system doesn't support file ownership. */ \
|
||||
&& ((errno != EPERM && errno != EINVAL) || x->myeuid == 0))
|
||||
|
||||
#define SAME_OWNER(A, B) ((A).st_uid == (B).st_uid)
|
||||
#define SAME_GROUP(A, B) ((A).st_gid == (B).st_gid)
|
||||
#define SAME_OWNER_AND_GROUP(A, B) (SAME_OWNER (A, B) && SAME_GROUP (A, B))
|
||||
|
||||
struct dir_list
|
||||
{
|
||||
struct dir_list *parent;
|
||||
@@ -55,8 +59,6 @@ int full_write ();
|
||||
int euidaccess ();
|
||||
int yesno ();
|
||||
|
||||
int lstat ();
|
||||
|
||||
static int copy_internal PARAMS ((const char *src_path, const char *dst_path,
|
||||
int new_dst, dev_t device,
|
||||
struct dir_list *ancestors,
|
||||
@@ -65,6 +67,11 @@ static int copy_internal PARAMS ((const char *src_path, const char *dst_path,
|
||||
int *copy_into_self,
|
||||
int *rename_succeeded));
|
||||
|
||||
/* Pointers to the file names: they're used in the diagnostic that is issued
|
||||
when we detect the user is trying to copy a directory into itself. */
|
||||
static char const *top_level_src_path;
|
||||
static char const *top_level_dst_path;
|
||||
|
||||
/* The invocation name of this program. */
|
||||
extern char *program_name;
|
||||
|
||||
@@ -167,12 +174,13 @@ copy_dir (const char *src_path_in, const char *dst_path_in, int new_dst,
|
||||
in the source file as holes in the destination file.
|
||||
(Holes are read as zeroes by the `read' system call.)
|
||||
Use DST_MODE as the 3rd argument in the call to open.
|
||||
X provides many option settings.
|
||||
Return 0 if successful, -1 if an error occurred.
|
||||
FIXME: describe sparse_mode. */
|
||||
*NEW_DST is as in copy_internal. */
|
||||
|
||||
static int
|
||||
copy_reg (const char *src_path, const char *dst_path,
|
||||
enum Sparse_type sparse_mode, mode_t dst_mode)
|
||||
const struct cp_options *x, mode_t dst_mode, int *new_dst)
|
||||
{
|
||||
char *buf;
|
||||
int buf_size;
|
||||
@@ -184,7 +192,7 @@ copy_reg (const char *src_path, const char *dst_path,
|
||||
int return_val = 0;
|
||||
off_t n_read_total = 0;
|
||||
int last_write_made_hole = 0;
|
||||
int make_holes = (sparse_mode == SPARSE_ALWAYS);
|
||||
int make_holes = (x->sparse_mode == SPARSE_ALWAYS);
|
||||
|
||||
source_desc = open (src_path, O_RDONLY);
|
||||
if (source_desc < 0)
|
||||
@@ -202,12 +210,38 @@ copy_reg (const char *src_path, const char *dst_path,
|
||||
return -1;
|
||||
}
|
||||
|
||||
dest_desc = open (dst_path, O_WRONLY | O_CREAT | O_TRUNC, dst_mode);
|
||||
/* These semantics are required for cp.
|
||||
The if-block will be taken in move_mode. */
|
||||
if (*new_dst)
|
||||
{
|
||||
dest_desc = open (dst_path, O_WRONLY | O_CREAT, dst_mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
dest_desc = open (dst_path, O_WRONLY | O_TRUNC, dst_mode);
|
||||
|
||||
if (dest_desc < 0 && x->unlink_dest_after_failed_open)
|
||||
{
|
||||
if (unlink (dst_path))
|
||||
{
|
||||
error (0, errno, _("cannot remove %s"), quote (dst_path));
|
||||
return_val = -1;
|
||||
goto close_src_desc;
|
||||
}
|
||||
|
||||
/* Tell caller that the destination file was unlinked. */
|
||||
*new_dst = 1;
|
||||
|
||||
/* Try the open again, but this time with different flags. */
|
||||
dest_desc = open (dst_path, O_WRONLY | O_CREAT, dst_mode);
|
||||
}
|
||||
}
|
||||
|
||||
if (dest_desc < 0)
|
||||
{
|
||||
error (0, errno, _("cannot create regular file %s"), quote (dst_path));
|
||||
return_val = -1;
|
||||
goto ret2;
|
||||
goto close_src_desc;
|
||||
}
|
||||
|
||||
/* Find out the optimal buffer size. */
|
||||
@@ -216,13 +250,13 @@ copy_reg (const char *src_path, const char *dst_path,
|
||||
{
|
||||
error (0, errno, _("cannot fstat %s"), quote (dst_path));
|
||||
return_val = -1;
|
||||
goto ret;
|
||||
goto close_src_and_dst_desc;
|
||||
}
|
||||
|
||||
buf_size = ST_BLKSIZE (sb);
|
||||
|
||||
#if HAVE_STRUCT_STAT_ST_BLOCKS
|
||||
if (sparse_mode == SPARSE_AUTO && S_ISREG (sb.st_mode))
|
||||
if (x->sparse_mode == SPARSE_AUTO && S_ISREG (sb.st_mode))
|
||||
{
|
||||
/* Use a heuristic to determine whether SRC_PATH contains any
|
||||
sparse blocks. */
|
||||
@@ -231,7 +265,7 @@ copy_reg (const char *src_path, const char *dst_path,
|
||||
{
|
||||
error (0, errno, _("cannot fstat %s"), quote (src_path));
|
||||
return_val = -1;
|
||||
goto ret;
|
||||
goto close_src_and_dst_desc;
|
||||
}
|
||||
|
||||
/* If the file has fewer blocks than would normally
|
||||
@@ -258,7 +292,7 @@ copy_reg (const char *src_path, const char *dst_path,
|
||||
#endif
|
||||
error (0, errno, _("reading %s"), quote (src_path));
|
||||
return_val = -1;
|
||||
goto ret;
|
||||
goto close_src_and_dst_desc;
|
||||
}
|
||||
if (n_read == 0)
|
||||
break;
|
||||
@@ -292,7 +326,7 @@ copy_reg (const char *src_path, const char *dst_path,
|
||||
{
|
||||
error (0, errno, _("cannot lseek %s"), quote (dst_path));
|
||||
return_val = -1;
|
||||
goto ret;
|
||||
goto close_src_and_dst_desc;
|
||||
}
|
||||
last_write_made_hole = 1;
|
||||
}
|
||||
@@ -306,7 +340,7 @@ copy_reg (const char *src_path, const char *dst_path,
|
||||
{
|
||||
error (0, errno, _("writing %s"), quote (dst_path));
|
||||
return_val = -1;
|
||||
goto ret;
|
||||
goto close_src_and_dst_desc;
|
||||
}
|
||||
last_write_made_hole = 0;
|
||||
}
|
||||
@@ -333,13 +367,13 @@ copy_reg (const char *src_path, const char *dst_path,
|
||||
}
|
||||
}
|
||||
|
||||
ret:
|
||||
close_src_and_dst_desc:
|
||||
if (close (dest_desc) < 0)
|
||||
{
|
||||
error (0, errno, _("closing %s"), quote (dst_path));
|
||||
return_val = -1;
|
||||
}
|
||||
ret2:
|
||||
close_src_desc:
|
||||
if (close (source_desc) < 0)
|
||||
{
|
||||
error (0, errno, _("closing %s"), quote (src_path));
|
||||
@@ -349,6 +383,164 @@ ret2:
|
||||
return return_val;
|
||||
}
|
||||
|
||||
/* Return nonzero if it's ok that the source and destination
|
||||
files are the `same' by some measure. The goal is to avoid
|
||||
making the `copy' operation remove both copies of the file
|
||||
in that case, while still allowing the user to e.g., move or
|
||||
copy a regular file onto a symlink that points to it.
|
||||
Try to minimize the cost of this function in the common case. */
|
||||
|
||||
static int
|
||||
same_file_ok (const char *src_path, const struct stat *src_sb,
|
||||
const char *dst_path, const struct stat *dst_sb,
|
||||
const struct cp_options *x, int *return_now)
|
||||
{
|
||||
const struct stat *src_sb_link;
|
||||
const struct stat *dst_sb_link;
|
||||
struct stat tmp_dst_sb;
|
||||
struct stat tmp_src_sb;
|
||||
|
||||
int same_link;
|
||||
int same = (SAME_INODE (*src_sb, *dst_sb));
|
||||
|
||||
*return_now = 0;
|
||||
|
||||
/* FIXME: this should (at the very least) be moved into the following
|
||||
if-block. More likely, it should be removed, because it inhibits
|
||||
making backups. But removing it will result in a change in behavior
|
||||
that will probably have to be documented -- and tests will have to
|
||||
be updated. */
|
||||
if (same && x->hard_link)
|
||||
{
|
||||
*return_now = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (x->xstat == lstat)
|
||||
{
|
||||
same_link = same;
|
||||
|
||||
/* If both the source and destination files are symlinks (and we'll
|
||||
know this here IFF preserving symlinks (aka xstat == lstat),
|
||||
then it's ok -- as long as they are distinct. */
|
||||
if (S_ISLNK (src_sb->st_mode) && S_ISLNK (dst_sb->st_mode))
|
||||
return ! same_name (src_path, dst_path);
|
||||
|
||||
src_sb_link = src_sb;
|
||||
dst_sb_link = dst_sb;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!same)
|
||||
return 1;
|
||||
|
||||
if (lstat (dst_path, &tmp_dst_sb)
|
||||
|| lstat (src_path, &tmp_src_sb))
|
||||
return 1;
|
||||
|
||||
src_sb_link = &tmp_src_sb;
|
||||
dst_sb_link = &tmp_dst_sb;
|
||||
|
||||
same_link = SAME_INODE (*src_sb_link, *dst_sb_link);
|
||||
|
||||
/* If both are symlinks, then it's ok, but only if the destination
|
||||
will be unlinked before being opened. This is like the test
|
||||
above, but with the addition of the unlink_dest_before_opening
|
||||
conjunct because otherwise, with two symlinks to the same target,
|
||||
we'd end up truncating the source file. */
|
||||
if (S_ISLNK (src_sb_link->st_mode) && S_ISLNK (dst_sb_link->st_mode)
|
||||
&& x->unlink_dest_before_opening)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* The backup code ensures there's a copy, so it's ok to remove
|
||||
any destination file. But there's one exception: when both
|
||||
source and destination are the same directory entry. In that
|
||||
case, moving the destination file aside (in making the backup)
|
||||
would also rename the source file and result in an error. */
|
||||
if (x->backup_type != none)
|
||||
{
|
||||
if (!same_link)
|
||||
return 1;
|
||||
|
||||
return ! same_name (src_path, dst_path);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* FIXME: use or remove */
|
||||
|
||||
/* If we're making a backup, we'll detect the problem case in
|
||||
copy_reg because SRC_PATH will no longer exist. Allowing
|
||||
the test to be deferred lets cp do some useful things.
|
||||
But when creating hardlinks and SRC_PATH is a symlink
|
||||
but DST_PATH is not we must test anyway. */
|
||||
if (x->hard_link
|
||||
|| !S_ISLNK (src_sb_link->st_mode)
|
||||
|| S_ISLNK (dst_sb_link->st_mode))
|
||||
return 1;
|
||||
|
||||
if (x->dereference != DEREF_NEVER)
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
/* They may refer to the same file if we're in move mode and the
|
||||
target is a symlink. That is ok, since we remove any existing
|
||||
destination file before opening it -- via `rename' if they're on
|
||||
the same file system, via `unlink (DST_PATH)' otherwise.
|
||||
It's also ok if they're distinct hard links to the same file. */
|
||||
if ((x->move_mode || x->unlink_dest_before_opening)
|
||||
&& (S_ISLNK (dst_sb_link->st_mode)
|
||||
|| (same_link && !same_name (src_path, dst_path))))
|
||||
return 1;
|
||||
|
||||
/* If neither is a symlink, then it's ok as long as they aren't
|
||||
hard links to the same file. */
|
||||
if (!S_ISLNK (src_sb_link->st_mode) && !S_ISLNK (dst_sb_link->st_mode))
|
||||
{
|
||||
if (!SAME_INODE (*src_sb_link, *dst_sb_link))
|
||||
return 1;
|
||||
|
||||
/* If they are the same file, it's ok if we're making hard links. */
|
||||
if (x->hard_link)
|
||||
{
|
||||
*return_now = 1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* It's ok to remove a destination symlink. But that works only when we
|
||||
unlink before opening the destination and when the source and destination
|
||||
files are on the same partition. */
|
||||
if (x->unlink_dest_before_opening
|
||||
&& S_ISLNK (dst_sb_link->st_mode))
|
||||
return dst_sb_link->st_dev == src_sb_link->st_dev;
|
||||
|
||||
if (x->xstat == lstat)
|
||||
{
|
||||
if ( ! S_ISLNK (src_sb_link->st_mode))
|
||||
tmp_src_sb = *src_sb_link;
|
||||
else if (stat (src_path, &tmp_src_sb))
|
||||
return 1;
|
||||
|
||||
if ( ! S_ISLNK (dst_sb_link->st_mode))
|
||||
tmp_dst_sb = *dst_sb_link;
|
||||
else if (stat (dst_path, &tmp_dst_sb))
|
||||
return 1;
|
||||
|
||||
if ( ! SAME_INODE (tmp_src_sb, tmp_dst_sb))
|
||||
return 1;
|
||||
|
||||
/* FIXME: shouldn't this be testing whether we're making symlinks? */
|
||||
if (x->hard_link)
|
||||
{
|
||||
*return_now = 1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Copy the file SRC_PATH to the file DST_PATH. The files may be of
|
||||
any type. NEW_DST should be nonzero if the file DST_PATH cannot
|
||||
exist because its parent directory was just created; NEW_DST should
|
||||
@@ -380,6 +572,7 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
int rename_errno;
|
||||
int delayed_fail;
|
||||
int copied_as_regular = 0;
|
||||
int ran_chown = 0;
|
||||
|
||||
if (move_mode && rename_succeeded)
|
||||
*rename_succeeded = 0;
|
||||
@@ -395,6 +588,10 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
find created files so as to not copy infinitely if a directory is
|
||||
copied into itself. */
|
||||
|
||||
/* Associate the destination path with the source device and inode
|
||||
so that if we encounter a matching dev/ino pair in the source tree
|
||||
we can arrange to create a hard link between the corresponding names
|
||||
in the destination tree. */
|
||||
earlier_file = remember_copied (dst_path, src_sb.st_ino, src_sb.st_dev);
|
||||
|
||||
src_mode = src_sb.st_mode;
|
||||
@@ -422,64 +619,25 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
}
|
||||
else
|
||||
{
|
||||
int same;
|
||||
int return_now;
|
||||
int ok = same_file_ok (src_path, &src_sb, dst_path, &dst_sb,
|
||||
x, &return_now);
|
||||
if (return_now)
|
||||
return 0;
|
||||
|
||||
/* The destination file exists already. */
|
||||
|
||||
same = (SAME_INODE (src_sb, dst_sb));
|
||||
|
||||
#ifdef S_ISLNK
|
||||
/* If we're preserving symlinks (--no-dereference) and either
|
||||
file is a symlink, use stat (not xstat) to see if they refer
|
||||
to the same file. */
|
||||
if (!same
|
||||
|
||||
/* If we'll remove DST_PATH first, then this doesn't matter. */
|
||||
&& ! x->force
|
||||
|
||||
/* Allow them to be the same (and don't set `same') if we're
|
||||
in move mode and the target is a symlink. That is ok, since
|
||||
we remove any existing destination file before opening it --
|
||||
via `rename' if they're on the same file system,
|
||||
via `unlink(DST_PATH)' otherwise. */
|
||||
&& !(move_mode
|
||||
&& S_ISLNK (dst_sb.st_mode))
|
||||
|
||||
/* If we're making a backup, we'll detect the problem case in
|
||||
copy_reg because SRC_PATH will no longer exist. Allowing
|
||||
the test to be deferred lets cp do some useful things.
|
||||
But when creating hardlinks and SRC_PATH is a symlink
|
||||
but DST_PATH is not we must test anyway. */
|
||||
&& (x->backup_type == none
|
||||
|| (x->hard_link
|
||||
&& S_ISLNK (src_sb.st_mode)
|
||||
&& !S_ISLNK (dst_sb.st_mode)))
|
||||
&& x->dereference == DEREF_NEVER
|
||||
&& (S_ISLNK (dst_sb.st_mode) ^ S_ISLNK (src_sb.st_mode)))
|
||||
if (! ok)
|
||||
{
|
||||
struct stat dst2_sb;
|
||||
struct stat src2_sb;
|
||||
if (stat (dst_path, &dst2_sb) == 0
|
||||
&& stat (src_path, &src2_sb) == 0
|
||||
&& SAME_INODE (src2_sb, dst2_sb))
|
||||
{
|
||||
same = 1;
|
||||
}
|
||||
error (0, 0, _("%s and %s are the same file"),
|
||||
quote_n (0, src_path), quote_n (1, dst_path));
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (same)
|
||||
if (S_ISDIR (src_type) && !S_ISDIR (dst_sb.st_mode))
|
||||
{
|
||||
if (x->hard_link)
|
||||
return 0;
|
||||
|
||||
if (x->backup_type == none
|
||||
&& (!x->force || same_name (src_path, dst_path)))
|
||||
{
|
||||
error (0, 0, _("%s and %s are the same file"),
|
||||
quote_n (0, src_path), quote_n (1, dst_path));
|
||||
return 1;
|
||||
}
|
||||
error (0, 0,
|
||||
_("cannot overwrite non-directory %s with directory %s"),
|
||||
quote_n (0, dst_path), quote_n (1, src_path));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!S_ISDIR (src_type))
|
||||
@@ -498,7 +656,7 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
|
||||
if (!S_ISDIR (src_type) && x->interactive)
|
||||
{
|
||||
if (euidaccess (dst_path, W_OK) != 0 && x->force)
|
||||
if (euidaccess (dst_path, W_OK) != 0)
|
||||
{
|
||||
fprintf (stderr,
|
||||
_("%s: overwrite %s, overriding mode %04lo? "),
|
||||
@@ -579,34 +737,17 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
}
|
||||
new_dst = 1;
|
||||
}
|
||||
else if (x->force)
|
||||
else if (! S_ISDIR (dst_sb.st_mode)
|
||||
&& (x->unlink_dest_before_opening
|
||||
|| (x->xstat == lstat
|
||||
&& ! S_ISREG (src_sb.st_mode))))
|
||||
{
|
||||
if (S_ISDIR (dst_sb.st_mode))
|
||||
if (unlink (dst_path) && errno != ENOENT)
|
||||
{
|
||||
/* Temporarily change mode to allow overwriting. */
|
||||
if (euidaccess (dst_path, W_OK | X_OK) != 0
|
||||
&& chmod (dst_path, S_IRWXU))
|
||||
{
|
||||
error (0, errno,
|
||||
_("cannot change permissions for %s"),
|
||||
quote (dst_path));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (unlink (dst_path) && errno != ENOENT)
|
||||
{
|
||||
error (0, errno, _("cannot remove old link to %s"),
|
||||
quote (dst_path));
|
||||
if (x->failed_unlink_is_fatal)
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_dst = 1;
|
||||
}
|
||||
error (0, errno, _("cannot remove %s"), quote (dst_path));
|
||||
return 1;
|
||||
}
|
||||
new_dst = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -632,8 +773,21 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
directories). */
|
||||
if (S_ISDIR (src_type))
|
||||
{
|
||||
error (0, 0, _("won't create hard link %s to directory %s"),
|
||||
quote_n (0, dst_path), quote_n (1, earlier_file));
|
||||
/* If src_path and earlier_file refer to the same directory entry,
|
||||
then warn about copying a directory into itself. */
|
||||
if (same_name (src_path, earlier_file))
|
||||
{
|
||||
error (0, 0, _("cannot copy a directory, %s, into itself, %s"),
|
||||
quote_n (0, top_level_src_path),
|
||||
quote_n (1, top_level_dst_path));
|
||||
*copy_into_self = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
error (0, 0, _("will not create hard link %s to directory %s"),
|
||||
quote_n (0, dst_path), quote_n (1, earlier_file));
|
||||
}
|
||||
|
||||
goto un_backup;
|
||||
}
|
||||
|
||||
@@ -679,7 +833,13 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
/* FIXME: this is a little fragile in that it relies on rename(2)
|
||||
failing with a specific errno value. Expect problems on
|
||||
non-POSIX systems. */
|
||||
error (0, 0, _("cannot move %s to a subdirectory of itself, %s"),
|
||||
quote_n (0, top_level_src_path),
|
||||
quote_n (1, top_level_dst_path));
|
||||
*copy_into_self = 1;
|
||||
/* FIXME-cleanup: Don't return zero here; adjust mv.c accordingly.
|
||||
The only caller that uses this code (mv.c) ends up setting its
|
||||
exit status to nonzero when copy_into_self is nonzero. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -699,6 +859,8 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
quote_n (0, src_path), quote_n (1, dst_path));
|
||||
return 1;
|
||||
}
|
||||
|
||||
new_dst = 1;
|
||||
}
|
||||
|
||||
delayed_fail = 0;
|
||||
@@ -825,8 +987,8 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
/* POSIX says the permission bits of the source file must be
|
||||
used as the 3rd argument in the open call, but that's not consistent
|
||||
with historical practice. */
|
||||
if (copy_reg (src_path, dst_path, x->sparse_mode,
|
||||
get_dest_mode (x, src_mode)))
|
||||
if (copy_reg (src_path, dst_path, x,
|
||||
get_dest_mode (x, src_mode), &new_dst))
|
||||
goto un_backup;
|
||||
}
|
||||
else
|
||||
@@ -954,8 +1116,11 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
}
|
||||
}
|
||||
|
||||
if (x->preserve_owner_and_group)
|
||||
/* Avoid calling chown if we know it's not necessary. */
|
||||
if (x->preserve_owner_and_group
|
||||
&& (new_dst || !SAME_OWNER_AND_GROUP (src_sb, dst_sb)))
|
||||
{
|
||||
ran_chown = 1;
|
||||
if (DO_CHOWN (chown, dst_path, src_sb.st_uid, src_sb.st_gid))
|
||||
{
|
||||
error (0, errno, _("preserving ownership for %s"), quote (dst_path));
|
||||
@@ -964,9 +1129,11 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
}
|
||||
}
|
||||
|
||||
/* Permissions of newly-created regular files were set upon `open'
|
||||
in copy_reg. */
|
||||
if (new_dst && copied_as_regular)
|
||||
/* Permissions of newly-created regular files were set upon `open' in
|
||||
copy_reg. But don't return early if there were any special bits and
|
||||
we had to run chown, because the chown must have reset those bits. */
|
||||
if ((new_dst && copied_as_regular)
|
||||
&& !(ran_chown && (src_mode & ~S_IRWXUGO)))
|
||||
return delayed_fail;
|
||||
|
||||
if ((x->preserve_chmod_bits || new_dst)
|
||||
@@ -1036,6 +1203,17 @@ copy (const char *src_path, const char *dst_path,
|
||||
int move_mode = options->move_mode;
|
||||
|
||||
assert (valid_options (options));
|
||||
|
||||
/* Record the file names: they're used in case of error, when copying
|
||||
a directory into itself. I don't like to make these tools do *any*
|
||||
extra work in the common case when that work is solely to handle
|
||||
exceptional cases, but in this case, I don't see a way to derive the
|
||||
top level source and destination directory names where they're used.
|
||||
An alternative is to use COPY_INTO_SELF and print the diagnostic
|
||||
from every caller -- but I don't wan't to do that. */
|
||||
top_level_src_path = src_path;
|
||||
top_level_dst_path = dst_path;
|
||||
|
||||
return copy_internal (src_path, dst_path, nonexistent_dst, 0, NULL,
|
||||
options, move_mode, copy_into_self, rename_succeeded);
|
||||
}
|
||||
|
||||
36
src/copy.h
36
src/copy.h
@@ -46,14 +46,23 @@ struct cp_options
|
||||
/* If nonzero, dereference symbolic links (copy the files they point to). */
|
||||
enum Dereference_symlink dereference;
|
||||
|
||||
/* If nonzero, remove existing destination nondirectories. */
|
||||
int force;
|
||||
/* If nonzero, remove each existing destination nondirectory before
|
||||
trying to open it. */
|
||||
int unlink_dest_before_opening;
|
||||
|
||||
/* If nonzero, first try to open each existing destination nondirectory,
|
||||
then, if the open fails, unlink and try again.
|
||||
This option must be set for `cp -f', in case the destination file
|
||||
exists when the open is attempted. It is irrelevant to `mv' since
|
||||
any destination is sure to be removed before the open. */
|
||||
int unlink_dest_after_failed_open;
|
||||
|
||||
/* Setting this member is meaningful only if FORCE is also set.
|
||||
If nonzero, copy returns nonzero upon failed unlink.
|
||||
Otherwise, the failure still elicits a diagnostic, but it doesn't
|
||||
change copy's return value. This is nonzero for cp and mv, and zero
|
||||
for install. */
|
||||
/* FIXME: this is now unused. */
|
||||
int failed_unlink_is_fatal;
|
||||
|
||||
/* If nonzero, create hard links instead of copying files.
|
||||
@@ -121,6 +130,29 @@ struct cp_options
|
||||
int (*xstat) ();
|
||||
};
|
||||
|
||||
int stat ();
|
||||
int lstat ();
|
||||
|
||||
/* Arrange to make lstat calls go through the wrapper function
|
||||
on systems with an lstat function that does not dereference symlinks
|
||||
that are specified with a trailing slash. */
|
||||
# if ! LSTAT_FOLLOWS_SLASHED_SYMLINK
|
||||
int rpl_lstat PARAMS((const char *, struct stat *));
|
||||
# undef lstat
|
||||
# define lstat rpl_lstat
|
||||
# endif
|
||||
|
||||
int rename ();
|
||||
|
||||
/* Arrange to make rename calls go through the wrapper function
|
||||
on systems with a rename function that fails for a source path
|
||||
specified with a trailing slash. */
|
||||
# if RENAME_TRAILING_SLASH_BUG
|
||||
int rpl_rename PARAMS((const char *, const char *));
|
||||
# undef rename
|
||||
# define rename rpl_rename
|
||||
# endif
|
||||
|
||||
int
|
||||
copy PARAMS ((const char *src_path, const char *dst_path,
|
||||
int nonexistent_dst, const struct cp_options *options,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* cp-hash.c -- file copying (hash search routines)
|
||||
Copyright (C) 89, 90, 91, 1995-2000 Free Software Foundation.
|
||||
Copyright (C) 89, 90, 91, 1995-2001 Free Software Foundation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -33,7 +33,11 @@ struct entry
|
||||
{
|
||||
ino_t ino;
|
||||
dev_t dev;
|
||||
char *node; /* Path name, or &new_file for new inodes. */
|
||||
/* Destination path name (of non-directory or pre-existing directory)
|
||||
corresponding to the dev/ino of a copied file, or the destination path
|
||||
name corresponding to a dev/ino pair for a newly-created directory. */
|
||||
char *node;
|
||||
|
||||
struct entry *coll_link; /* 0 = entry not occupied. */
|
||||
};
|
||||
|
||||
@@ -46,8 +50,7 @@ struct htab
|
||||
struct entry *hash[1]; /* Vector of pointers in `entry_tab'. */
|
||||
};
|
||||
|
||||
struct htab *htab;
|
||||
char new_file;
|
||||
static struct htab *htab;
|
||||
|
||||
static char *cph_hash_insert PARAMS ((ino_t ino, dev_t dev, const char *node));
|
||||
|
||||
@@ -65,7 +68,7 @@ remember_created (const char *path)
|
||||
return 1;
|
||||
}
|
||||
|
||||
cph_hash_insert (sb.st_ino, sb.st_dev, &new_file);
|
||||
cph_hash_insert (sb.st_ino, sb.st_dev, path);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
69
src/cp.c
69
src/cp.c
@@ -1,5 +1,5 @@
|
||||
/* cp.c -- file copying (main routines)
|
||||
Copyright (C) 89, 90, 91, 1995-2000 Free Software Foundation.
|
||||
Copyright (C) 89, 90, 91, 1995-2001 Free Software Foundation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -73,21 +73,10 @@ enum
|
||||
TARGET_DIRECTORY_OPTION = CHAR_MAX + 1,
|
||||
SPARSE_OPTION,
|
||||
STRIP_TRAILING_SLASHES_OPTION,
|
||||
PARENTS_OPTION
|
||||
PARENTS_OPTION,
|
||||
UNLINK_DEST_BEFORE_OPENING
|
||||
};
|
||||
|
||||
int stat ();
|
||||
int lstat ();
|
||||
|
||||
/* Arrange to make lstat calls go through the wrapper function
|
||||
on systems with an lstat function that does not dereference symlinks
|
||||
that are specified with a trailing slash. */
|
||||
#if ! LSTAT_FOLLOWS_SLASHED_SYMLINK
|
||||
int rpl_lstat PARAMS((const char *, struct stat *));
|
||||
# undef lstat
|
||||
# define lstat rpl_lstat
|
||||
#endif
|
||||
|
||||
void strip_trailing_slashes ();
|
||||
|
||||
/* Initial number of entries in each hash table entry's table of inodes. */
|
||||
@@ -134,6 +123,7 @@ static struct option const long_opts[] =
|
||||
{"path", no_argument, NULL, PARENTS_OPTION}, /* Deprecated. */
|
||||
{"preserve", no_argument, NULL, 'p'},
|
||||
{"recursive", no_argument, NULL, 'R'},
|
||||
{"remove-destination", no_argument, NULL, UNLINK_DEST_BEFORE_OPENING},
|
||||
{"strip-trailing-slash", no_argument, NULL, STRIP_TRAILING_SLASHES_OPTION},
|
||||
{"suffix", required_argument, NULL, 'S'},
|
||||
{"symbolic-link", no_argument, NULL, 's'},
|
||||
@@ -166,13 +156,11 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
|
||||
-a, --archive same as -dpR\n\
|
||||
--backup[=CONTROL] make a backup of each existing destination file\n\
|
||||
-b like --backup but does not accept an argument\n\
|
||||
-d, --no-dereference preserve links\n\
|
||||
-f, --force remove existing destinations, never prompt\n\
|
||||
-d, --no-dereference never follow symbolic links\n\
|
||||
-f, --force if an existing destination file cannot be\n\
|
||||
opened, remove it and try again\n\
|
||||
-i, --interactive prompt before overwrite\n\
|
||||
-H follow symbolic links that are explicitly\n\
|
||||
specified in the command line, but do not\n\
|
||||
follow symlinks that are found via recursive\n\
|
||||
traversal\n\
|
||||
-H follow command-line symbolic links\n\
|
||||
-l, --link link files instead of copying\n\
|
||||
-L, --dereference always follow symbolic links\n\
|
||||
-p, --preserve preserve file attributes if possible\n\
|
||||
@@ -182,6 +170,10 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
|
||||
-r copy recursively, non-directories as files\n\
|
||||
WARNING: use -R instead when you might copy\n\
|
||||
special files like FIFOs or /dev/zero\n\
|
||||
--remove-destination remove each existing destination file before\n\
|
||||
attempting to open it (contrast with --force)\n\
|
||||
"));
|
||||
printf (_("\
|
||||
--sparse=WHEN control creation of sparse files\n\
|
||||
-R, --recursive copy directories recursively\n\
|
||||
--strip-trailing-slashes remove any trailing slashes from each SOURCE\n\
|
||||
@@ -340,6 +332,8 @@ re_protect (const char *const_dst_path, int src_offset,
|
||||
Return 0 if parent of CONST_DIRPATH exists as a directory with the proper
|
||||
permissions when done, otherwise 1. */
|
||||
|
||||
/* FIXME: find a way to synch this function with the one in lib/makepath.c. */
|
||||
|
||||
static int
|
||||
make_path_private (const char *const_dirpath, int src_offset, int mode,
|
||||
const char *verbose_fmt_string, struct dir_attr **attr_list,
|
||||
@@ -526,13 +520,26 @@ do_copy (int n_files, char **file, const char *target_directory,
|
||||
char *arg_in_concat = NULL;
|
||||
char *arg = file[i];
|
||||
|
||||
/* Trailing slashes are meaningful (i.e., maybe worth preserving)
|
||||
only in the source file names. */
|
||||
if (remove_trailing_slashes)
|
||||
strip_trailing_slashes (arg);
|
||||
|
||||
if (flag_path)
|
||||
{
|
||||
/* Append all of `arg' to `dest'. */
|
||||
dst_path = path_concat (dest, arg, &arg_in_concat);
|
||||
char *arg_no_trailing_slash;
|
||||
|
||||
/* Use `arg' without trailing slashes in constructing destination
|
||||
file names. Otherwise, we can end up trying to create a
|
||||
directory via `mkdir ("dst/foo/"...', which is not portable.
|
||||
It fails, due to the trailing slash, on at least
|
||||
NetBSD 1.[34] systems. */
|
||||
ASSIGN_STRDUPA (arg_no_trailing_slash, arg);
|
||||
strip_trailing_slashes (arg_no_trailing_slash);
|
||||
|
||||
/* Append all of `arg' (minus any trailing slash) to `dest'. */
|
||||
dst_path = path_concat (dest, arg_no_trailing_slash,
|
||||
&arg_in_concat);
|
||||
if (dst_path == NULL)
|
||||
xalloc_die ();
|
||||
|
||||
@@ -603,7 +610,7 @@ do_copy (int n_files, char **file, const char *target_directory,
|
||||
`cp --force --backup foo foo' to `cp --force foo fooSUFFIX'
|
||||
where SUFFIX is determined by any version control options used. */
|
||||
|
||||
if (x->force
|
||||
if (x->unlink_dest_after_failed_open
|
||||
&& x->backup_type != none
|
||||
&& STREQ (source, dest)
|
||||
&& !new_dst && S_ISREG (sb.st_mode))
|
||||
@@ -658,7 +665,8 @@ cp_option_init (struct cp_options *x)
|
||||
{
|
||||
x->copy_as_regular = 1;
|
||||
x->dereference = DEREF_UNDEFINED;
|
||||
x->force = 0;
|
||||
x->unlink_dest_before_opening = 0;
|
||||
x->unlink_dest_after_failed_open = 0;
|
||||
x->failed_unlink_is_fatal = 1;
|
||||
x->hard_link = 0;
|
||||
x->interactive = 0;
|
||||
@@ -752,7 +760,7 @@ main (int argc, char **argv)
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
x.force = 1;
|
||||
x.unlink_dest_after_failed_open = 1;
|
||||
break;
|
||||
|
||||
case 'H':
|
||||
@@ -795,6 +803,10 @@ main (int argc, char **argv)
|
||||
x.copy_as_regular = 0;
|
||||
break;
|
||||
|
||||
case UNLINK_DEST_BEFORE_OPENING:
|
||||
x.unlink_dest_before_opening = 1;
|
||||
break;
|
||||
|
||||
case STRIP_TRAILING_SLASHES_OPTION:
|
||||
remove_trailing_slashes = 1;
|
||||
break;
|
||||
@@ -848,7 +860,7 @@ main (int argc, char **argv)
|
||||
error (0, 0,
|
||||
_("\
|
||||
Warning: the meaning of `-P' will change in the future to conform to POSIX.\n\
|
||||
Use `--parents' for the old meaning, and `--no-dereference' for the new."));
|
||||
Use `--parents' for the old meaning, and `--no-dereference' for the new one."));
|
||||
}
|
||||
|
||||
if (backup_suffix_string)
|
||||
@@ -884,6 +896,11 @@ Use `--parents' for the old meaning, and `--no-dereference' for the new."));
|
||||
x.xstat = stat;
|
||||
}
|
||||
|
||||
/* If --force (-f) was specified and we're in link-creation mode,
|
||||
first remove any existing destination file. */
|
||||
if (x.unlink_dest_after_failed_open && (x.hard_link || x.symbolic_link))
|
||||
x.unlink_dest_before_opening = 1;
|
||||
|
||||
/* Allocate space for remembering copied and created files. */
|
||||
|
||||
hash_init (INITIAL_HASH_MODULE, INITIAL_ENTRY_TAB_SIZE);
|
||||
|
||||
41
src/cut.c
41
src/cut.c
@@ -20,42 +20,7 @@
|
||||
/* POSIX changes, bug fixes, long-named options, and cleanup
|
||||
by David MacKenzie <djm@gnu.ai.mit.edu>.
|
||||
|
||||
Rewrite cut_fields and cut_bytes -- Jim Meyering.
|
||||
|
||||
Options:
|
||||
--bytes=byte-list
|
||||
-b byte-list Print only the bytes in positions listed
|
||||
in BYTE-LIST.
|
||||
Tabs and backspaces are treated like any
|
||||
other character; they take up 1 byte.
|
||||
|
||||
--characters=character-list
|
||||
-c character-list Print only characters in positions listed
|
||||
in CHARACTER-LIST.
|
||||
The same as -b for now, but
|
||||
internationalization will change that.
|
||||
Tabs and backspaces are treated like any
|
||||
other character; they take up 1 character.
|
||||
|
||||
--fields=field-list
|
||||
-f field-list Print only the fields listed in FIELD-LIST.
|
||||
Fields are separated by a TAB by default.
|
||||
|
||||
--delimiter=delim
|
||||
-d delim For -f, fields are separated by the first
|
||||
character in DELIM instead of TAB.
|
||||
|
||||
-n Do not split multibyte chars (no-op for now).
|
||||
|
||||
--only-delimited
|
||||
-s For -f, do not print lines that do not contain
|
||||
the field separator character.
|
||||
|
||||
The BYTE-LIST, CHARACTER-LIST, and FIELD-LIST are one or more numbers
|
||||
or ranges separated by commas. The first byte, character, and field
|
||||
are numbered 1.
|
||||
|
||||
A FILE of `-' means standard input. */
|
||||
Rewrite cut_fields and cut_bytes -- Jim Meyering. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -209,7 +174,9 @@ Print selected parts of lines from each FILE to standard output.\n\
|
||||
-b, --bytes=LIST output only these bytes\n\
|
||||
-c, --characters=LIST output only these characters\n\
|
||||
-d, --delimiter=DELIM use DELIM instead of TAB for field delimiter\n\
|
||||
-f, --fields=LIST output only these fields\n\
|
||||
-f, --fields=LIST output only these fields; also print any line\n\
|
||||
that contains no delimiter character, unless\n\
|
||||
the -s option is specified\n\
|
||||
-n (ignored)\n\
|
||||
-s, --only-delimited do not print lines not containing delimiters\n\
|
||||
--output-delimiter=STRING use STRING as the output delimiter\n\
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user