mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
Compare commits
574 Commits
FILEUTILS-
...
FILEUTILS-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c726bc5709 | ||
|
|
585b65b676 | ||
|
|
b815641481 | ||
|
|
84d222f735 | ||
|
|
001e1b4302 | ||
|
|
dd2934197b | ||
|
|
ad174925d9 | ||
|
|
2aacc55e9b | ||
|
|
6f050de759 | ||
|
|
45d32cef80 | ||
|
|
3f51edcdec | ||
|
|
59c9c4036b | ||
|
|
ef2860263b | ||
|
|
d6b76c3f75 | ||
|
|
efa242bee1 | ||
|
|
8ea818e214 | ||
|
|
9bd57c9f22 | ||
|
|
0d457a6aee | ||
|
|
2722883a87 | ||
|
|
8105878c15 | ||
|
|
231c5aec0f | ||
|
|
e4e242e839 | ||
|
|
da8b83f81a | ||
|
|
df610e05ba | ||
|
|
9dab634c13 | ||
|
|
e5154f74b1 | ||
|
|
67786e0fb6 | ||
|
|
c84011e059 | ||
|
|
e36f49348b | ||
|
|
e786c1a0eb | ||
|
|
c057d35836 | ||
|
|
d9b628359a | ||
|
|
29b1eab1af | ||
|
|
9abd463ffb | ||
|
|
b54c86e8bc | ||
|
|
b885f7cbca | ||
|
|
7006d5fed6 | ||
|
|
976664803c | ||
|
|
3fdd4e6cd2 | ||
|
|
42755ceb62 | ||
|
|
8f03befb52 | ||
|
|
78af2f9732 | ||
|
|
88b4a9a940 | ||
|
|
045ebed00c | ||
|
|
24a7456cc0 | ||
|
|
b17e1af41c | ||
|
|
349b13e33a | ||
|
|
7b1d31a9b1 | ||
|
|
085866c1a3 | ||
|
|
4f75855c2e | ||
|
|
d649910685 | ||
|
|
e3e1698c6b | ||
|
|
b49e060cda | ||
|
|
e769659852 | ||
|
|
33d7cba8a7 | ||
|
|
65b2d6c97e | ||
|
|
2f3c1a3561 | ||
|
|
d8b68fc0c5 | ||
|
|
06ffb13ff0 | ||
|
|
3e62291a3c | ||
|
|
10972f68e8 | ||
|
|
15aac9a45d | ||
|
|
43fd950ef9 | ||
|
|
6c4002b2b5 | ||
|
|
816ee7dc0d | ||
|
|
916c762152 | ||
|
|
0d7fe8a4de | ||
|
|
841c6fbfe0 | ||
|
|
859bfc78b1 | ||
|
|
21ae3d911c | ||
|
|
4520ff31e2 | ||
|
|
92ce634177 | ||
|
|
6d89cf5f12 | ||
|
|
83a4462018 | ||
|
|
2b416bd83e | ||
|
|
96ab6a541a | ||
|
|
571a29d870 | ||
|
|
20f1f8b063 | ||
|
|
4e1e8c600d | ||
|
|
d816bb4f14 | ||
|
|
ce60ef7400 | ||
|
|
6e98d78fd4 | ||
|
|
2c5862c808 | ||
|
|
268db2760a | ||
|
|
0062e8f915 | ||
|
|
057743741f | ||
|
|
3f2774c8b4 | ||
|
|
3e0c559579 | ||
|
|
e7d6615b76 | ||
|
|
91df5bbc48 | ||
|
|
4cc5661b42 | ||
|
|
19a98e3edc | ||
|
|
50e17793c8 | ||
|
|
8a0a50e6b0 | ||
|
|
a42054dd57 | ||
|
|
24da56f990 | ||
|
|
d8e6937773 | ||
|
|
e1b2b2337d | ||
|
|
60c77b6c28 | ||
|
|
c7b3d3e91b | ||
|
|
60c1207b74 | ||
|
|
d344aaa129 | ||
|
|
83c2cfa04d | ||
|
|
53c7a54a58 | ||
|
|
e81bcd87cb | ||
|
|
10d98345b4 | ||
|
|
e17b601d5e | ||
|
|
f5d8ee465e | ||
|
|
51c06c49cf | ||
|
|
bbf4d37373 | ||
|
|
9bb85624cf | ||
|
|
9b5402ec48 | ||
|
|
77728e4f4b | ||
|
|
9db889c372 | ||
|
|
caace05438 | ||
|
|
cd7f8d6e9b | ||
|
|
bf598c02ba | ||
|
|
3954a4f441 | ||
|
|
506343b223 | ||
|
|
2f8dc98340 | ||
|
|
d015aad1f2 | ||
|
|
a99c3df843 | ||
|
|
e78bc7655d | ||
|
|
a519a07f25 | ||
|
|
02efcd60ed | ||
|
|
39e2377300 | ||
|
|
cda5bf9db9 | ||
|
|
27c8d53a3a | ||
|
|
3e7e7d0792 | ||
|
|
a5b0ca6f24 | ||
|
|
1f62fd20a3 | ||
|
|
254fc64f64 | ||
|
|
9dc7d5d2ae | ||
|
|
45af919ce6 | ||
|
|
89c9e683a3 | ||
|
|
d20d0fc27d | ||
|
|
5b7e895b65 | ||
|
|
2e97d27586 | ||
|
|
a155c3d684 | ||
|
|
3489f267a4 | ||
|
|
3fc7024e49 | ||
|
|
30b522371a | ||
|
|
88013e3cb4 | ||
|
|
7c8a2cdacf | ||
|
|
876f399d50 | ||
|
|
05ffec210e | ||
|
|
163f7f9c20 | ||
|
|
8fbf79b4e0 | ||
|
|
08b5c3046c | ||
|
|
551b879bf1 | ||
|
|
bd1eee0315 | ||
|
|
72f7eb4e63 | ||
|
|
fef313b2b0 | ||
|
|
464e2ce05d | ||
|
|
a48999494d | ||
|
|
d5d061ee9b | ||
|
|
b44e91e99d | ||
|
|
ce3668f3c1 | ||
|
|
44fa09dc5e | ||
|
|
808b938840 | ||
|
|
83d4d74a88 | ||
|
|
0d38a270a4 | ||
|
|
3f017c26ca | ||
|
|
4c946943ea | ||
|
|
7dd872d963 | ||
|
|
b7d50ca523 | ||
|
|
fe18d63a65 | ||
|
|
6668e39160 | ||
|
|
d738449858 | ||
|
|
7254d243f2 | ||
|
|
91da5cedc7 | ||
|
|
1187f5eb7f | ||
|
|
5bcc1fd7fd | ||
|
|
e4c9ae3c6b | ||
|
|
d1121fa4c0 | ||
|
|
713c315978 | ||
|
|
8cc46c2a18 | ||
|
|
518f85fc40 | ||
|
|
48990a9078 | ||
|
|
69a3ee0b49 | ||
|
|
8ed3137f52 | ||
|
|
d4257e63c7 | ||
|
|
7154d646cb | ||
|
|
b388203a65 | ||
|
|
66c7b3c41d | ||
|
|
ac7b3c4fa9 | ||
|
|
b402870080 | ||
|
|
1cbe202b0a | ||
|
|
d618576e0e | ||
|
|
51fe35760e | ||
|
|
8bbe8ab5d4 | ||
|
|
ba51843a2c | ||
|
|
397d9be228 | ||
|
|
dddfcab3b3 | ||
|
|
00ea94587f | ||
|
|
49875c1593 | ||
|
|
7b9c4d3d03 | ||
|
|
3783d6be57 | ||
|
|
632ebfa209 | ||
|
|
29cc8bf4f3 | ||
|
|
50892edd61 | ||
|
|
72193ba149 | ||
|
|
854b5197ad | ||
|
|
d90641d9d8 | ||
|
|
300be5a250 | ||
|
|
3911fadcf9 | ||
|
|
382ca69cec | ||
|
|
9fc10dc6c3 | ||
|
|
f0a8ebf596 | ||
|
|
53c085b7e5 | ||
|
|
faa759b349 | ||
|
|
398e92a2ec | ||
|
|
3483943ebc | ||
|
|
108b074aea | ||
|
|
19fcb4356c | ||
|
|
c4b7f217a5 | ||
|
|
cb04f85936 | ||
|
|
902bbe7707 | ||
|
|
c9a9ec9b53 | ||
|
|
840a08ccde | ||
|
|
5fbcd963df | ||
|
|
953c42bd52 | ||
|
|
765122f558 | ||
|
|
e46a424ce9 | ||
|
|
095c92bc46 | ||
|
|
7957dcc00a | ||
|
|
108f8f2d04 | ||
|
|
39463d50ed | ||
|
|
4a46351e06 | ||
|
|
8aca15bac0 | ||
|
|
1ddffff8c0 | ||
|
|
e7683a577a | ||
|
|
3063e56f2e | ||
|
|
eb3a4daa24 | ||
|
|
b6844f1931 | ||
|
|
a636450727 | ||
|
|
6456a7d8ac | ||
|
|
a57d5061ff | ||
|
|
45e8e5c550 | ||
|
|
69412999dc | ||
|
|
85b39cb589 | ||
|
|
9f358e6830 | ||
|
|
defb2bdef8 | ||
|
|
6e577f0b56 | ||
|
|
c157e5fbef | ||
|
|
ca6cf35a5e | ||
|
|
ede420f14a | ||
|
|
52a2ff839c | ||
|
|
821a0823b1 | ||
|
|
e52d8736b1 | ||
|
|
5c0ee776d4 | ||
|
|
465ebf7c37 | ||
|
|
18ad404d02 | ||
|
|
28cb02fc78 | ||
|
|
cbf0181378 | ||
|
|
bca2db9877 | ||
|
|
aa71be25c0 | ||
|
|
cd053a291e | ||
|
|
fa4148be50 | ||
|
|
5695f8ea2d | ||
|
|
18d159d47e | ||
|
|
0bb2acd9da | ||
|
|
7a8b4afa3e | ||
|
|
3a0352ad9a | ||
|
|
55569d4f9f | ||
|
|
eeef5c523d | ||
|
|
e8ab1c28f8 | ||
|
|
df4ba7d9ca | ||
|
|
e832812173 | ||
|
|
ac648dbc8a | ||
|
|
c75ccba2d3 | ||
|
|
a33adfebb2 | ||
|
|
b50b941826 | ||
|
|
6ec5bace8a | ||
|
|
b48e78e3b7 | ||
|
|
33179975d7 | ||
|
|
d4a8891aef | ||
|
|
fcbfefa513 | ||
|
|
fcf6405f2d | ||
|
|
0ecb6ace02 | ||
|
|
6d42c7e9d7 | ||
|
|
6684ffa826 | ||
|
|
bfbc3ce20c | ||
|
|
0f5f23cb9e | ||
|
|
93494dde07 | ||
|
|
be3b9520ad | ||
|
|
c2c6f081c5 | ||
|
|
36b10d9f21 | ||
|
|
72c0980585 | ||
|
|
58647fd63d | ||
|
|
6eb5e899e1 | ||
|
|
a01c762a81 | ||
|
|
c29025e6ed | ||
|
|
b3582e7533 | ||
|
|
12f49aa1ae | ||
|
|
f31f7e1c75 | ||
|
|
d34d42ca05 | ||
|
|
6974d67aa2 | ||
|
|
85d9447441 | ||
|
|
45c381f4ba | ||
|
|
184c0062a4 | ||
|
|
7024c7d55c | ||
|
|
d84a21ea2d | ||
|
|
2f6fa9d160 | ||
|
|
4ac374c8e5 | ||
|
|
17070ae7bf | ||
|
|
a1cc8f5961 | ||
|
|
27caa20d7b | ||
|
|
757555a4dc | ||
|
|
ada5e63612 | ||
|
|
a8d20df6b2 | ||
|
|
4a28ea9bd6 | ||
|
|
e4a1ead494 | ||
|
|
ad1a2f76ce | ||
|
|
a7a6111f81 | ||
|
|
7c579a0231 | ||
|
|
6630a24b7a | ||
|
|
6429ffabbb | ||
|
|
e558629ce1 | ||
|
|
fefa8511b8 | ||
|
|
347db9ce77 | ||
|
|
92da57a7be | ||
|
|
4078ae8de8 | ||
|
|
3086193091 | ||
|
|
823425b310 | ||
|
|
e03fc9bc82 | ||
|
|
64379c5cd8 | ||
|
|
d4825df6cf | ||
|
|
cb3b5ed486 | ||
|
|
7ee8ed7e37 | ||
|
|
a991132f3e | ||
|
|
7f0867df00 | ||
|
|
6354d07ea0 | ||
|
|
3216105fbb | ||
|
|
8d5c4784b8 | ||
|
|
ec47f73107 | ||
|
|
94cd0c09f6 | ||
|
|
db3440d444 | ||
|
|
e8bec0725e | ||
|
|
8598c54bb1 | ||
|
|
e457645eac | ||
|
|
a14303dbc9 | ||
|
|
84ad5c47c8 | ||
|
|
998b3a148c | ||
|
|
71ee764f1e | ||
|
|
07a6f7a9e2 | ||
|
|
0f5ca22215 | ||
|
|
fc50286759 | ||
|
|
0a1fd1d2ad | ||
|
|
7a04e95c62 | ||
|
|
938e7fe7ef | ||
|
|
d8ab75cedc | ||
|
|
650b182278 | ||
|
|
f31f7889fb | ||
|
|
b1f2e5a7fd | ||
|
|
34141257cf | ||
|
|
c96ef37ba9 | ||
|
|
ccc65c4a81 | ||
|
|
be5250f0ec | ||
|
|
d1c1677873 | ||
|
|
6eae430477 | ||
|
|
82d361dc53 | ||
|
|
6e05a13259 | ||
|
|
a1413ad1cd | ||
|
|
c9dd33ec3f | ||
|
|
b9a394eec5 | ||
|
|
f315b52ca9 | ||
|
|
26c02dd946 | ||
|
|
a03a97d7d8 | ||
|
|
ead1152ef8 | ||
|
|
2326be84d5 | ||
|
|
7980fa3b78 | ||
|
|
70a8ff09ed | ||
|
|
38a63c863e | ||
|
|
a4fb33a110 | ||
|
|
bd9a38183c | ||
|
|
45d85e3ba2 | ||
|
|
afa328c54e | ||
|
|
c66e967d70 | ||
|
|
ccaf565665 | ||
|
|
b1a82ad6f2 | ||
|
|
c9a2ec01e5 | ||
|
|
f7acc2f589 | ||
|
|
5bf77e1015 | ||
|
|
3aa15eac61 | ||
|
|
5799c6474d | ||
|
|
f8998dae41 | ||
|
|
a7ba2688ca | ||
|
|
6810b30f39 | ||
|
|
f8d66bde6a | ||
|
|
4675b67c10 | ||
|
|
ae3c7c2fb1 | ||
|
|
a3ff199f12 | ||
|
|
61ef81a837 | ||
|
|
dcb8db3c82 | ||
|
|
92b49f0da1 | ||
|
|
f322649c58 | ||
|
|
f49fee3e5f | ||
|
|
6dbc8ff80b | ||
|
|
65978b6328 | ||
|
|
5f8949c46c | ||
|
|
b302e2becc | ||
|
|
5921d6bc50 | ||
|
|
ec76108bb7 | ||
|
|
519365bb08 | ||
|
|
c1fc9dbe64 | ||
|
|
06b4686f8a | ||
|
|
5a244d2598 | ||
|
|
497a1e0c04 | ||
|
|
32ee7fb170 | ||
|
|
db7449461c | ||
|
|
9ed89c9d9c | ||
|
|
6110857115 | ||
|
|
36afcc383a | ||
|
|
9e7ca26738 | ||
|
|
de38f9c61f | ||
|
|
aa14b2d994 | ||
|
|
a6a3dee962 | ||
|
|
0324f8d422 | ||
|
|
5a9c4223f6 | ||
|
|
eeeb6c7b23 | ||
|
|
206e3f08de | ||
|
|
61a80b3a12 | ||
|
|
4da3feb0e9 | ||
|
|
a3d39ceb13 | ||
|
|
b252cc8d6d | ||
|
|
afac7f3a78 | ||
|
|
fae6846955 | ||
|
|
f79e8bdcaf | ||
|
|
ebfdc834f2 | ||
|
|
6e5ac55673 | ||
|
|
43d2406f55 | ||
|
|
29772527c8 | ||
|
|
4e72061130 | ||
|
|
470cfd9491 | ||
|
|
ff9a9a2bdf | ||
|
|
a3db75c4b3 | ||
|
|
46fb234f5f | ||
|
|
1e985af9d7 | ||
|
|
8ef38f80ec | ||
|
|
047f0c2125 | ||
|
|
a10c7fcd7c | ||
|
|
54a0879129 | ||
|
|
494d8173bd | ||
|
|
e8b739e317 | ||
|
|
ef4765e11b | ||
|
|
ca9451a39d | ||
|
|
1349c30df2 | ||
|
|
8659ec88d4 | ||
|
|
e27d21668c | ||
|
|
902598d05d | ||
|
|
fc026cd548 | ||
|
|
7d4a70eaff | ||
|
|
186958482f | ||
|
|
da80ee04d2 | ||
|
|
dd3a865a8e | ||
|
|
aaf66a2413 | ||
|
|
0eba2a8dd7 | ||
|
|
7c04ce1f09 | ||
|
|
7b4833b03c | ||
|
|
3a62f8785f | ||
|
|
85923cb2bc | ||
|
|
bc05ba3d5a | ||
|
|
ea2969da49 | ||
|
|
0966b97bd1 | ||
|
|
8c3fb79a89 | ||
|
|
fc68d2786b | ||
|
|
0d26afa6e0 | ||
|
|
bb964b3eec | ||
|
|
638776e577 | ||
|
|
0881032a16 | ||
|
|
c58c644f8f | ||
|
|
6e602a0232 | ||
|
|
097d40b3d3 | ||
|
|
57258b3446 | ||
|
|
39508b8db3 | ||
|
|
cd4c2d0fdc | ||
|
|
8a0550a816 | ||
|
|
663d8b143c | ||
|
|
2a1a1843b7 | ||
|
|
9c70563ee7 | ||
|
|
37ce5a5497 | ||
|
|
37a3052a36 | ||
|
|
2a4842f7f3 | ||
|
|
d82fadf365 | ||
|
|
ef63ce007d | ||
|
|
6a8e657775 | ||
|
|
309819620b | ||
|
|
f7bb262cc8 | ||
|
|
d5494d57f5 | ||
|
|
14a2593daf | ||
|
|
9cdd2e05e6 | ||
|
|
6cce6a1b7f | ||
|
|
d9f0ca41bd | ||
|
|
df7cef21c7 | ||
|
|
9f2d1beded | ||
|
|
ff59218d54 | ||
|
|
1a18272561 | ||
|
|
2bdf8621d6 | ||
|
|
758ab7a013 | ||
|
|
734d1cccc3 | ||
|
|
13de1036ac | ||
|
|
2167febcb1 | ||
|
|
2c11b736aa | ||
|
|
a52e0efbe2 | ||
|
|
4935348b67 | ||
|
|
e6a0306b1b | ||
|
|
2bec121abb | ||
|
|
412043f1d8 | ||
|
|
4ffa362cc4 | ||
|
|
35592ba64c | ||
|
|
c1618a8c4c | ||
|
|
96be8bca99 | ||
|
|
b8a16a3f2a | ||
|
|
f1217e4976 | ||
|
|
62279c6e2d | ||
|
|
71545a6276 | ||
|
|
53cfcbd19c | ||
|
|
5618133eed | ||
|
|
ade1f58e11 | ||
|
|
74cf3e8bab | ||
|
|
ca50e875af | ||
|
|
a75ea1014e | ||
|
|
98af2e9636 | ||
|
|
68e5877403 | ||
|
|
2b906615c2 | ||
|
|
443f852f61 | ||
|
|
d1f4e617b5 | ||
|
|
1aa070dd2e | ||
|
|
007e81132a | ||
|
|
6bcfff640e | ||
|
|
aa2880362c | ||
|
|
88bd90109b | ||
|
|
dba300a0d0 | ||
|
|
b9ed71e46e | ||
|
|
7bba3e945f | ||
|
|
1bdfcabd2c | ||
|
|
c88a4c91da | ||
|
|
136f2fd28c | ||
|
|
82739833a1 | ||
|
|
1c5c2597b5 | ||
|
|
eacbf12ea4 | ||
|
|
0ccdf3419d | ||
|
|
cec85a4b3a | ||
|
|
a077a7833c | ||
|
|
a3094b0529 | ||
|
|
d73dd15544 | ||
|
|
27c1ad9576 | ||
|
|
2eefbf7647 | ||
|
|
79d39ab7bf | ||
|
|
12782f54b0 | ||
|
|
fff6de7b04 | ||
|
|
cc76db2016 | ||
|
|
77c94909cf | ||
|
|
3b8d19272d | ||
|
|
6099914170 | ||
|
|
09d96ac539 | ||
|
|
3edbca0e04 | ||
|
|
c062a35803 | ||
|
|
3da029a5d9 | ||
|
|
de1dabf7d7 | ||
|
|
03283b5000 | ||
|
|
9f5dc7e7d0 | ||
|
|
ab9cd27938 | ||
|
|
c767a49741 | ||
|
|
0fdd1b9130 | ||
|
|
f19ca6fe29 | ||
|
|
6cc3cf776c | ||
|
|
e162abfc5b | ||
|
|
866773c72a | ||
|
|
06bab849fc | ||
|
|
ed0becde29 | ||
|
|
8d64a37a77 | ||
|
|
0520188821 |
166
ABOUT-NLS
166
ABOUT-NLS
@@ -1,16 +1,16 @@
|
||||
Notes on the GNU Translation Project
|
||||
************************************
|
||||
Notes on the Free Translation Project
|
||||
*************************************
|
||||
|
||||
GNU is going international! The GNU Translation Project is a way to
|
||||
get maintainers, translators, and users all together, so that GNU will
|
||||
gradually become able to speak many languages. A few packages already
|
||||
provide translations for their messages.
|
||||
Free software is going international! The Free Translation Project
|
||||
is a way to get maintainers of free software, translators, and users all
|
||||
together, so that will gradually become able to speak many languages.
|
||||
A few packages already provide translations for their messages.
|
||||
|
||||
If you found this `ABOUT-NLS' file inside a GNU distribution, you
|
||||
may assume that the distributed package does use GNU `gettext'
|
||||
internally, itself available at your nearest GNU archive site. But you
|
||||
do *not* need to install GNU `gettext' prior to configuring, installing
|
||||
or using this package with messages translated.
|
||||
If you found this `ABOUT-NLS' file inside a distribution, you may
|
||||
assume that the distributed package does use GNU `gettext' internally,
|
||||
itself available at your nearest GNU archive site. But you do *not*
|
||||
need to install GNU `gettext' prior to configuring, installing or using
|
||||
this package with messages translated.
|
||||
|
||||
Installers will find here some useful hints. These notes also
|
||||
explain how users should proceed for getting the programs to use the
|
||||
@@ -31,19 +31,23 @@ should configure it using
|
||||
./configure --with-included-gettext
|
||||
|
||||
to force usage of internationalizing routines provided within this
|
||||
package, despite the existence of internationalizing capabilities in
|
||||
the operating system where this package is being installed. So far, no
|
||||
prior implementation provides as many useful features (such as locale
|
||||
alias or message inheritance). It is also not possible to offer this
|
||||
additional functionality on top of a `catgets' implementation. Future
|
||||
versions of GNU `gettext' will very likely convey even more
|
||||
functionality. So it might be a good idea to change to GNU `gettext'
|
||||
as soon as possible.
|
||||
package, despite the existence of internationalizing capabilities in the
|
||||
operating system where this package is being installed. So far, only
|
||||
the `gettext' implementation in the GNU C library version 2 provides as
|
||||
many features (such as locale alias or message inheritance) as the
|
||||
implementation here. It is also not possible to offer this additional
|
||||
functionality on top of a `catgets' implementation. Future versions of
|
||||
GNU `gettext' will very likely convey even more functionality. So it
|
||||
might be a good idea to change to GNU `gettext' as soon as possible.
|
||||
|
||||
So you need not provide this option if you are using GNU libc 2 or
|
||||
you have installed a recent copy of the GNU gettext package with the
|
||||
included `libintl'.
|
||||
|
||||
INSTALL Matters
|
||||
===============
|
||||
|
||||
Some GNU packages are "localizable" when properly installed; the
|
||||
Some packages are "localizable" when properly installed; the
|
||||
programs they contain can be made to speak your own native language.
|
||||
Most such packages use GNU `gettext'. Other packages have their own
|
||||
ways to internationalization, predating GNU `gettext'.
|
||||
@@ -113,37 +117,35 @@ shell prompt, merely execute `setenv LANG de' (in `csh'),
|
||||
can be done from your `.login' or `.profile' file, once and for all.
|
||||
|
||||
An operating system might already offer message localization for
|
||||
many of its programs, while other programs (whether GNU or not) have
|
||||
been installed locally with the full capabilities of GNU `gettext'.
|
||||
Just using `gettext' extended syntax for `LANG' would break proper
|
||||
localization of already available operating system programs. In this
|
||||
case, users should set both `LANGUAGE' and `LANG' variables in their
|
||||
environment, as programs using GNU `gettext' give preference to
|
||||
`LANGUAGE'. For example, some Swedish users would rather read
|
||||
translations in German than English for when Swedish is not available.
|
||||
This is easily accomplished by setting `LANGUAGE' to `sv:de' while
|
||||
leaving `LANG' to `sv'.
|
||||
many of its programs, while other programs have been installed locally
|
||||
with the full capabilities of GNU `gettext'. Just using `gettext'
|
||||
extended syntax for `LANG' would break proper localization of already
|
||||
available operating system programs. In this case, users should set
|
||||
both `LANGUAGE' and `LANG' variables in their environment, as programs
|
||||
using GNU `gettext' give preference to `LANGUAGE'. For example, some
|
||||
Swedish users would rather read translations in German than English for
|
||||
when Swedish is not available. This is easily accomplished by setting
|
||||
`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'.
|
||||
|
||||
Translating Teams
|
||||
=================
|
||||
|
||||
For the GNU Translation Project to be a success, we need interested
|
||||
For the Free Translation Project to be a success, we need interested
|
||||
people who like their own language and write it well, and who are also
|
||||
able to synergize with other translators speaking the same language.
|
||||
Each translation team has its own mailing list, courtesy of Linux
|
||||
International. You may reach your translation team at the address
|
||||
`LL@li.org', replacing LL by the two-letter ISO 639 code for your
|
||||
language. Language codes are *not* the same as the country codes given
|
||||
in ISO 3166. The following translation teams exist, as of February
|
||||
in ISO 3166. The following translation teams exist, as of December
|
||||
1997:
|
||||
|
||||
Arabic `ar', Chinese `zh', Czech `cs', Danish `da', Dutch `nl',
|
||||
English `en', Esperanto `eo', Finnish `fi', French `fr', German
|
||||
`de', Greek `el', Hebrew `he', Hungarian `hu', Irish `ga', Italian
|
||||
`it', Indonesian `id', Japanese `ja', Korean `ko', Latin `la',
|
||||
Norwegian `no', Persian `fa', Polish `pl', Portuguese `pt',
|
||||
Russian `ru', Slovenian `sl', Spanish `es', Swedish `sv', Telugu
|
||||
`te', Turkish `tr' and Ukrainian `uk'.
|
||||
Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
|
||||
Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
|
||||
`hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja',
|
||||
Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish
|
||||
`pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es',
|
||||
Swedish `sv', and Turkish `tr'.
|
||||
|
||||
For example, you may reach the Chinese translation team by writing to
|
||||
`zh@li.org'.
|
||||
@@ -160,55 +162,53 @@ message to `sv-request@li.org', having this message body:
|
||||
*actively* in translations, or at solving translational difficulties,
|
||||
rather than merely lurking around. If your team does not exist yet and
|
||||
you want to start one, or if you are unsure about what to do or how to
|
||||
get started, please write to `gnu-translation@gnu.ai.mit.edu' to reach
|
||||
the GNU coordinator for all translator teams.
|
||||
get started, please write to `translation@iro.umontreal.ca' to reach the
|
||||
coordinator for all translator teams.
|
||||
|
||||
The English team is special. It works at improving and uniformizing
|
||||
the terminology used in GNU. Proven linguistic skill are praised more
|
||||
than programming skill, here. For the time being, please avoid
|
||||
subscribing to the English team unless explicitly invited to do so.
|
||||
the terminology in use. Proven linguistic skill are praised more than
|
||||
programming skill, here.
|
||||
|
||||
Available Packages
|
||||
==================
|
||||
|
||||
Languages are not equally supported in all GNU packages. The
|
||||
following matrix shows the current state of GNU internationalization,
|
||||
as of February 1997. The matrix shows, in regard of each package, for
|
||||
which languages PO files have been submitted to translation
|
||||
coordination.
|
||||
Languages are not equally supported in all packages. The following
|
||||
matrix shows the current state of internationalization, as of December
|
||||
1997. The matrix shows, in regard of each package, for which languages
|
||||
PO files have been submitted to translation coordination.
|
||||
|
||||
Ready PO files cs de en es fi fr ja ko nl no pl pt sl sv
|
||||
.-------------------------------------------.
|
||||
bash | [] [] [] | 3
|
||||
bison | [] [] [] | 3
|
||||
clisp | [] [] [] | 3
|
||||
cpio | [] [] [] [] [] | 5
|
||||
diffutils | [] [] [] [] | 4
|
||||
enscript | [] [] [] [] [] | 5
|
||||
fileutils | [] [] [] [] [] [] [] [] | 8
|
||||
findutils | [] [] [] [] [] [] [] | 7
|
||||
flex | [] [] [] | 3
|
||||
gcal | [] [] [] | 3
|
||||
gettext | [] [] [] [] [] [] [] [] [] [] | 11
|
||||
grep | [] [] [] [] [] [] [] [] | 8
|
||||
hello | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
id-utils | [] [] | 2
|
||||
indent | [] [] | 2
|
||||
libc | [] [] [] [] [] [] [] | 7
|
||||
m4 | [] [] [] [] [] | 5
|
||||
make | [] [] [] [] [] [] | 6
|
||||
music | [] | 1
|
||||
ptx | [] [] [] [] [] [] [] [] | 8
|
||||
recode | [] [] [] [] [] [] [] [] | 8
|
||||
sh-utils | [] [] [] [] [] | 5
|
||||
sharutils | [] [] [] [] [] | 5
|
||||
tar | [] [] [] [] [] [] [] [] [] | 9
|
||||
texinfo | | 0
|
||||
textutils | [] [] [] [] [] [] | 6
|
||||
wdiff | [] [] [] [] [] [] [] [] | 8
|
||||
`-------------------------------------------'
|
||||
14 languages cs de en es fi fr ja ko nl no pl pt sl sv
|
||||
27 packages 1 22 1 14 1 25 1 10 20 7 14 7 7 15 145
|
||||
Ready PO files cs da de en es fi fr it ja ko nl no pl pt ru sl sv
|
||||
.----------------------------------------------------.
|
||||
bash | [] [] [] | 3
|
||||
bison | [] [] [] | 3
|
||||
clisp | [] [] [] [] | 4
|
||||
cpio | [] [] [] [] [] [] | 6
|
||||
diffutils | [] [] [] [] [] | 5
|
||||
enscript | [] [] [] [] [] [] | 6
|
||||
fileutils | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
findutils | [] [] [] [] [] [] [] [] [] | 9
|
||||
flex | [] [] [] [] | 4
|
||||
gcal | [] [] [] [] [] | 5
|
||||
gettext | [] [] [] [] [] [] [] [] [] [] [] | 12
|
||||
grep | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
hello | [] [] [] [] [] [] [] [] [] [] [] | 11
|
||||
id-utils | [] [] [] | 3
|
||||
indent | [] [] [] [] [] | 5
|
||||
libc | [] [] [] [] [] [] [] | 7
|
||||
m4 | [] [] [] [] [] [] | 6
|
||||
make | [] [] [] [] [] [] | 6
|
||||
music | [] [] | 2
|
||||
ptx | [] [] [] [] [] [] [] [] | 8
|
||||
recode | [] [] [] [] [] [] [] [] [] | 9
|
||||
sh-utils | [] [] [] [] [] [] [] [] | 8
|
||||
sharutils | [] [] [] [] [] [] | 6
|
||||
tar | [] [] [] [] [] [] [] [] [] [] [] | 11
|
||||
texinfo | [] [] [] | 3
|
||||
textutils | [] [] [] [] [] [] [] [] [] | 9
|
||||
wdiff | [] [] [] [] [] [] [] [] | 8
|
||||
`----------------------------------------------------'
|
||||
17 languages cs da de en es fi fr it ja ko nl no pl pt ru sl sv
|
||||
27 packages 6 4 25 1 18 1 26 2 1 12 20 9 19 7 4 7 17 179
|
||||
|
||||
Some counters in the preceding matrix are higher than the number of
|
||||
visible blocks let us expect. This is because a few extra PO files are
|
||||
@@ -219,8 +219,8 @@ dialects.
|
||||
which it applies should also have been internationalized and
|
||||
distributed as such by its maintainer. There might be an observable
|
||||
lag between the mere existence a PO file and its wide availability in a
|
||||
GNU distribution.
|
||||
distribution.
|
||||
|
||||
If February 1997 seems to be old, you may fetch a more recent copy
|
||||
If December 1997 seems to be old, you may fetch a more recent copy
|
||||
of this `ABOUT-NLS' file on most GNU archive sites.
|
||||
|
||||
|
||||
23
GNUmakefile
Normal file
23
GNUmakefile
Normal file
@@ -0,0 +1,23 @@
|
||||
# Having a separate GNUmakefile lets me `include' the dynamically
|
||||
# generated rules created via Makefile.maint as well as Makefile.maint itself.
|
||||
# This makefile is used only if you run GNU Make.
|
||||
# It is necessary if you want to build targets usually of interest
|
||||
# only to the maintainer.
|
||||
|
||||
have-Makefile := $(shell test -f Makefile && echo yes)
|
||||
|
||||
# If the user runs GNU make but has not yet run ./configure,
|
||||
# give them a diagnostic.
|
||||
ifeq ($(have-Makefile),yes)
|
||||
|
||||
include Makefile
|
||||
include $(srcdir)/Makefile.maint
|
||||
|
||||
else
|
||||
|
||||
all:
|
||||
@echo There seems to be no Makefile in this directory.
|
||||
@echo "You must run ./configure before running \`make'."
|
||||
@exit 1
|
||||
|
||||
endif
|
||||
44
Makefile.maint
Normal file
44
Makefile.maint
Normal file
@@ -0,0 +1,44 @@
|
||||
# -*-Makefile-*-
|
||||
# This Makefile fragment is shared between fileutils, sh-utils, textutils.
|
||||
|
||||
maintainer-check:
|
||||
if head ChangeLog| grep 'Version $(VERSION)' > /dev/null; then \
|
||||
:; \
|
||||
else \
|
||||
echo "$(VERSION) not in ChangeLog; not tagging" 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
$(MAKE) distcheck
|
||||
$(MAKE) my-distcheck
|
||||
|
||||
# Tag before making distribution. Also, don't make a distribution if
|
||||
# checks fail. Also, make sure the NEWS file is up-to-date.
|
||||
cvs-dist: maintainer-check
|
||||
pkg=`echo "$(PACKAGE)" | tr a-z A-Z`; \
|
||||
ver=`echo "$(VERSION)" | sed 's/\./_/g'`; \
|
||||
tag="$$pkg-$$ver"; \
|
||||
echo tag=$$tag; \
|
||||
if cvs -n log -h README| grep -e $$tag > /dev/null; then \
|
||||
echo "VERSION not new; not tagging" 1>&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
cvs update po; \
|
||||
cvs tag -c $$tag
|
||||
$(MAKE) dist
|
||||
|
||||
t=./=test
|
||||
my-distcheck: dist
|
||||
-rm -rf $(t)
|
||||
mkdir $(t)
|
||||
GZIP=$(GZIP) $(TAR) -C $(t) -zxf $(distdir).tar.gz
|
||||
cd $(t)/$(distdir) \
|
||||
&& ./configure --disable-nls \
|
||||
&& $(MAKE) \
|
||||
&& $(MAKE) dvi \
|
||||
&& $(MAKE) check \
|
||||
&& $(MAKE) distclean
|
||||
cd $(t) && $(TAR) --diff -z -f ../$(distdir).tar.gz
|
||||
-rm -rf $(t)
|
||||
@echo "========================"; \
|
||||
echo "$(distdir).tar.gz is ready for distribution"; \
|
||||
echo "========================"
|
||||
8
THANKS
8
THANKS
@@ -6,9 +6,13 @@ Andreas Schwab: schwab@issan.informatik.uni-dortmund.de
|
||||
Arne Henrik Juul: arnej@imf.unit.no
|
||||
Bauke Jan Douma: bjdouma@xs4all.nl
|
||||
Bengt Martensson: bengt@mathematik.uni-Bremen.de
|
||||
Bjorn Helgaas: helgaas@rsn.hp.com
|
||||
Charles Karney: karney@pppl.gov
|
||||
Dirk Lattermann: dlatt@t-online.de
|
||||
Eirik Fuller: eirik@netcom.com
|
||||
Eli Zaretskii: eliz@is.elta.co.il
|
||||
Emile LeBlanc: leblanc@math.toronto.edu
|
||||
François Pinard: pinard@iro.umontreal.ca
|
||||
Galen Hazelwood: galenh@micron.net
|
||||
Greg McGary: gkm@eng.ascend.com
|
||||
Hugh Daniel: hugh@xanadu.com
|
||||
@@ -17,6 +21,8 @@ James Antill: jmanti%essex.ac.uk@seralph21.essex.ac.uk
|
||||
Jesse Thilo: jgt2@eecs.lehigh.edu
|
||||
Joakim Rosqvist: dvljrt@cs.umu.se
|
||||
John Gatewood Ham: zappaman@alphabox.compsci.buu.ac.th
|
||||
Kjetil Torgrim Homme: kjetilho@ifi.uio.no
|
||||
Lorne Baker: lbaker@nitro.avint.net
|
||||
Marcus Daniels: marcus@sysc.pdx.edu
|
||||
Mark A. Thomas: thommark@access.digex.net
|
||||
Mark Harris: mark@monitor.designacc.com
|
||||
@@ -27,6 +33,7 @@ Miles Bader: miles@gnu.ai.mit.edu
|
||||
Noel Cragg: noel@red-bean.com
|
||||
Peter Eriksson: peter@ifm.liu.se
|
||||
Paul Eggert: eggert@twinsun.com
|
||||
Philippe De Muyter: phdm@macqel.be
|
||||
Ross Ridge: rridge@calum.csclub.uwaterloo.ca
|
||||
Santiago Vila Doncel: sanvila@unex.es
|
||||
Stuart Kemp: skemp@peter.bmc.com
|
||||
@@ -35,4 +42,3 @@ Torbjorn Lindgren: tl@funcom.no
|
||||
Tony Leneis: tony@plaza.ds.adp.com
|
||||
Michael Veksler: mveksler@techunix.technion.ac.il
|
||||
Wayne Stewart: wstewa@atl.com
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Makefile.in generated automatically by automake 1.2d from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.3 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998 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.
|
||||
@@ -32,6 +32,8 @@ mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DISTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
@@ -66,12 +68,12 @@ GMOFILES = @GMOFILES@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GT_NO = @GT_NO@
|
||||
GT_YES = @GT_YES@
|
||||
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
MVDIR_PROG = @MVDIR_PROG@
|
||||
@@ -112,19 +114,19 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP = --best
|
||||
default: all
|
||||
all: Makefile $(INFO_DEPS)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .dvi .info .ps .texi .texinfo
|
||||
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
.SUFFIXES: .dvi .info .ps .texi .texinfo .txi
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnits doc/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
version.texi: @MAINT@stamp-vti
|
||||
version.texi: stamp-vti
|
||||
cp $(srcdir)/stamp-vti $(srcdir)/version.texi
|
||||
|
||||
stamp-vti: fileutils.texi $(top_srcdir)/configure.in
|
||||
@@ -145,7 +147,7 @@ clean-vti:
|
||||
distclean-vti:
|
||||
|
||||
maintainer-clean-vti:
|
||||
-@MAINT@rm -f stamp-vti version.texi
|
||||
-rm -f stamp-vti version.texi
|
||||
|
||||
fileutils.info: fileutils.texi version.texi
|
||||
fileutils.dvi: fileutils.texi version.texi
|
||||
@@ -180,26 +182,40 @@ DVIPS = dvips
|
||||
.texinfo.dvi:
|
||||
TEXINPUTS=$(srcdir):$$TEXINPUTS \
|
||||
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||
|
||||
.txi.info:
|
||||
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
|
||||
.txi.dvi:
|
||||
TEXINPUTS=$(srcdir):$$TEXINPUTS \
|
||||
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||
|
||||
.txi:
|
||||
@cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
.dvi.ps:
|
||||
$(DVIPS) $< -o $@
|
||||
|
||||
install-info-am: $(INFO_DEPS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(infodir)
|
||||
$(mkinstalldirs) $(DESTDIR)$(infodir)
|
||||
@for file in $(INFO_DEPS); do \
|
||||
d=$(srcdir); \
|
||||
for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
|
||||
if test -f $$d/$$ifile; then \
|
||||
echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
|
||||
$(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
|
||||
echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
|
||||
$(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
|
||||
else : ; fi; \
|
||||
done; \
|
||||
done
|
||||
@$(POST_INSTALL)
|
||||
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
|
||||
for file in $(INFO_DEPS); do \
|
||||
echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
|
||||
install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
|
||||
echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
|
||||
install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
|
||||
done; \
|
||||
else : ; fi
|
||||
|
||||
@@ -210,11 +226,11 @@ uninstall-info:
|
||||
else ii=; fi; \
|
||||
for file in $(INFO_DEPS); do \
|
||||
test -z "$ii" \
|
||||
|| install-info --info-dir=$(infodir) --remove $$file; \
|
||||
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
|
||||
done
|
||||
$(NORMAL_UNINSTALL)
|
||||
@$(NORMAL_UNINSTALL)
|
||||
for file in $(INFO_DEPS); do \
|
||||
(cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
|
||||
(cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
|
||||
done
|
||||
|
||||
dist-info: $(INFO_DEPS)
|
||||
@@ -282,12 +298,10 @@ install: install-exec install-data all
|
||||
|
||||
uninstall: uninstall-info
|
||||
|
||||
all: Makefile $(INFO_DEPS)
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(infodir)
|
||||
$(mkinstalldirs) $(DESTDIR)$(infodir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
@@ -316,11 +330,11 @@ maintainer-clean: maintainer-clean-vti maintainer-clean-aminfo \
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
.PHONY: default mostlyclean-vti distclean-vti clean-vti \
|
||||
maintainer-clean-vti install-info-am uninstall-info mostlyclean-aminfo \
|
||||
distclean-aminfo clean-aminfo maintainer-clean-aminfo tags distdir info \
|
||||
dvi installcheck install-exec install-data install uninstall all \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
.PHONY: mostlyclean-vti distclean-vti clean-vti maintainer-clean-vti \
|
||||
install-info-am uninstall-info mostlyclean-aminfo distclean-aminfo \
|
||||
clean-aminfo maintainer-clean-aminfo tags distdir info dvi installcheck \
|
||||
install-exec install-data install uninstall all installdirs \
|
||||
mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
|
||||
@@ -467,15 +467,15 @@ year.
|
||||
@cindex MacKenzie, David
|
||||
@cindex Meyering, Jim
|
||||
@code{getdate} was originally implemented by Steven M. Bellovin
|
||||
(@samp{smb@@research.att.com}) while at the University of North Carolina
|
||||
(@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 (@samp{rsalz@@bbn.com})
|
||||
and Jim Berets (@samp{jberets@@bbn.com}) in August, 1990. Various
|
||||
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.
|
||||
|
||||
@cindex Pinard, F.
|
||||
@cindex Berry, K.
|
||||
This chapter was originally produced by Fran@,{c}ois Pinard
|
||||
(@samp{pinard@@iro.umontreal.ca}) from the @file{getdate.y} source code,
|
||||
and then edited by K.@: Berry (@samp{kb@@cs.umb.edu}).
|
||||
(@email{pinard@@iro.umontreal.ca}) from the @file{getdate.y} source code,
|
||||
and then edited by K.@: Berry (@email{kb@@cs.umb.edu}).
|
||||
|
||||
@@ -166,7 +166,7 @@ The GNU shell utilities are mostly compatible with the POSIX.2 standard.
|
||||
@c This paragraph appears in all of fileutils.texi, textutils.texi, and
|
||||
@c sh-utils.texi too -- so be sure to keep them consistent.
|
||||
@cindex bugs, reporting
|
||||
Please report bugs to @samp{sh-utils-bugs@@gnu.ai.mit.edu}. Remember
|
||||
Please report bugs to @samp{sh-utils-bugs@@gnu.org}. Remember
|
||||
to include the version number, machine architecture, input files, and
|
||||
any other information needed to reproduce the bug: your input, what you
|
||||
expected, what you got, and why it is wrong. Diffs are welcome, but
|
||||
@@ -1140,15 +1140,16 @@ The only options are a lone @samp{--help} or
|
||||
Synopses:
|
||||
|
||||
@example
|
||||
stty [@var{setting}]@dots{}
|
||||
stty [@var{option}] [@var{setting}]@dots{}
|
||||
stty [@var{option}]
|
||||
@end example
|
||||
|
||||
If given no arguments, @code{stty} prints the baud rate, line
|
||||
If given no line settings, @code{stty} prints the baud rate, line
|
||||
discipline number (on systems that support it), and line settings
|
||||
that have been changed from the values set by @samp{stty sane}.
|
||||
Mode reading and setting are performed on the tty line connected to
|
||||
standard input.
|
||||
By default, mode reading and setting are performed on the tty line
|
||||
connected to standard input, although this can be modified by the
|
||||
@samp{--file} option.
|
||||
|
||||
@code{stty} accepts many non-option arguments that change aspects of
|
||||
the terminal line operation, as described below.
|
||||
@@ -1160,7 +1161,19 @@ The program accepts the following options. Also see @ref{Common options}.
|
||||
@itemx --all
|
||||
@opindex -a
|
||||
@opindex --all
|
||||
Print all current settings in human-readable form.
|
||||
Print all current settings in human-readable form. This option may not
|
||||
be used in combination with any line settings.
|
||||
|
||||
@item -F @var{device}
|
||||
@itemx --file @var{device}
|
||||
@opindex -F
|
||||
@opindex --file
|
||||
Set the line opened by the filename specified in @var{device} instead of
|
||||
the tty line connected to standard input. This option is necessary
|
||||
because opening a POSIX tty requires use of the @code{O_NONDELAY} flag to
|
||||
prevent a POSIX tty from blocking until the carrier detect line is high if
|
||||
the @code{clocal} flag is not set. Hence, it is not always possible
|
||||
to allow the shell to open the device in the traditional manner.
|
||||
|
||||
@item -g
|
||||
@itemx --save
|
||||
@@ -1168,7 +1181,8 @@ Print all current settings in human-readable form.
|
||||
@opindex --save
|
||||
@cindex machine-readable @code{stty} output
|
||||
Print all current settings in a form that can be used as an argument to
|
||||
another @code{stty} command to restore the current settings.
|
||||
another @code{stty} command to restore the current settings. This option
|
||||
may not be used in combination with any line settings.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
455
doc/texinfo.tex
455
doc/texinfo.tex
@@ -1,32 +1,56 @@
|
||||
%% TeX macros to handle Texinfo files.
|
||||
%% $Id: texinfo.tex,v 1.16 1997/12/25 18:00:21 meyering Exp $
|
||||
|
||||
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
|
||||
% 94, 95, 96, 97 Free Software Foundation, Inc.
|
||||
|
||||
%This texinfo.tex file 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 texinfo.tex file 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 texinfo.tex file; see the file COPYING. If not, write
|
||||
%to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
%Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
%In other words, you are welcome to use, share and improve this program.
|
||||
%You are forbidden to forbid anyone else to use, share and improve
|
||||
%what you give them. Help stamp out software-hoarding!
|
||||
|
||||
|
||||
% Send bug reports to bug-texinfo@prep.ai.mit.edu.
|
||||
% Please include a *precise* test case in each bug report.
|
||||
% texinfo.tex -- TeX macros to handle Texinfo files.
|
||||
% $Id: texinfo.tex,v 1.17 1998/04/11 15:03:51 meyering Exp $
|
||||
%
|
||||
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98
|
||||
% Free Software Foundation, Inc.
|
||||
%
|
||||
% This texinfo.tex file 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 texinfo.tex file 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 texinfo.tex file; see the file COPYING. If not, write
|
||||
% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
% Boston, MA 02111-1307, USA.
|
||||
%
|
||||
% In other words, you are welcome to use, share and improve this program.
|
||||
% You are forbidden to forbid anyone else to use, share and improve
|
||||
% what you give them. Help stamp out software-hoarding!
|
||||
%
|
||||
% Please try the latest version of texinfo.tex before submitting bug
|
||||
% reports; you can get the latest version from:
|
||||
% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
|
||||
% ftp://ftp.gnu.org/pub/gnu/texinfo.tex
|
||||
% (and all GNU mirrors)
|
||||
% ftp://tug.org/tex/texinfo.tex
|
||||
% ftp://ctan.org/macros/texinfo/texinfo.tex
|
||||
% (and all CTAN mirrors, finger ctan@tug.org for a list).
|
||||
%
|
||||
% Send bug reports to bug-texinfo@gnu.org.
|
||||
% Please include a precise test case in each bug report,
|
||||
% including a complete document with which we can reproduce the problem.
|
||||
%
|
||||
% Texinfo macros (with @macro) are *not* supported by texinfo.tex. You
|
||||
% have to run makeinfo -E to expand macros first; the texi2dvi script
|
||||
% does this.
|
||||
%
|
||||
% To process a Texinfo manual with TeX, it's most reliable to use the
|
||||
% texi2dvi shell script that comes with the distribution. For simple
|
||||
% manuals, you can get away with:
|
||||
% tex foo.texi
|
||||
% texindex foo.??
|
||||
% tex foo.texi
|
||||
% tex foo.texi
|
||||
% dvips foo.dvi -o # or whatever, to process the dvi file.
|
||||
% The extra runs of TeX get the cross-reference information correct.
|
||||
% Sometimes one run after texindex suffices, and sometimes you need more
|
||||
% than two; texi2dvi does it as many times as necessary.
|
||||
|
||||
|
||||
% Make it possible to create a .fmt file just by loading this file:
|
||||
@@ -36,7 +60,7 @@
|
||||
|
||||
% This automatically updates the version number based on RCS.
|
||||
\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
|
||||
\deftexinfoversion$Revision: 1.16 $
|
||||
\deftexinfoversion$Revision: 1.17 $
|
||||
\message{Loading texinfo package [Version \texinfoversion]:}
|
||||
|
||||
% If in a .fmt file, print the version number
|
||||
@@ -54,24 +78,17 @@
|
||||
\let\ptexdot=\.
|
||||
\let\ptexdots=\dots
|
||||
\let\ptexend=\end
|
||||
\let\ptexequiv = \equiv
|
||||
\let\ptexequiv=\equiv
|
||||
\let\ptexexclam=\!
|
||||
\let\ptexi=\i
|
||||
\let\ptexlbrace=\{
|
||||
\let\ptexrbrace=\}
|
||||
\let\ptexstar=\*
|
||||
\let\ptext=\t
|
||||
|
||||
% Be sure we're in horizontal mode when doing a tie, since we make space
|
||||
% equivalent to this in @example-like environments. Otherwise, a space
|
||||
% at the beginning of a line will start with \penalty -- and
|
||||
% since \penalty is valid in vertical mode, we'd end up putting the
|
||||
% penalty on the vertical list instead of in the new paragraph.
|
||||
{\catcode`@ = 11
|
||||
% Avoid using \@M directly, because that causes trouble
|
||||
% if the definition is written into an index file.
|
||||
\global\let\tiepenalty = \@M
|
||||
\gdef\tie{\leavevmode\penalty\tiepenalty\ }
|
||||
}
|
||||
% We never want plain's outer \+ definition in Texinfo.
|
||||
% For @tex, we can use \tabalign.
|
||||
\let\+ = \relax
|
||||
|
||||
|
||||
\message{Basics,}
|
||||
@@ -384,7 +401,7 @@
|
||||
|
||||
% @@ prints an @
|
||||
% Kludge this until the fonts are right (grr).
|
||||
\def\@{{\tt \char '100}}
|
||||
\def\@{{\tt\char64}}
|
||||
|
||||
% This is turned off because it was never documented
|
||||
% and you can use @w{...} around a quote to suppress ligatures.
|
||||
@@ -394,8 +411,8 @@
|
||||
%\def\'{{'}}
|
||||
|
||||
% Used to generate quoted braces.
|
||||
\def\mylbrace {{\tt \char '173}}
|
||||
\def\myrbrace {{\tt \char '175}}
|
||||
\def\mylbrace {{\tt\char123}}
|
||||
\def\myrbrace {{\tt\char125}}
|
||||
\let\{=\mylbrace
|
||||
\let\}=\myrbrace
|
||||
\begingroup
|
||||
@@ -432,6 +449,18 @@
|
||||
\fi\fi
|
||||
}
|
||||
|
||||
% Be sure we're in horizontal mode when doing a tie, since we make space
|
||||
% equivalent to this in @example-like environments. Otherwise, a space
|
||||
% at the beginning of a line will start with \penalty -- and
|
||||
% since \penalty is valid in vertical mode, we'd end up putting the
|
||||
% penalty on the vertical list instead of in the new paragraph.
|
||||
{\catcode`@ = 11
|
||||
% Avoid using \@M directly, because that causes trouble
|
||||
% if the definition is written into an index file.
|
||||
\global\let\tiepenalty = \@M
|
||||
\gdef\tie{\leavevmode\penalty\tiepenalty\ }
|
||||
}
|
||||
|
||||
% @: forces normal size whitespace following.
|
||||
\def\:{\spacefactor=1000 }
|
||||
|
||||
@@ -763,6 +792,7 @@ where each line of input produces a line of output.}
|
||||
% Also ignore @macro ... @end macro. The user must run texi2dvi,
|
||||
% which runs makeinfo to do macro expansion. Ignore @unmacro, too.
|
||||
\def\macro{\doignore{macro}}
|
||||
\def\macrocsname{macro}
|
||||
\let\unmacro = \comment
|
||||
|
||||
|
||||
@@ -777,7 +807,9 @@ where each line of input produces a line of output.}
|
||||
\ignoresections
|
||||
%
|
||||
% Define a command to swallow text until we reach `@end #1'.
|
||||
\long\def\doignoretext##1\end #1{\enddoignore}%
|
||||
% This @ is a catcode 12 token (that is the normal catcode of @ in
|
||||
% this texinfo.tex file). We change the catcode of @ below to match.
|
||||
\long\def\doignoretext##1@end #1{\enddoignore}%
|
||||
%
|
||||
% Make sure that spaces turn into tokens that match what \doignoretext wants.
|
||||
\catcode32 = 10
|
||||
@@ -786,6 +818,22 @@ where each line of input produces a line of output.}
|
||||
\catcode`\{ = 9
|
||||
\catcode`\} = 9
|
||||
%
|
||||
% We must not have @c interpreted as a control sequence.
|
||||
\catcode`\@ = 12
|
||||
%
|
||||
% Make the letter c a comment character so that the rest of the line
|
||||
% will be ignored. This way, the document can have (for example)
|
||||
% @c @end ifinfo
|
||||
% and the @end ifinfo will be properly ignored.
|
||||
% (We've just changed @ to catcode 12.)
|
||||
%
|
||||
% But we can't do this if #1 is `macro', since that actually contains a c.
|
||||
% Happily, none of the other conditionals have the letter `c' in their names!
|
||||
\def\temp{#1}%
|
||||
\ifx\temp\macrocsname \else
|
||||
\catcode`\c = 14
|
||||
\fi
|
||||
%
|
||||
% And now expand that command.
|
||||
\doignoretext
|
||||
}
|
||||
@@ -1278,6 +1326,10 @@ where each line of input produces a line of output.}
|
||||
%
|
||||
\textfonts
|
||||
|
||||
% Define these so they can be easily changed for other fonts.
|
||||
\def\angleleft{$\langle$}
|
||||
\def\angleright{$\rangle$}
|
||||
|
||||
% Count depth in font-changes, for error checks
|
||||
\newcount\fontdepth \fontdepth=0
|
||||
|
||||
@@ -1315,15 +1367,15 @@ where each line of input produces a line of output.}
|
||||
\null
|
||||
}
|
||||
\let\ttfont=\t
|
||||
\def\samp #1{`\tclose{#1}'\null}
|
||||
\def\samp#1{`\tclose{#1}'\null}
|
||||
\setfont\smallrm\rmshape{8}{1000}
|
||||
\font\smallsy=cmsy9
|
||||
\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
|
||||
\raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{%
|
||||
\raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
|
||||
\vbox{\hrule\kern-0.4pt
|
||||
\hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}%
|
||||
\hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
|
||||
\kern-0.4pt\hrule}%
|
||||
\kern-.06em\raise0.4pt\hbox{$\rangle$}}}}
|
||||
\kern-.06em\raise0.4pt\hbox{\angleright}}}}
|
||||
% The old definition, with no lozenge:
|
||||
%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
|
||||
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
|
||||
@@ -1436,7 +1488,7 @@ where each line of input produces a line of output.}
|
||||
|
||||
% rms does not like the angle brackets --karl, 17may97.
|
||||
% So now @email is just like @uref.
|
||||
%\def\email#1{$\langle${\tt #1}$\rangle$}
|
||||
%\def\email#1{\angleleft{\tt #1}\angleright}
|
||||
\let\email=\uref
|
||||
|
||||
% Check if we are currently using a typewriter font. Since all the
|
||||
@@ -1689,18 +1741,6 @@ July\or August\or September\or October\or November\or December\fi
|
||||
|
||||
|
||||
\message{tables,}
|
||||
|
||||
% @tabs -- simple alignment
|
||||
|
||||
% These don't work. For one thing, \+ is defined as outer.
|
||||
% So these macros cannot even be defined.
|
||||
|
||||
%\def\tabs{\parsearg\tabszzz}
|
||||
%\def\tabszzz #1{\settabs\+#1\cr}
|
||||
%\def\tabline{\parsearg\tablinezzz}
|
||||
%\def\tablinezzz #1{\+#1\cr}
|
||||
%\def\&{&}
|
||||
|
||||
% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
|
||||
|
||||
% default indentation of table text
|
||||
@@ -2058,10 +2098,7 @@ July\or August\or September\or October\or November\or December\fi
|
||||
% @multitablelinespace is space to leave between table items, baseline
|
||||
% to baseline.
|
||||
% 0pt means it depends on current normal line spacing.
|
||||
|
||||
%%%%
|
||||
% Dimensions
|
||||
|
||||
%
|
||||
\newskip\multitableparskip
|
||||
\newskip\multitableparindent
|
||||
\newdimen\multitablecolspace
|
||||
@@ -2071,15 +2108,15 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\multitablecolspace=12pt
|
||||
\multitablelinespace=0pt
|
||||
|
||||
%%%%
|
||||
% Macros used to set up halign preamble:
|
||||
%
|
||||
\let\endsetuptable\relax
|
||||
\def\xendsetuptable{\endsetuptable}
|
||||
\let\columnfractions\relax
|
||||
\def\xcolumnfractions{\columnfractions}
|
||||
\newif\ifsetpercent
|
||||
|
||||
%% 2/1/96, to allow fractions to be given with more than one digit.
|
||||
% 2/1/96, to allow fractions to be given with more than one digit.
|
||||
\def\pickupwholefraction#1 {\global\advance\colcount by1 %
|
||||
\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
|
||||
\setuptable}
|
||||
@@ -2105,80 +2142,84 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
|
||||
\fi\go}
|
||||
|
||||
%%%%
|
||||
% multitable syntax
|
||||
\def\tab{&\hskip1sp\relax} % 2/2/96
|
||||
% tiny skip here makes sure this column space is
|
||||
% maintained, even if it is never used.
|
||||
|
||||
|
||||
%%%%
|
||||
% @multitable ... @end multitable definitions:
|
||||
|
||||
\def\multitable{\parsearg\dotable}
|
||||
|
||||
\def\dotable#1{\bgroup
|
||||
\let\item\cr
|
||||
\tolerance=9500
|
||||
\hbadness=9500
|
||||
\setmultitablespacing
|
||||
\parskip=\multitableparskip
|
||||
\parindent=\multitableparindent
|
||||
\overfullrule=0pt
|
||||
\global\colcount=0\relax%
|
||||
\def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}%
|
||||
% To parse everything between @multitable and @item :
|
||||
\setuptable#1 \endsetuptable
|
||||
% Need to reset this to 0 after \setuptable.
|
||||
\global\colcount=0\relax%
|
||||
%
|
||||
% This preamble sets up a generic column definition, which will
|
||||
% be used as many times as user calls for columns.
|
||||
% \vtop will set a single line and will also let text wrap and
|
||||
% continue for many paragraphs if desired.
|
||||
\halign\bgroup&\global\advance\colcount by 1\relax%
|
||||
\multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
|
||||
% In order to keep entries from bumping into each other
|
||||
% we will add a \leftskip of \multitablecolspace to all columns after
|
||||
% the first one.
|
||||
% If a template has been used, we will add \multitablecolspace
|
||||
% to the width of each template entry.
|
||||
% If user has set preamble in terms of percent of \hsize
|
||||
% we will use that dimension as the width of the column, and
|
||||
% the \leftskip will keep entries from bumping into each other.
|
||||
% Table will start at left margin and final column will justify at
|
||||
% right margin.
|
||||
\ifnum\colcount=1
|
||||
\else
|
||||
\ifsetpercent
|
||||
\vskip\parskip
|
||||
\let\item\crcr
|
||||
\tolerance=9500
|
||||
\hbadness=9500
|
||||
\setmultitablespacing
|
||||
\parskip=\multitableparskip
|
||||
\parindent=\multitableparindent
|
||||
\overfullrule=0pt
|
||||
\global\colcount=0
|
||||
\def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
|
||||
%
|
||||
% To parse everything between @multitable and @item:
|
||||
\setuptable#1 \endsetuptable
|
||||
%
|
||||
% \everycr will reset column counter, \colcount, at the end of
|
||||
% each line. Every column entry will cause \colcount to advance by one.
|
||||
% The table preamble
|
||||
% looks at the current \colcount to find the correct column width.
|
||||
\everycr{\noalign{%
|
||||
%
|
||||
% \filbreak%% keeps underfull box messages off when table breaks over pages.
|
||||
% Maybe so, but it also creates really weird page breaks when the table
|
||||
% breaks over pages. Wouldn't \vfil be better? Wait until the problem
|
||||
% manifests itself, so it can be fixed for real --karl.
|
||||
\global\colcount=0\relax}}%
|
||||
%
|
||||
% This preamble sets up a generic column definition, which will
|
||||
% be used as many times as user calls for columns.
|
||||
% \vtop will set a single line and will also let text wrap and
|
||||
% continue for many paragraphs if desired.
|
||||
\halign\bgroup&\global\advance\colcount by 1\relax
|
||||
\multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
|
||||
%
|
||||
% In order to keep entries from bumping into each other
|
||||
% we will add a \leftskip of \multitablecolspace to all columns after
|
||||
% the first one.
|
||||
%
|
||||
% If a template has been used, we will add \multitablecolspace
|
||||
% to the width of each template entry.
|
||||
%
|
||||
% If the user has set preamble in terms of percent of \hsize we will
|
||||
% use that dimension as the width of the column, and the \leftskip
|
||||
% will keep entries from bumping into each other. Table will start at
|
||||
% left margin and final column will justify at right margin.
|
||||
%
|
||||
% Make sure we don't inherit \rightskip from the outer environment.
|
||||
\rightskip=0pt
|
||||
\ifnum\colcount=1
|
||||
% The first column will be indented with the surrounding text.
|
||||
\advance\hsize by\leftskip
|
||||
\else
|
||||
% If user has <not> set preamble in terms of percent of \hsize
|
||||
% we will advance \hsize by \multitablecolspace
|
||||
\advance\hsize by \multitablecolspace
|
||||
\ifsetpercent \else
|
||||
% If user has not set preamble in terms of percent of \hsize
|
||||
% we will advance \hsize by \multitablecolspace.
|
||||
\advance\hsize by \multitablecolspace
|
||||
\fi
|
||||
% In either case we will make \leftskip=\multitablecolspace:
|
||||
\leftskip=\multitablecolspace
|
||||
\fi
|
||||
% In either case we will make \leftskip=\multitablecolspace:
|
||||
\leftskip=\multitablecolspace
|
||||
\fi
|
||||
% Ignoring space at the beginning and end avoids an occasional spurious
|
||||
% blank line, when TeX decides to break the line at the space before the
|
||||
% box from the multistrut, so the strut ends up on a line by itself.
|
||||
% For example:
|
||||
% @multitable @columnfractions .11 .89
|
||||
% @item @code{#}
|
||||
% @tab Legal holiday which is valid in major parts of the whole country.
|
||||
% Is automatically provided with highlighting sequences respectively marking
|
||||
% characters.
|
||||
\noindent\ignorespaces##\unskip\multistrut}\cr
|
||||
% \everycr will reset column counter, \colcount, at the end of
|
||||
% each line. Every column entry will cause \colcount to advance by one.
|
||||
% The table preamble
|
||||
% looks at the current \colcount to find the correct column width.
|
||||
\global\everycr{\noalign{%
|
||||
% \filbreak%% keeps underfull box messages off when table breaks over pages.
|
||||
% Maybe so, but it also creates really weird page breaks when the table
|
||||
% breaks over pages Wouldn't \vfil be better? Wait until the problem
|
||||
% manifests itself, so it can be fixed for real --karl.
|
||||
\global\colcount=0\relax}}
|
||||
% Ignoring space at the beginning and end avoids an occasional spurious
|
||||
% blank line, when TeX decides to break the line at the space before the
|
||||
% box from the multistrut, so the strut ends up on a line by itself.
|
||||
% For example:
|
||||
% @multitable @columnfractions .11 .89
|
||||
% @item @code{#}
|
||||
% @tab Legal holiday which is valid in major parts of the whole country.
|
||||
% Is automatically provided with highlighting sequences respectively marking
|
||||
% characters.
|
||||
\noindent\ignorespaces##\unskip\multistrut}\cr
|
||||
}
|
||||
|
||||
\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
|
||||
@@ -2246,20 +2287,24 @@ width0pt\relax} \fi
|
||||
|
||||
% @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.
|
||||
\def\synindex #1 #2 {%
|
||||
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
|
||||
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
|
||||
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
|
||||
\noexpand\doindex {#2}}%
|
||||
% 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\let\csname#1indfile\endcsname=\synindexfoo
|
||||
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
|
||||
\noexpand\docodeindex {#2}}%
|
||||
\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}}%
|
||||
}
|
||||
|
||||
% Define \doindex, the driver for all \fooindex macros.
|
||||
@@ -2525,6 +2570,11 @@ width0pt\relax} \fi
|
||||
\indexbreaks
|
||||
%
|
||||
% See if the index file exists and is nonempty.
|
||||
% Change catcode of @ here so that if the index file contains
|
||||
% \initial {@}
|
||||
% as its first line, TeX doesn't complain about mismatched braces
|
||||
% (because it thinks @} is a control sequence).
|
||||
\catcode`\@ = 11
|
||||
\openin 1 \jobname.#1s
|
||||
\ifeof 1
|
||||
% \enddoublecolumns gets confused if there is no text in the index,
|
||||
@@ -2546,7 +2596,6 @@ width0pt\relax} \fi
|
||||
% to make right now.
|
||||
\def\indexbackslash{\rawbackslashxx}%
|
||||
\catcode`\\ = 0
|
||||
\catcode`\@ = 11
|
||||
\escapechar = `\\
|
||||
\begindoublecolumns
|
||||
\input \jobname.#1s
|
||||
@@ -3442,11 +3491,12 @@ width0pt\relax} \fi
|
||||
% the index entries, but we want to suppress hyphenation here. (We
|
||||
% can't do that in the \entry macro, since index entries might consist
|
||||
% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
|
||||
%
|
||||
% \turnoffactive is for the sake of @" used for umlauts.
|
||||
\def\tocentry#1#2{\begingroup
|
||||
\vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
|
||||
\entry{\turnoffactive #1}{\turnoffactive #2}%
|
||||
% Do not use \turnoffactive in these arguments. Since the toc is
|
||||
% typeset in cmr, so characters such as _ would come out wrong; we
|
||||
% have to do the usual translation tricks.
|
||||
\entry{#1}{#2}%
|
||||
\endgroup}
|
||||
|
||||
% Space between chapter (or whatever) number and the title.
|
||||
@@ -3512,30 +3562,36 @@ width0pt\relax} \fi
|
||||
% But \@ or @@ will get a plain tex @ character.
|
||||
|
||||
\def\tex{\begingroup
|
||||
\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
|
||||
\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
|
||||
\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
|
||||
\catcode `\%=14
|
||||
\catcode 43=12 % plus
|
||||
\catcode`\"=12
|
||||
\catcode`\==12
|
||||
\catcode`\|=12
|
||||
\catcode`\<=12
|
||||
\catcode`\>=12
|
||||
\escapechar=`\\
|
||||
%
|
||||
\let\,=\ptexcomma
|
||||
\let\{=\ptexlbrace
|
||||
\let\}=\ptexrbrace
|
||||
\let\.=\ptexdot
|
||||
\let\*=\ptexstar
|
||||
\let\dots=\ptexdots
|
||||
\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
|
||||
\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
|
||||
\def\@{@}%
|
||||
\let\bullet=\ptexbullet
|
||||
\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext
|
||||
%
|
||||
\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
|
||||
\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
|
||||
\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
|
||||
\catcode `\%=14
|
||||
\catcode 43=12 % plus
|
||||
\catcode`\"=12
|
||||
\catcode`\==12
|
||||
\catcode`\|=12
|
||||
\catcode`\<=12
|
||||
\catcode`\>=12
|
||||
\escapechar=`\\
|
||||
%
|
||||
\let\b=\ptexb
|
||||
\let\bullet=\ptexbullet
|
||||
\let\c=\ptexc
|
||||
\let\,=\ptexcomma
|
||||
\let\.=\ptexdot
|
||||
\let\dots=\ptexdots
|
||||
\let\equiv=\ptexequiv
|
||||
\let\!=\ptexexclam
|
||||
\let\i=\ptexi
|
||||
\let\{=\ptexlbrace
|
||||
\let\+=\tabalign
|
||||
\let\}=\ptexrbrace
|
||||
\let\*=\ptexstar
|
||||
\let\t=\ptext
|
||||
%
|
||||
\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
|
||||
\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
|
||||
\def\@{@}%
|
||||
\let\Etex=\endgroup}
|
||||
|
||||
% Define @lisp ... @endlisp.
|
||||
@@ -3580,8 +3636,8 @@ width0pt\relax} \fi
|
||||
% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
|
||||
\let\nonarrowing=\relax
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% \cartouche: draw rectangle w/rounded corners around argument
|
||||
% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
|
||||
% environment contents.
|
||||
\font\circle=lcircle10
|
||||
\newdimen\circthick
|
||||
\newdimen\cartouter\newdimen\cartinner
|
||||
@@ -3608,9 +3664,9 @@ width0pt\relax} \fi
|
||||
\cartinner=\hsize \advance\cartinner by-\lskip
|
||||
\advance\cartinner by-\rskip
|
||||
\cartouter=\hsize
|
||||
\advance\cartouter by 18pt % allow for 3pt kerns on either
|
||||
\advance\cartouter by 18.4pt % allow for 3pt kerns on either
|
||||
% side, and for 6pt waste from
|
||||
% each corner char
|
||||
% each corner char, and rule thickness
|
||||
\normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
|
||||
% Flag to tell @lisp, etc., not to narrow margin.
|
||||
\let\nonarrowing=\comment
|
||||
@@ -4246,18 +4302,17 @@ width0pt\relax} \fi
|
||||
|
||||
|
||||
\message{cross reference,}
|
||||
% Define cross-reference macros
|
||||
\newwrite \auxfile
|
||||
\newwrite\auxfile
|
||||
|
||||
\newif\ifhavexrefs % True if xref values are known.
|
||||
\newif\ifhavexrefs % True if xref values are known.
|
||||
\newif\ifwarnedxrefs % True if we warned once that they aren't known.
|
||||
|
||||
% @inforef is simple.
|
||||
% @inforef is relatively simple.
|
||||
\def\inforef #1{\inforefzzz #1,,,,**}
|
||||
\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
|
||||
node \samp{\ignorespaces#1{}}}
|
||||
|
||||
% \setref{foo} defines a cross-reference point named foo.
|
||||
% @setref{foo} defines a cross-reference point named foo.
|
||||
|
||||
\def\setref#1{%
|
||||
\dosetq{#1-title}{Ytitle}%
|
||||
@@ -4325,7 +4380,7 @@ width0pt\relax} \fi
|
||||
% into the usual \leavevmode...\vrule stuff for purposes of
|
||||
% printing. So we \turnoffactive for the \refx-snt, back on for the
|
||||
% printing, back off for the \refx-pg.
|
||||
{\turnoffactive \refx{#1-snt}{}}%
|
||||
{\normalturnoffactive \refx{#1-snt}{}}%
|
||||
\space [\printednodename],\space
|
||||
\turnoffactive \putwordpage\tie\refx{#1-pg}{}%
|
||||
\fi
|
||||
@@ -4333,11 +4388,15 @@ width0pt\relax} \fi
|
||||
|
||||
% \dosetq is the interface for calls from other macros
|
||||
|
||||
% Use \turnoffactive so that punctuation chars such as underscore
|
||||
% work in node names.
|
||||
\def\dosetq #1#2{{\let\folio=0 \turnoffactive
|
||||
\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
|
||||
\next}}
|
||||
% Use \normalturnoffactive so that punctuation chars such as underscore
|
||||
% and backslash work in node names. (\turnoffactive doesn't do \.)
|
||||
\def\dosetq#1#2{%
|
||||
{\let\folio=0
|
||||
\normalturnoffactive
|
||||
\edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
|
||||
\next
|
||||
}%
|
||||
}
|
||||
|
||||
% \internalsetq {foo}{page} expands into
|
||||
% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
|
||||
@@ -4388,7 +4447,7 @@ width0pt\relax} \fi
|
||||
\def\refx#1#2{%
|
||||
\expandafter\ifx\csname X#1\endcsname\relax
|
||||
% If not defined, say something at least.
|
||||
$\langle$un\-de\-fined$\rangle$%
|
||||
\angleleft un\-de\-fined\angleright
|
||||
\ifhavexrefs
|
||||
\message{\linenumber Undefined cross reference `#1'.}%
|
||||
\else
|
||||
@@ -4405,10 +4464,13 @@ width0pt\relax} \fi
|
||||
}
|
||||
|
||||
% This is the macro invoked by entries in the aux file.
|
||||
\def\xrdef #1#2{{%
|
||||
\catcode`\'=\other
|
||||
\expandafter\gdef\csname X#1\endcsname{#2}%
|
||||
}}
|
||||
%
|
||||
\def\xrdef#1{\begingroup
|
||||
% Reenable \ as an escape while reading the second argument.
|
||||
\catcode`\\ = 0
|
||||
\afterassignment\endgroup
|
||||
\expandafter\gdef\csname X#1\endcsname
|
||||
}
|
||||
|
||||
% Read the last existing aux file, if any. No error if none exists.
|
||||
\def\readauxfile{\begingroup
|
||||
@@ -4465,8 +4527,7 @@ width0pt\relax} \fi
|
||||
\catcode`\$=\other
|
||||
\catcode`\#=\other
|
||||
\catcode`\&=\other
|
||||
% `\+ does not work, so use 43.
|
||||
\catcode43=\other
|
||||
\catcode`+=\other % avoid \+ for paranoia even though we've turned it off
|
||||
% Make the characters 128-255 be printing characters
|
||||
{%
|
||||
\count 1=128
|
||||
@@ -4837,10 +4898,10 @@ width0pt\relax} \fi
|
||||
% use math or other variants that look better in normal text.
|
||||
|
||||
\catcode`\"=\active
|
||||
\def\activedoublequote{{\tt \char '042}}
|
||||
\def\activedoublequote{{\tt\char34}}
|
||||
\let"=\activedoublequote
|
||||
\catcode`\~=\active
|
||||
\def~{{\tt \char '176}}
|
||||
\def~{{\tt\char126}}
|
||||
\chardef\hat=`\^
|
||||
\catcode`\^=\active
|
||||
\def^{{\tt \hat}}
|
||||
@@ -4851,7 +4912,7 @@ width0pt\relax} \fi
|
||||
\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
|
||||
|
||||
\catcode`\|=\active
|
||||
\def|{{\tt \char '174}}
|
||||
\def|{{\tt\char124}}
|
||||
\chardef \less=`\<
|
||||
\catcode`\<=\active
|
||||
\def<{{\tt \less}}
|
||||
@@ -4938,8 +4999,8 @@ width0pt\relax} \fi
|
||||
@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
|
||||
@catcode`+=@active @catcode`@_=@active}
|
||||
|
||||
%% These look ok in all fonts, so just make them not special. The @rm below
|
||||
%% makes sure that the current font starts out as the newly loaded cmr10
|
||||
% These look ok in all fonts, so just make them not special. The @rm below
|
||||
% makes sure that the current font starts out as the newly loaded cmr10
|
||||
@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
|
||||
|
||||
@textfonts
|
||||
|
||||
@@ -142,7 +142,7 @@ The GNU text utilities are mostly compatible with the @sc{POSIX.2} standard.
|
||||
@c This paragraph appears in all of fileutils.texi, textutils.texi, and
|
||||
@c sh-utils.texi too -- so be sure to keep them consistent.
|
||||
@cindex bugs, reporting
|
||||
Please report bugs to @samp{textutils-bugs@@gnu.ai.mit.edu}. Remember
|
||||
Please report bugs to @email{textutils-bugs@@gnu.org}. Remember
|
||||
to include the version number, machine architecture, input files, and
|
||||
any other information needed to reproduce the bug: your input, what you
|
||||
expected, what you got, and why it is wrong. Diffs are welcome, but
|
||||
@@ -2696,6 +2696,24 @@ Convert each sequence of repeated newlines to a single newline:
|
||||
tr -s '\n'
|
||||
@end example
|
||||
|
||||
@item
|
||||
Find doubled occurrences of words in a document.
|
||||
For example, people often write ``the the'' with the duplicated words
|
||||
separated by a newline. The bourne shell script below works first
|
||||
by converting each sequence of punctuation and blank characters to a
|
||||
single newline. That puts each ``word'' on a line by itself.
|
||||
Next it maps all uppercase characters to lower case, and finally it
|
||||
runs @code{uniq} with the @samp{-d} option to print out only the words
|
||||
that were adjacent duplicates.
|
||||
|
||||
@example
|
||||
#!/bin/sh
|
||||
cat "$@@" \
|
||||
| tr -s '[:punct:][:blank:]' '\n' \
|
||||
| tr '[:upper:]' '[:lower:]' \
|
||||
| uniq -d
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
||||
|
||||
|
||||
@@ -4,9 +4,6 @@ AUTOMAKE_OPTIONS = ../src/ansi2knr
|
||||
|
||||
noinst_LIBRARIES = libfu.a
|
||||
|
||||
EXTRA_DIST = chown.c getgroups.c getline.c lstat.c malloc.c mktime.c \
|
||||
realloc.c stat.c strftime.c
|
||||
|
||||
INCLUDES = -I.. -I$(srcdir) -I../intl
|
||||
|
||||
libfu_a_SOURCES = getdate.y posixtm.y getopt.c getopt1.c \
|
||||
@@ -14,7 +11,7 @@ addext.c argmatch.c backupfile.c basename.c \
|
||||
closeout.c dirname.c exclude.c filemode.c \
|
||||
full-write.c human.c idcache.c \
|
||||
isdir.c long-options.c makepath.c modechange.c hash.c path-concat.c \
|
||||
safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
|
||||
quotearg.c safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
|
||||
xmalloc.c xstrdup.c xstrtol.c xstrtoul.c yesno.c
|
||||
|
||||
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
@@ -24,6 +21,7 @@ noinst_HEADERS = argmatch.h backupfile.h closeout.h \
|
||||
error.h exclude.h fnmatch.h fsusage.h \
|
||||
getdate.h getline.h getopt.h group-member.h human.h long-options.h \
|
||||
makepath.h modechange.h mountlist.h hash.h path-concat.h pathmax.h \
|
||||
save-cwd.h savedir.h strverscmp.h xalloc.h xstrtol.h xstrtoul.h
|
||||
quotearg.h safe-read.h save-cwd.h savedir.h strverscmp.h \
|
||||
xalloc.h xstrtol.h xstrtoul.h
|
||||
|
||||
BUILT_SOURCES = getdate.c posixtm.c
|
||||
|
||||
260
lib/Makefile.in
260
lib/Makefile.in
@@ -1,6 +1,6 @@
|
||||
# Makefile.in generated automatically by automake 1.2d from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.3 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998 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.
|
||||
@@ -32,6 +32,8 @@ mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DISTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
@@ -66,12 +68,12 @@ GMOFILES = @GMOFILES@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GT_NO = @GT_NO@
|
||||
GT_YES = @GT_YES@
|
||||
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
@@ -92,9 +94,6 @@ AUTOMAKE_OPTIONS = ../src/ansi2knr
|
||||
|
||||
noinst_LIBRARIES = libfu.a
|
||||
|
||||
EXTRA_DIST = chown.c getgroups.c getline.c lstat.c malloc.c mktime.c \
|
||||
realloc.c stat.c strftime.c
|
||||
|
||||
INCLUDES = -I.. -I$(srcdir) -I../intl
|
||||
|
||||
libfu_a_SOURCES = getdate.y posixtm.y getopt.c getopt1.c \
|
||||
@@ -102,7 +101,7 @@ addext.c argmatch.c backupfile.c basename.c \
|
||||
closeout.c dirname.c exclude.c filemode.c \
|
||||
full-write.c human.c idcache.c \
|
||||
isdir.c long-options.c makepath.c modechange.c hash.c path-concat.c \
|
||||
safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
|
||||
quotearg.c safe-read.c save-cwd.c savedir.c stripslash.c userspec.c xgetcwd.c \
|
||||
xmalloc.c xstrdup.c xstrtol.c xstrtoul.c yesno.c
|
||||
|
||||
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
@@ -112,7 +111,8 @@ noinst_HEADERS = argmatch.h backupfile.h closeout.h \
|
||||
error.h exclude.h fnmatch.h fsusage.h \
|
||||
getdate.h getline.h getopt.h group-member.h human.h long-options.h \
|
||||
makepath.h modechange.h mountlist.h hash.h path-concat.h pathmax.h \
|
||||
save-cwd.h savedir.h strverscmp.h xalloc.h xstrtol.h xstrtoul.h
|
||||
quotearg.h safe-read.h save-cwd.h savedir.h strverscmp.h \
|
||||
xalloc.h xstrtol.h xstrtoul.h
|
||||
|
||||
BUILT_SOURCES = getdate.c posixtm.c
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
@@ -130,9 +130,9 @@ libfu_a_OBJECTS = getdate$U.o posixtm$U.o getopt$U.o getopt1$U.o \
|
||||
addext$U.o argmatch$U.o backupfile$U.o basename$U.o closeout$U.o \
|
||||
dirname$U.o exclude$U.o filemode$U.o full-write$U.o human$U.o \
|
||||
idcache$U.o isdir$U.o long-options$U.o makepath$U.o modechange$U.o \
|
||||
hash$U.o path-concat$U.o safe-read$U.o save-cwd$U.o savedir$U.o \
|
||||
stripslash$U.o userspec$U.o xgetcwd$U.o xmalloc$U.o xstrdup$U.o \
|
||||
xstrtol$U.o xstrtoul$U.o yesno$U.o
|
||||
hash$U.o path-concat$U.o quotearg$U.o safe-read$U.o save-cwd$U.o \
|
||||
savedir$U.o stripslash$U.o userspec$U.o xgetcwd$U.o xmalloc$U.o \
|
||||
xstrdup$U.o xstrtol$U.o xstrtoul$U.o yesno$U.o
|
||||
AR = ar
|
||||
YLWRAP = $(srcdir)/ylwrap
|
||||
CFLAGS = @CFLAGS@
|
||||
@@ -140,13 +140,13 @@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
|
||||
DIST_COMMON = Makefile.am Makefile.in alloca.c chown.c error.c error.h \
|
||||
euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c getdate.c \
|
||||
getgroups.c getline.c group-member.c lstat.c malloc.c memcmp.c memcpy.c \
|
||||
memset.c mkdir.c mktime.c mountlist.c obstack.c obstack.h posixtm.c \
|
||||
realloc.c regex.c regex.h rename.c rmdir.c rpmatch.c rx.c rx.h stat.c \
|
||||
stpcpy.c strcasecmp.c strdup.c strftime.c strndup.c strstr.c strtol.c \
|
||||
strtoul.c strverscmp.c ylwrap
|
||||
DIST_COMMON = Makefile.am Makefile.in TODO alloca.c chown.c error.c \
|
||||
error.h euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c \
|
||||
getdate.c getgroups.c getline.c group-member.c lchown.c lstat.c \
|
||||
malloc.c memcmp.c memcpy.c memset.c mkdir.c mktime.c mountlist.c \
|
||||
obstack.c obstack.h posixtm.c realloc.c regex.c regex.h rename.c \
|
||||
rmdir.c rpmatch.c rx.c rx.h stat.c stpcpy.c strcasecmp.c strdup.c \
|
||||
strftime.c strndup.c strstr.c strtol.c strtoul.c strverscmp.c ylwrap
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
@@ -157,13 +157,14 @@ DEP_FILES = .deps/addext.P .deps/alloca.P .deps/argmatch.P \
|
||||
.deps/backupfile.P .deps/basename.P .deps/chown.P .deps/closeout.P \
|
||||
.deps/dirname.P .deps/error.P .deps/euidaccess.P .deps/exclude.P \
|
||||
.deps/fileblocks.P .deps/filemode.P .deps/fnmatch.P .deps/fsusage.P \
|
||||
.deps/ftruncate.P .deps/full-write.P .deps/getdate.P .deps/getgroups.P \
|
||||
.deps/getline.P .deps/getopt.P .deps/getopt1.P .deps/group-member.P \
|
||||
.deps/hash.P .deps/human.P .deps/idcache.P .deps/isdir.P \
|
||||
.deps/long-options.P .deps/lstat.P .deps/makepath.P .deps/malloc.P \
|
||||
.deps/memcmp.P .deps/memcpy.P .deps/memset.P .deps/mkdir.P \
|
||||
.deps/mktime.P .deps/modechange.P .deps/mountlist.P .deps/obstack.P \
|
||||
.deps/path-concat.P .deps/posixtm.P .deps/realloc.P .deps/regex.P \
|
||||
.deps/ftruncate.P .deps/full-write.P .deps/getdate .deps/getdate.P \
|
||||
.deps/getgroups.P .deps/getline.P .deps/getopt.P .deps/getopt1.P \
|
||||
.deps/group-member.P .deps/hash.P .deps/human.P .deps/idcache.P \
|
||||
.deps/isdir.P .deps/lchown.P .deps/long-options.P .deps/lstat.P \
|
||||
.deps/makepath.P .deps/malloc.P .deps/memcmp.P .deps/memcpy.P \
|
||||
.deps/memset.P .deps/mkdir.P .deps/mktime.P .deps/modechange.P \
|
||||
.deps/mountlist.P .deps/obstack.P .deps/path-concat.P .deps/posixtm \
|
||||
.deps/posixtm.P .deps/quotearg.P .deps/realloc.P .deps/regex.P \
|
||||
.deps/rename.P .deps/rmdir.P .deps/rpmatch.P .deps/rx.P \
|
||||
.deps/safe-read.P .deps/save-cwd.P .deps/savedir.P .deps/stat.P \
|
||||
.deps/stpcpy.P .deps/strcasecmp.P .deps/strdup.P .deps/strftime.P \
|
||||
@@ -174,14 +175,14 @@ DEP_FILES = .deps/addext.P .deps/alloca.P .deps/argmatch.P \
|
||||
SOURCES = $(libfu_a_SOURCES)
|
||||
OBJECTS = $(libfu_a_OBJECTS)
|
||||
|
||||
default: all
|
||||
all: Makefile $(LIBRARIES) $(HEADERS)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .h .o .s .y
|
||||
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
.SUFFIXES: .S .c .o .s .y
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnits lib/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@@ -195,9 +196,6 @@ distclean-noinstLIBRARIES:
|
||||
|
||||
maintainer-clean-noinstLIBRARIES:
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
@@ -205,7 +203,7 @@ maintainer-clean-noinstLIBRARIES:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.o core
|
||||
-rm -f *.o core *.core
|
||||
|
||||
clean-compile:
|
||||
|
||||
@@ -216,6 +214,9 @@ maintainer-clean-compile:
|
||||
../src/ansi2knr: ../src/ansi2knr.o
|
||||
cd ../src && $(MAKE) ansi2knr
|
||||
|
||||
../src/ansi2knr.o:
|
||||
cd ../src && $(MAKE) ansi2knr.o
|
||||
|
||||
|
||||
mostlyclean-kr:
|
||||
-rm -f *_.c
|
||||
@@ -232,156 +233,161 @@ libfu.a: $(libfu_a_OBJECTS) $(libfu_a_DEPENDENCIES)
|
||||
$(RANLIB) libfu.a
|
||||
.y.c:
|
||||
$(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(YFLAGS)
|
||||
.y.h:
|
||||
$(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(YFLAGS)
|
||||
posixtm.h: posixtm.c
|
||||
getdate.h: getdate.c
|
||||
|
||||
addext_.c: addext.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/addext.c; then echo $(srcdir)/addext.c; else echo addext.c; fi` addext_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/addext.c; then echo $(srcdir)/addext.c; else echo addext.c; fi` | $(ANSI2KNR) > addext_.c
|
||||
alloca_.c: alloca.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` alloca_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | $(ANSI2KNR) > alloca_.c
|
||||
argmatch_.c: argmatch.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/argmatch.c; then echo $(srcdir)/argmatch.c; else echo argmatch.c; fi` argmatch_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/argmatch.c; then echo $(srcdir)/argmatch.c; else echo argmatch.c; fi` | $(ANSI2KNR) > argmatch_.c
|
||||
backupfile_.c: backupfile.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/backupfile.c; then echo $(srcdir)/backupfile.c; else echo backupfile.c; fi` backupfile_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/backupfile.c; then echo $(srcdir)/backupfile.c; else echo backupfile.c; fi` | $(ANSI2KNR) > backupfile_.c
|
||||
basename_.c: basename.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/basename.c; then echo $(srcdir)/basename.c; else echo basename.c; fi` basename_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/basename.c; then echo $(srcdir)/basename.c; else echo basename.c; fi` | $(ANSI2KNR) > basename_.c
|
||||
chown_.c: chown.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/chown.c; then echo $(srcdir)/chown.c; else echo chown.c; fi` chown_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/chown.c; then echo $(srcdir)/chown.c; else echo chown.c; fi` | $(ANSI2KNR) > chown_.c
|
||||
closeout_.c: closeout.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/closeout.c; then echo $(srcdir)/closeout.c; else echo closeout.c; fi` closeout_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/closeout.c; then echo $(srcdir)/closeout.c; else echo closeout.c; fi` | $(ANSI2KNR) > closeout_.c
|
||||
dirname_.c: dirname.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/dirname.c; then echo $(srcdir)/dirname.c; else echo dirname.c; fi` dirname_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/dirname.c; then echo $(srcdir)/dirname.c; else echo dirname.c; fi` | $(ANSI2KNR) > dirname_.c
|
||||
error_.c: error.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` error_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/error.c; then echo $(srcdir)/error.c; else echo error.c; fi` | $(ANSI2KNR) > error_.c
|
||||
euidaccess_.c: euidaccess.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/euidaccess.c; then echo $(srcdir)/euidaccess.c; else echo euidaccess.c; fi` euidaccess_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/euidaccess.c; then echo $(srcdir)/euidaccess.c; else echo euidaccess.c; fi` | $(ANSI2KNR) > euidaccess_.c
|
||||
exclude_.c: exclude.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/exclude.c; then echo $(srcdir)/exclude.c; else echo exclude.c; fi` exclude_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/exclude.c; then echo $(srcdir)/exclude.c; else echo exclude.c; fi` | $(ANSI2KNR) > exclude_.c
|
||||
fileblocks_.c: fileblocks.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/fileblocks.c; then echo $(srcdir)/fileblocks.c; else echo fileblocks.c; fi` fileblocks_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/fileblocks.c; then echo $(srcdir)/fileblocks.c; else echo fileblocks.c; fi` | $(ANSI2KNR) > fileblocks_.c
|
||||
filemode_.c: filemode.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/filemode.c; then echo $(srcdir)/filemode.c; else echo filemode.c; fi` filemode_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/filemode.c; then echo $(srcdir)/filemode.c; else echo filemode.c; fi` | $(ANSI2KNR) > filemode_.c
|
||||
fnmatch_.c: fnmatch.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/fnmatch.c; then echo $(srcdir)/fnmatch.c; else echo fnmatch.c; fi` fnmatch_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/fnmatch.c; then echo $(srcdir)/fnmatch.c; else echo fnmatch.c; fi` | $(ANSI2KNR) > fnmatch_.c
|
||||
fsusage_.c: fsusage.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/fsusage.c; then echo $(srcdir)/fsusage.c; else echo fsusage.c; fi` fsusage_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/fsusage.c; then echo $(srcdir)/fsusage.c; else echo fsusage.c; fi` | $(ANSI2KNR) > fsusage_.c
|
||||
ftruncate_.c: ftruncate.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/ftruncate.c; then echo $(srcdir)/ftruncate.c; else echo ftruncate.c; fi` ftruncate_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/ftruncate.c; then echo $(srcdir)/ftruncate.c; else echo ftruncate.c; fi` | $(ANSI2KNR) > ftruncate_.c
|
||||
full-write_.c: full-write.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/full-write.c; then echo $(srcdir)/full-write.c; else echo full-write.c; fi` full-write_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/full-write.c; then echo $(srcdir)/full-write.c; else echo full-write.c; fi` | $(ANSI2KNR) > full-write_.c
|
||||
getdate_.c: getdate.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/getdate.c; then echo $(srcdir)/getdate.c; else echo getdate.c; fi` getdate_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/getdate.c; then echo $(srcdir)/getdate.c; else echo getdate.c; fi` | $(ANSI2KNR) > getdate_.c
|
||||
getgroups_.c: getgroups.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/getgroups.c; then echo $(srcdir)/getgroups.c; else echo getgroups.c; fi` getgroups_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/getgroups.c; then echo $(srcdir)/getgroups.c; else echo getgroups.c; fi` | $(ANSI2KNR) > getgroups_.c
|
||||
getline_.c: getline.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/getline.c; then echo $(srcdir)/getline.c; else echo getline.c; fi` getline_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/getline.c; then echo $(srcdir)/getline.c; else echo getline.c; fi` | $(ANSI2KNR) > getline_.c
|
||||
getopt_.c: getopt.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` getopt_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` | $(ANSI2KNR) > getopt_.c
|
||||
getopt1_.c: getopt1.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` getopt1_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` | $(ANSI2KNR) > getopt1_.c
|
||||
group-member_.c: group-member.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/group-member.c; then echo $(srcdir)/group-member.c; else echo group-member.c; fi` group-member_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/group-member.c; then echo $(srcdir)/group-member.c; else echo group-member.c; fi` | $(ANSI2KNR) > group-member_.c
|
||||
hash_.c: hash.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/hash.c; then echo $(srcdir)/hash.c; else echo hash.c; fi` hash_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/hash.c; then echo $(srcdir)/hash.c; else echo hash.c; fi` | $(ANSI2KNR) > hash_.c
|
||||
human_.c: human.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/human.c; then echo $(srcdir)/human.c; else echo human.c; fi` human_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/human.c; then echo $(srcdir)/human.c; else echo human.c; fi` | $(ANSI2KNR) > human_.c
|
||||
idcache_.c: idcache.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/idcache.c; then echo $(srcdir)/idcache.c; else echo idcache.c; fi` idcache_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/idcache.c; then echo $(srcdir)/idcache.c; else echo idcache.c; fi` | $(ANSI2KNR) > idcache_.c
|
||||
isdir_.c: isdir.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/isdir.c; then echo $(srcdir)/isdir.c; else echo isdir.c; fi` isdir_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/isdir.c; then echo $(srcdir)/isdir.c; else echo isdir.c; fi` | $(ANSI2KNR) > isdir_.c
|
||||
lchown_.c: lchown.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/lchown.c; then echo $(srcdir)/lchown.c; else echo lchown.c; fi` | $(ANSI2KNR) > lchown_.c
|
||||
long-options_.c: long-options.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/long-options.c; then echo $(srcdir)/long-options.c; else echo long-options.c; fi` long-options_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/long-options.c; then echo $(srcdir)/long-options.c; else echo long-options.c; fi` | $(ANSI2KNR) > long-options_.c
|
||||
lstat_.c: lstat.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/lstat.c; then echo $(srcdir)/lstat.c; else echo lstat.c; fi` lstat_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/lstat.c; then echo $(srcdir)/lstat.c; else echo lstat.c; fi` | $(ANSI2KNR) > lstat_.c
|
||||
makepath_.c: makepath.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/makepath.c; then echo $(srcdir)/makepath.c; else echo makepath.c; fi` makepath_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/makepath.c; then echo $(srcdir)/makepath.c; else echo makepath.c; fi` | $(ANSI2KNR) > makepath_.c
|
||||
malloc_.c: malloc.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` malloc_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | $(ANSI2KNR) > malloc_.c
|
||||
memcmp_.c: memcmp.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` memcmp_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` | $(ANSI2KNR) > memcmp_.c
|
||||
memcpy_.c: memcpy.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` memcpy_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` | $(ANSI2KNR) > memcpy_.c
|
||||
memset_.c: memset.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` memset_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/memset.c; then echo $(srcdir)/memset.c; else echo memset.c; fi` | $(ANSI2KNR) > memset_.c
|
||||
mkdir_.c: mkdir.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/mkdir.c; then echo $(srcdir)/mkdir.c; else echo mkdir.c; fi` mkdir_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/mkdir.c; then echo $(srcdir)/mkdir.c; else echo mkdir.c; fi` | $(ANSI2KNR) > mkdir_.c
|
||||
mktime_.c: mktime.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/mktime.c; then echo $(srcdir)/mktime.c; else echo mktime.c; fi` mktime_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/mktime.c; then echo $(srcdir)/mktime.c; else echo mktime.c; fi` | $(ANSI2KNR) > mktime_.c
|
||||
modechange_.c: modechange.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/modechange.c; then echo $(srcdir)/modechange.c; else echo modechange.c; fi` modechange_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/modechange.c; then echo $(srcdir)/modechange.c; else echo modechange.c; fi` | $(ANSI2KNR) > modechange_.c
|
||||
mountlist_.c: mountlist.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/mountlist.c; then echo $(srcdir)/mountlist.c; else echo mountlist.c; fi` mountlist_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/mountlist.c; then echo $(srcdir)/mountlist.c; else echo mountlist.c; fi` | $(ANSI2KNR) > mountlist_.c
|
||||
obstack_.c: obstack.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/obstack.c; then echo $(srcdir)/obstack.c; else echo obstack.c; fi` obstack_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/obstack.c; then echo $(srcdir)/obstack.c; else echo obstack.c; fi` | $(ANSI2KNR) > obstack_.c
|
||||
path-concat_.c: path-concat.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/path-concat.c; then echo $(srcdir)/path-concat.c; else echo path-concat.c; fi` path-concat_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/path-concat.c; then echo $(srcdir)/path-concat.c; else echo path-concat.c; fi` | $(ANSI2KNR) > path-concat_.c
|
||||
posixtm_.c: posixtm.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/posixtm.c; then echo $(srcdir)/posixtm.c; else echo posixtm.c; fi` posixtm_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/posixtm.c; then echo $(srcdir)/posixtm.c; else echo posixtm.c; fi` | $(ANSI2KNR) > posixtm_.c
|
||||
quotearg_.c: quotearg.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/quotearg.c; then echo $(srcdir)/quotearg.c; else echo quotearg.c; fi` | $(ANSI2KNR) > quotearg_.c
|
||||
realloc_.c: realloc.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` realloc_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | $(ANSI2KNR) > realloc_.c
|
||||
regex_.c: regex.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` regex_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/regex.c; then echo $(srcdir)/regex.c; else echo regex.c; fi` | $(ANSI2KNR) > regex_.c
|
||||
rename_.c: rename.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/rename.c; then echo $(srcdir)/rename.c; else echo rename.c; fi` rename_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/rename.c; then echo $(srcdir)/rename.c; else echo rename.c; fi` | $(ANSI2KNR) > rename_.c
|
||||
rmdir_.c: rmdir.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/rmdir.c; then echo $(srcdir)/rmdir.c; else echo rmdir.c; fi` rmdir_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/rmdir.c; then echo $(srcdir)/rmdir.c; else echo rmdir.c; fi` | $(ANSI2KNR) > rmdir_.c
|
||||
rpmatch_.c: rpmatch.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/rpmatch.c; then echo $(srcdir)/rpmatch.c; else echo rpmatch.c; fi` rpmatch_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/rpmatch.c; then echo $(srcdir)/rpmatch.c; else echo rpmatch.c; fi` | $(ANSI2KNR) > rpmatch_.c
|
||||
rx_.c: rx.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/rx.c; then echo $(srcdir)/rx.c; else echo rx.c; fi` rx_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/rx.c; then echo $(srcdir)/rx.c; else echo rx.c; fi` | $(ANSI2KNR) > rx_.c
|
||||
safe-read_.c: safe-read.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/safe-read.c; then echo $(srcdir)/safe-read.c; else echo safe-read.c; fi` safe-read_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/safe-read.c; then echo $(srcdir)/safe-read.c; else echo safe-read.c; fi` | $(ANSI2KNR) > safe-read_.c
|
||||
save-cwd_.c: save-cwd.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/save-cwd.c; then echo $(srcdir)/save-cwd.c; else echo save-cwd.c; fi` save-cwd_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/save-cwd.c; then echo $(srcdir)/save-cwd.c; else echo save-cwd.c; fi` | $(ANSI2KNR) > save-cwd_.c
|
||||
savedir_.c: savedir.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/savedir.c; then echo $(srcdir)/savedir.c; else echo savedir.c; fi` savedir_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/savedir.c; then echo $(srcdir)/savedir.c; else echo savedir.c; fi` | $(ANSI2KNR) > savedir_.c
|
||||
stat_.c: stat.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` stat_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` | $(ANSI2KNR) > stat_.c
|
||||
stpcpy_.c: stpcpy.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` stpcpy_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | $(ANSI2KNR) > stpcpy_.c
|
||||
strcasecmp_.c: strcasecmp.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/strcasecmp.c; then echo $(srcdir)/strcasecmp.c; else echo strcasecmp.c; fi` strcasecmp_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strcasecmp.c; then echo $(srcdir)/strcasecmp.c; else echo strcasecmp.c; fi` | $(ANSI2KNR) > strcasecmp_.c
|
||||
strdup_.c: strdup.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` strdup_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` | $(ANSI2KNR) > strdup_.c
|
||||
strftime_.c: strftime.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/strftime.c; then echo $(srcdir)/strftime.c; else echo strftime.c; fi` strftime_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strftime.c; then echo $(srcdir)/strftime.c; else echo strftime.c; fi` | $(ANSI2KNR) > strftime_.c
|
||||
stripslash_.c: stripslash.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/stripslash.c; then echo $(srcdir)/stripslash.c; else echo stripslash.c; fi` stripslash_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/stripslash.c; then echo $(srcdir)/stripslash.c; else echo stripslash.c; fi` | $(ANSI2KNR) > stripslash_.c
|
||||
strndup_.c: strndup.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/strndup.c; then echo $(srcdir)/strndup.c; else echo strndup.c; fi` strndup_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strndup.c; then echo $(srcdir)/strndup.c; else echo strndup.c; fi` | $(ANSI2KNR) > strndup_.c
|
||||
strstr_.c: strstr.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/strstr.c; then echo $(srcdir)/strstr.c; else echo strstr.c; fi` strstr_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strstr.c; then echo $(srcdir)/strstr.c; else echo strstr.c; fi` | $(ANSI2KNR) > strstr_.c
|
||||
strtol_.c: strtol.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` strtol_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` | $(ANSI2KNR) > strtol_.c
|
||||
strtoul_.c: strtoul.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` strtoul_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strtoul.c; then echo $(srcdir)/strtoul.c; else echo strtoul.c; fi` | $(ANSI2KNR) > strtoul_.c
|
||||
strverscmp_.c: strverscmp.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/strverscmp.c; then echo $(srcdir)/strverscmp.c; else echo strverscmp.c; fi` strverscmp_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/strverscmp.c; then echo $(srcdir)/strverscmp.c; else echo strverscmp.c; fi` | $(ANSI2KNR) > strverscmp_.c
|
||||
userspec_.c: userspec.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/userspec.c; then echo $(srcdir)/userspec.c; else echo userspec.c; fi` userspec_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/userspec.c; then echo $(srcdir)/userspec.c; else echo userspec.c; fi` | $(ANSI2KNR) > userspec_.c
|
||||
xgetcwd_.c: xgetcwd.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/xgetcwd.c; then echo $(srcdir)/xgetcwd.c; else echo xgetcwd.c; fi` xgetcwd_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/xgetcwd.c; then echo $(srcdir)/xgetcwd.c; else echo xgetcwd.c; fi` | $(ANSI2KNR) > xgetcwd_.c
|
||||
xmalloc_.c: xmalloc.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/xmalloc.c; then echo $(srcdir)/xmalloc.c; else echo xmalloc.c; fi` xmalloc_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/xmalloc.c; then echo $(srcdir)/xmalloc.c; else echo xmalloc.c; fi` | $(ANSI2KNR) > xmalloc_.c
|
||||
xstrdup_.c: xstrdup.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/xstrdup.c; then echo $(srcdir)/xstrdup.c; else echo xstrdup.c; fi` xstrdup_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/xstrdup.c; then echo $(srcdir)/xstrdup.c; else echo xstrdup.c; fi` | $(ANSI2KNR) > xstrdup_.c
|
||||
xstrtol_.c: xstrtol.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/xstrtol.c; then echo $(srcdir)/xstrtol.c; else echo xstrtol.c; fi` xstrtol_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/xstrtol.c; then echo $(srcdir)/xstrtol.c; else echo xstrtol.c; fi` | $(ANSI2KNR) > xstrtol_.c
|
||||
xstrtoul_.c: xstrtoul.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/xstrtoul.c; then echo $(srcdir)/xstrtoul.c; else echo xstrtoul.c; fi` xstrtoul_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/xstrtoul.c; then echo $(srcdir)/xstrtoul.c; else echo xstrtoul.c; fi` | $(ANSI2KNR) > xstrtoul_.c
|
||||
yesno_.c: yesno.c $(ANSI2KNR)
|
||||
$(ANSI2KNR) `if test -f $(srcdir)/yesno.c; then echo $(srcdir)/yesno.c; else echo yesno.c; fi` yesno_.c
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(CPPFLAGS) `if test -f $(srcdir)/yesno.c; then echo $(srcdir)/yesno.c; else echo yesno.c; fi` | $(ANSI2KNR) > yesno_.c
|
||||
addext_.o alloca_.o argmatch_.o backupfile_.o basename_.o chown_.o \
|
||||
closeout_.o dirname_.o error_.o euidaccess_.o exclude_.o fileblocks_.o \
|
||||
filemode_.o fnmatch_.o fsusage_.o ftruncate_.o full-write_.o getdate_.o \
|
||||
getgroups_.o getline_.o getopt_.o getopt1_.o group-member_.o hash_.o \
|
||||
human_.o idcache_.o isdir_.o long-options_.o lstat_.o makepath_.o \
|
||||
malloc_.o memcmp_.o memcpy_.o memset_.o mkdir_.o mktime_.o \
|
||||
human_.o idcache_.o isdir_.o lchown_.o long-options_.o lstat_.o \
|
||||
makepath_.o malloc_.o memcmp_.o memcpy_.o memset_.o mkdir_.o mktime_.o \
|
||||
modechange_.o mountlist_.o obstack_.o path-concat_.o posixtm_.o \
|
||||
realloc_.o regex_.o rename_.o rmdir_.o rpmatch_.o rx_.o safe-read_.o \
|
||||
save-cwd_.o savedir_.o stat_.o stpcpy_.o strcasecmp_.o strdup_.o \
|
||||
strftime_.o stripslash_.o strndup_.o strstr_.o strtol_.o strtoul_.o \
|
||||
strverscmp_.o userspec_.o xgetcwd_.o xmalloc_.o xstrdup_.o xstrtol_.o \
|
||||
xstrtoul_.o yesno_.o : $(ANSI2KNR)
|
||||
quotearg_.o realloc_.o regex_.o rename_.o rmdir_.o rpmatch_.o rx_.o \
|
||||
safe-read_.o save-cwd_.o savedir_.o stat_.o stpcpy_.o strcasecmp_.o \
|
||||
strdup_.o strftime_.o stripslash_.o strndup_.o strstr_.o strtol_.o \
|
||||
strtoul_.o strverscmp_.o userspec_.o xgetcwd_.o xmalloc_.o xstrdup_.o \
|
||||
xstrtol_.o xstrtoul_.o yesno_.o : $(ANSI2KNR)
|
||||
|
||||
tags: TAGS
|
||||
|
||||
@@ -392,8 +398,12 @@ ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
test -z "$(ETAGS_ARGS)$(SOURCES)$(HEADERS)$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $(SOURCES) $(HEADERS) $(LISP) -o $$here/TAGS)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
@@ -421,14 +431,9 @@ distdir: $(DISTFILES)
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done
|
||||
|
||||
MKDEP = $(CC) -M $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
|
||||
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
|
||||
|
||||
-include $(DEP_FILES)
|
||||
-include .deps/.P
|
||||
.deps/.P: $(BUILT_SOURCES)
|
||||
echo > $@
|
||||
|
||||
mostlyclean-depend:
|
||||
|
||||
@@ -439,13 +444,16 @@ distclean-depend:
|
||||
maintainer-clean-depend:
|
||||
-rm -rf .deps
|
||||
|
||||
.deps/%.P: %.c
|
||||
@echo "Computing dependencies for $<..."
|
||||
@o='o'; \
|
||||
test -n "$o" && o='$$o'; \
|
||||
$(MKDEP) $< >$@.tmp \
|
||||
&& sed "s,^\(.*\)\.o:,\1.$$o \1.l$$o $@:," < $@.tmp > $@ \
|
||||
&& rm -f $@.tmp
|
||||
%.o: %.c
|
||||
@echo '$(COMPILE) -c $<'; \
|
||||
$(COMPILE) -Wp,-MD,.deps/$(*F).P -c $<
|
||||
|
||||
%.lo: %.c
|
||||
@echo '$(LTCOMPILE) -c $<'; \
|
||||
$(LTCOMPILE) -Wp,-MD,.deps/$(*F).p -c $<
|
||||
@-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \
|
||||
< .deps/$(*F).p > .deps/$(*F).P
|
||||
@-rm -f .deps/$(*F).p
|
||||
info:
|
||||
dvi:
|
||||
check: all
|
||||
@@ -462,8 +470,6 @@ install: install-exec install-data all
|
||||
|
||||
uninstall:
|
||||
|
||||
all: Makefile $(LIBRARIES) $(HEADERS)
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs:
|
||||
@@ -501,7 +507,7 @@ maintainer-clean: maintainer-clean-noinstLIBRARIES \
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
.PHONY: default mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
|
||||
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
|
||||
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
|
||||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
|
||||
|
||||
32
lib/TODO
Normal file
32
lib/TODO
Normal file
@@ -0,0 +1,32 @@
|
||||
Things to do to hash.c:
|
||||
|
||||
Always use curly braces around statements in if/else/while/do/etc.
|
||||
that span more than a line -- even around multiline simple statements
|
||||
or single-line simple statements preceded by a comment line.
|
||||
|
||||
Never have lines longer than 80 chars.
|
||||
|
||||
Remove ^L characters. We don't want/need such crutches.
|
||||
Get a good (smart) pagination filter. I have one (a perl script)
|
||||
that usually does a decent job for me -- I called it something
|
||||
like stdc-print and think I sent you an early verison.
|
||||
|
||||
I don't like the name `cursor'. I much prefer short names
|
||||
like `p' for index variables. I doubt I'll change all of them,
|
||||
but thought you should know why some will probably end up changing.
|
||||
|
||||
#define USE_OBSTACK somewhere
|
||||
|
||||
Fix this comment. Depending on system and application...
|
||||
Mention fragmentation.
|
||||
+#if USE_OBSTACK
|
||||
+ /* Whenever obstacks are used, it is possible to allocate all overflowed
|
||||
+ entries into a single stack, so they all can be freed in a single
|
||||
+ operation. It is not clear if the speedup is worth the trouble. */
|
||||
+ struct obstack entry_stack;
|
||||
+#endif
|
||||
|
||||
|
||||
assert (bucket_limit - bucket == n_buckets) ?
|
||||
|
||||
remove.c: s/done/successful or ok
|
||||
120
lib/alloca.c
120
lib/alloca.c
@@ -22,11 +22,11 @@
|
||||
your main control loop, etc. to force garbage collection. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef emacs
|
||||
#include "blockinput.h"
|
||||
# include "blockinput.h"
|
||||
#endif
|
||||
|
||||
/* If compiling with GCC 2, this file's not needed. */
|
||||
@@ -34,39 +34,41 @@
|
||||
|
||||
/* If someone has defined alloca as a macro,
|
||||
there must be some other way alloca is supposed to work. */
|
||||
#ifndef alloca
|
||||
# ifndef alloca
|
||||
|
||||
#ifdef emacs
|
||||
#ifdef static
|
||||
# ifdef emacs
|
||||
# ifdef static
|
||||
/* actually, only want this if static is defined as ""
|
||||
-- this is for usg, in which emacs must undefine static
|
||||
in order to make unexec workable
|
||||
*/
|
||||
#ifndef STACK_DIRECTION
|
||||
# ifndef STACK_DIRECTION
|
||||
you
|
||||
lose
|
||||
-- must know STACK_DIRECTION at compile-time
|
||||
#endif /* STACK_DIRECTION undefined */
|
||||
#endif /* static */
|
||||
#endif /* emacs */
|
||||
# endif /* STACK_DIRECTION undefined */
|
||||
# endif /* static */
|
||||
# endif /* emacs */
|
||||
|
||||
/* If your stack is a linked list of frames, you have to
|
||||
provide an "address metric" ADDRESS_FUNCTION macro. */
|
||||
|
||||
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
||||
# if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
||||
long i00afunc ();
|
||||
#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
|
||||
#else
|
||||
#define ADDRESS_FUNCTION(arg) &(arg)
|
||||
#endif
|
||||
# define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
|
||||
# else
|
||||
# define ADDRESS_FUNCTION(arg) &(arg)
|
||||
# endif
|
||||
|
||||
#if __STDC__
|
||||
# if __STDC__
|
||||
typedef void *pointer;
|
||||
#else
|
||||
# else
|
||||
typedef char *pointer;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#define NULL 0
|
||||
# ifndef NULL
|
||||
# define NULL 0
|
||||
# endif
|
||||
|
||||
/* Different portions of Emacs need to call different versions of
|
||||
malloc. The Emacs executable needs alloca to call xmalloc, because
|
||||
@@ -78,9 +80,9 @@ typedef char *pointer;
|
||||
|
||||
Callers below should use malloc. */
|
||||
|
||||
#ifndef emacs
|
||||
#define malloc xmalloc
|
||||
#endif
|
||||
# ifndef emacs
|
||||
# define malloc xmalloc
|
||||
# endif
|
||||
extern pointer malloc ();
|
||||
|
||||
/* Define STACK_DIRECTION if you know the direction of stack
|
||||
@@ -91,18 +93,18 @@ extern pointer malloc ();
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
|
||||
#ifndef STACK_DIRECTION
|
||||
#define STACK_DIRECTION 0 /* Direction unknown. */
|
||||
#endif
|
||||
# ifndef STACK_DIRECTION
|
||||
# define STACK_DIRECTION 0 /* Direction unknown. */
|
||||
# endif
|
||||
|
||||
#if STACK_DIRECTION != 0
|
||||
# if STACK_DIRECTION != 0
|
||||
|
||||
#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
|
||||
# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
|
||||
|
||||
#else /* STACK_DIRECTION == 0; need run-time code. */
|
||||
# else /* STACK_DIRECTION == 0; need run-time code. */
|
||||
|
||||
static int stack_dir; /* 1 or -1 once known. */
|
||||
#define STACK_DIR stack_dir
|
||||
# define STACK_DIR stack_dir
|
||||
|
||||
static void
|
||||
find_stack_direction ()
|
||||
@@ -126,7 +128,7 @@ find_stack_direction ()
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* STACK_DIRECTION == 0 */
|
||||
# endif /* STACK_DIRECTION == 0 */
|
||||
|
||||
/* An "alloca header" is used to:
|
||||
(a) chain together all alloca'ed blocks;
|
||||
@@ -135,9 +137,9 @@ find_stack_direction ()
|
||||
It is very important that sizeof(header) agree with malloc
|
||||
alignment chunk size. The following default should work okay. */
|
||||
|
||||
#ifndef ALIGN_SIZE
|
||||
#define ALIGN_SIZE sizeof(double)
|
||||
#endif
|
||||
# ifndef ALIGN_SIZE
|
||||
# define ALIGN_SIZE sizeof(double)
|
||||
# endif
|
||||
|
||||
typedef union hdr
|
||||
{
|
||||
@@ -165,20 +167,20 @@ alloca (size)
|
||||
auto char probe; /* Probes stack depth: */
|
||||
register char *depth = ADDRESS_FUNCTION (probe);
|
||||
|
||||
#if STACK_DIRECTION == 0
|
||||
# if STACK_DIRECTION == 0
|
||||
if (STACK_DIR == 0) /* Unknown growth direction. */
|
||||
find_stack_direction ();
|
||||
#endif
|
||||
# endif
|
||||
|
||||
/* Reclaim garbage, defined as all alloca'd storage that
|
||||
was allocated from deeper in the stack than currently. */
|
||||
was allocated from deeper in the stack than currently. */
|
||||
|
||||
{
|
||||
register header *hp; /* Traverses linked list. */
|
||||
|
||||
#ifdef emacs
|
||||
# ifdef emacs
|
||||
BLOCK_INPUT;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
for (hp = last_alloca_header; hp != NULL;)
|
||||
if ((STACK_DIR > 0 && hp->h.deep > depth)
|
||||
@@ -195,9 +197,9 @@ alloca (size)
|
||||
|
||||
last_alloca_header = hp; /* -> last valid storage. */
|
||||
|
||||
#ifdef emacs
|
||||
# ifdef emacs
|
||||
UNBLOCK_INPUT;
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
|
||||
if (size == 0)
|
||||
@@ -220,15 +222,15 @@ alloca (size)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
||||
# if defined (CRAY) && defined (CRAY_STACKSEG_END)
|
||||
|
||||
#ifdef DEBUG_I00AFUNC
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
# ifdef DEBUG_I00AFUNC
|
||||
# include <stdio.h>
|
||||
# endif
|
||||
|
||||
#ifndef CRAY_STACK
|
||||
#define CRAY_STACK
|
||||
#ifndef CRAY2
|
||||
# ifndef CRAY_STACK
|
||||
# define CRAY_STACK
|
||||
# ifndef CRAY2
|
||||
/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
|
||||
struct stack_control_header
|
||||
{
|
||||
@@ -280,7 +282,7 @@ struct stack_segment_linkage
|
||||
long sss7;
|
||||
};
|
||||
|
||||
#else /* CRAY2 */
|
||||
# else /* CRAY2 */
|
||||
/* The following structure defines the vector of words
|
||||
returned by the STKSTAT library routine. */
|
||||
struct stk_stat
|
||||
@@ -333,12 +335,12 @@ struct stk_trailer
|
||||
long unknown14;
|
||||
};
|
||||
|
||||
#endif /* CRAY2 */
|
||||
#endif /* not CRAY_STACK */
|
||||
# endif /* CRAY2 */
|
||||
# endif /* not CRAY_STACK */
|
||||
|
||||
#ifdef CRAY2
|
||||
# ifdef CRAY2
|
||||
/* Determine a "stack measure" for an arbitrary ADDRESS.
|
||||
I doubt that "lint" will like this much. */
|
||||
I doubt that "lint" will like this much. */
|
||||
|
||||
static long
|
||||
i00afunc (long *address)
|
||||
@@ -407,7 +409,7 @@ i00afunc (long *address)
|
||||
return (result);
|
||||
}
|
||||
|
||||
#else /* not CRAY2 */
|
||||
# else /* not CRAY2 */
|
||||
/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
|
||||
Determine the number of the cell within the stack,
|
||||
given the address of the cell. The purpose of this
|
||||
@@ -452,9 +454,9 @@ i00afunc (long address)
|
||||
|
||||
while (!(this_segment <= address && address <= stkl))
|
||||
{
|
||||
#ifdef DEBUG_I00AFUNC
|
||||
# ifdef DEBUG_I00AFUNC
|
||||
fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
|
||||
#endif
|
||||
# endif
|
||||
if (pseg == 0)
|
||||
break;
|
||||
stkl = stkl - pseg;
|
||||
@@ -473,9 +475,9 @@ i00afunc (long address)
|
||||
|
||||
while (pseg != 0)
|
||||
{
|
||||
#ifdef DEBUG_I00AFUNC
|
||||
# ifdef DEBUG_I00AFUNC
|
||||
fprintf (stderr, "%011o %011o\n", pseg, size);
|
||||
#endif
|
||||
# endif
|
||||
stkl = stkl - pseg;
|
||||
ssptr = (struct stack_segment_linkage *) stkl;
|
||||
size = ssptr->sssize;
|
||||
@@ -485,8 +487,8 @@ i00afunc (long address)
|
||||
return (result);
|
||||
}
|
||||
|
||||
#endif /* not CRAY2 */
|
||||
#endif /* CRAY */
|
||||
# endif /* not CRAY2 */
|
||||
# endif /* CRAY */
|
||||
|
||||
#endif /* no alloca */
|
||||
# endif /* no alloca */
|
||||
#endif /* not GCC version 2 */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* backupfile.c -- make Emacs style backup file names
|
||||
Copyright (C) 1990,1991,1992,1993,1995,1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990-1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -74,7 +74,7 @@ char *malloc ();
|
||||
# include <limits.h>
|
||||
#endif
|
||||
#ifndef CHAR_BIT
|
||||
#define CHAR_BIT 8
|
||||
# define CHAR_BIT 8
|
||||
#endif
|
||||
/* Upper bound on the string length of an integer converted to string.
|
||||
302 / 1000 is ceil (log10 (2.0)). Subtract 1 for the sign bit;
|
||||
@@ -97,15 +97,12 @@ char *malloc ();
|
||||
# define REAL_DIR_ENTRY(dp) 1
|
||||
#endif
|
||||
|
||||
/* Which type of backup file names are generated. */
|
||||
enum backup_type backup_type = none;
|
||||
|
||||
/* The extension added to file names to produce a simple (as opposed
|
||||
to numbered) backup file name. */
|
||||
const char *simple_backup_suffix = ".orig";
|
||||
const char *simple_backup_suffix = "~";
|
||||
|
||||
static int max_backup_version __BACKUPFILE_P ((const char *, const char *));
|
||||
static int version_number __BACKUPFILE_P ((const char *, const char *, size_t));
|
||||
static int max_backup_version PARAMS ((const char *, const char *));
|
||||
static int version_number PARAMS ((const char *, const char *, size_t));
|
||||
|
||||
/* Return the name of the new backup file for file FILE,
|
||||
allocated with malloc. Return 0 if out of memory.
|
||||
@@ -113,8 +110,7 @@ static int version_number __BACKUPFILE_P ((const char *, const char *, size_t));
|
||||
Do not call this function if backup_type == none. */
|
||||
|
||||
char *
|
||||
find_backup_file_name (file)
|
||||
const char *file;
|
||||
find_backup_file_name (const char *file, enum backup_type backup_type)
|
||||
{
|
||||
size_t backup_suffix_size_max;
|
||||
size_t file_len = strlen (file);
|
||||
@@ -163,9 +159,7 @@ find_backup_file_name (file)
|
||||
*/
|
||||
|
||||
static int
|
||||
max_backup_version (file, dir)
|
||||
const char *file;
|
||||
const char *dir;
|
||||
max_backup_version (const char *file, const char *dir)
|
||||
{
|
||||
DIR *dirp;
|
||||
struct dirent *dp;
|
||||
@@ -199,10 +193,7 @@ max_backup_version (file, dir)
|
||||
*/
|
||||
|
||||
static int
|
||||
version_number (base, backup, base_length)
|
||||
const char *base;
|
||||
const char *backup;
|
||||
size_t base_length;
|
||||
version_number (const char *base, const char *backup, size_t base_length)
|
||||
{
|
||||
int version;
|
||||
const char *p;
|
||||
@@ -235,8 +226,7 @@ static const enum backup_type backup_types[] =
|
||||
Unique abbreviations are accepted. */
|
||||
|
||||
enum backup_type
|
||||
get_version (version)
|
||||
const char *version;
|
||||
get_version (const char *version)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* backupfile.h -- declarations for making Emacs style backup file names
|
||||
Copyright (C) 1990, 1991, 1992, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1991, 1992, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -33,18 +33,23 @@ enum backup_type
|
||||
numbered
|
||||
};
|
||||
|
||||
extern enum backup_type backup_type;
|
||||
#define VALID_BACKUP_TYPE(Type) \
|
||||
((Type) == none \
|
||||
|| (Type) == simple \
|
||||
|| (Type) == numbered_existing \
|
||||
|| (Type) == numbered)
|
||||
|
||||
extern char const *simple_backup_suffix;
|
||||
|
||||
#ifndef __BACKUPFILE_P
|
||||
# if defined __STDC__ || __GNUC__
|
||||
# define __BACKUPFILE_P(args) args
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define __BACKUPFILE_P(args) ()
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
char *base_name __BACKUPFILE_P ((char const *));
|
||||
char *find_backup_file_name __BACKUPFILE_P ((char const *));
|
||||
enum backup_type get_version __BACKUPFILE_P ((char const *));
|
||||
void addext __BACKUPFILE_P ((char *, char const *, int));
|
||||
char *base_name PARAMS ((char const *));
|
||||
char *find_backup_file_name PARAMS ((char const *, enum backup_type));
|
||||
enum backup_type get_version PARAMS ((char const *));
|
||||
void addext PARAMS ((char *, char const *, int));
|
||||
|
||||
@@ -1,15 +1,30 @@
|
||||
/* basename.c -- return the last element in a path */
|
||||
/* basename.c -- return the last element in a path
|
||||
Copyright (C) 1990, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef FILESYSTEM_PREFIX_LEN
|
||||
# define FILESYSTEM_PREFIX_LEN(f) 0
|
||||
# define FILESYSTEM_PREFIX_LEN(Filename) 0
|
||||
#endif
|
||||
|
||||
#ifndef ISSLASH
|
||||
# define ISSLASH(c) ((c) == '/')
|
||||
# define ISSLASH(C) ((C) == '/')
|
||||
#endif
|
||||
|
||||
/* In general, we can't use the builtin `basename' function if available,
|
||||
@@ -17,8 +32,7 @@
|
||||
In some environments the builtin `basename' modifies its argument. */
|
||||
|
||||
char *
|
||||
base_name (name)
|
||||
char const *name;
|
||||
base_name (char const *name)
|
||||
{
|
||||
char const *base = name += FILESYSTEM_PREFIX_LEN (name);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
# define _(Text) Text
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#ifndef EXIT_FAILURE
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* dirname.c -- return all but the last element in a path
|
||||
Copyright (C) 1990 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -15,22 +15,22 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
char *malloc ();
|
||||
#endif
|
||||
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
|
||||
#include <string.h>
|
||||
#if defined STDC_HEADERS || defined HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
#ifndef strrchr
|
||||
#define strrchr rindex
|
||||
#endif
|
||||
# include <strings.h>
|
||||
# ifndef strrchr
|
||||
# define strrchr rindex
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Return the leading directories part of PATH,
|
||||
|
||||
89
lib/error.c
89
lib/error.c
@@ -1,23 +1,27 @@
|
||||
/* error.c -- error handler for noninteractive utilities
|
||||
Copyright (C) 1990, 91, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
/* Error handler for noninteractive utilities
|
||||
Copyright (C) 1990,91,92,93,94,95,96,97,98 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
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 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 Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -43,13 +47,12 @@
|
||||
void exit ();
|
||||
#endif
|
||||
|
||||
#include "error.h"
|
||||
|
||||
#ifndef _
|
||||
# define _(String) String
|
||||
#endif
|
||||
|
||||
/* Get prototypes for the functions defined here. */
|
||||
#include <error.h>
|
||||
|
||||
/* If NULL, error will flush stdout, then print on stderr the program
|
||||
name, a colon and a space. Otherwise, error will call this
|
||||
function without parameters instead. */
|
||||
@@ -68,17 +71,25 @@ unsigned int error_message_count;
|
||||
# define program_name program_invocation_name
|
||||
# include <errno.h>
|
||||
|
||||
/* In GNU libc we want do not want to use the common name `error' directly.
|
||||
Instead make it a weak alias. */
|
||||
# define error __error
|
||||
# define error_at_line __error_at_line
|
||||
|
||||
#else /* not _LIBC */
|
||||
|
||||
/* The calling program should define program_name and set it to the
|
||||
name of the executing program. */
|
||||
extern char *program_name;
|
||||
|
||||
# if HAVE_STRERROR
|
||||
# ifndef strerror /* On some systems, strerror is a macro */
|
||||
char *strerror ();
|
||||
# endif
|
||||
# ifdef HAVE_STRERROR_R
|
||||
# define __strerror_r strerror_r
|
||||
# else
|
||||
# if HAVE_STRERROR
|
||||
# ifndef strerror /* On some systems, strerror is a macro */
|
||||
char *strerror ();
|
||||
# endif
|
||||
# else
|
||||
static char *
|
||||
private_strerror (errnum)
|
||||
int errnum;
|
||||
@@ -87,12 +98,12 @@ private_strerror (errnum)
|
||||
extern int sys_nerr;
|
||||
|
||||
if (errnum > 0 && errnum <= sys_nerr)
|
||||
return sys_errlist[errnum];
|
||||
return _(sys_errlist[errnum]);
|
||||
return _("Unknown system error");
|
||||
}
|
||||
# define strerror private_strerror
|
||||
# endif /* HAVE_STRERROR */
|
||||
|
||||
# define strerror private_strerror
|
||||
# endif /* HAVE_STRERROR */
|
||||
# endif /* HAVE_STRERROR_R */
|
||||
#endif /* not _LIBC */
|
||||
|
||||
/* Print the program name and error message MESSAGE, which is a printf-style
|
||||
@@ -102,7 +113,7 @@ private_strerror (errnum)
|
||||
/* VARARGS */
|
||||
|
||||
void
|
||||
#if defined(VA_START) && __STDC__
|
||||
#if defined VA_START && __STDC__
|
||||
error (int status, int errnum, const char *message, ...)
|
||||
#else
|
||||
error (status, errnum, message, va_alist)
|
||||
@@ -138,7 +149,14 @@ error (status, errnum, message, va_alist)
|
||||
|
||||
++error_message_count;
|
||||
if (errnum)
|
||||
fprintf (stderr, ": %s", strerror (errnum));
|
||||
{
|
||||
#if defined HAVE_STRERROR_R || defined _LIBC
|
||||
char errbuf[1024];
|
||||
fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf));
|
||||
#else
|
||||
fprintf (stderr, ": %s", strerror (errnum));
|
||||
#endif
|
||||
}
|
||||
putc ('\n', stderr);
|
||||
fflush (stderr);
|
||||
if (status)
|
||||
@@ -150,7 +168,7 @@ error (status, errnum, message, va_alist)
|
||||
int error_one_per_line;
|
||||
|
||||
void
|
||||
#if defined(VA_START) && __STDC__
|
||||
#if defined VA_START && __STDC__
|
||||
error_at_line (int status, int errnum, const char *file_name,
|
||||
unsigned int line_number, const char *message, ...)
|
||||
#else
|
||||
@@ -206,9 +224,24 @@ error_at_line (status, errnum, file_name, line_number, message, va_alist)
|
||||
|
||||
++error_message_count;
|
||||
if (errnum)
|
||||
fprintf (stderr, ": %s", strerror (errnum));
|
||||
{
|
||||
#if defined HAVE_STRERROR_R || defined _LIBC
|
||||
char errbuf[1024];
|
||||
fprintf (stderr, ": %s", __strerror_r (errnum, errbuf, sizeof errbuf));
|
||||
#else
|
||||
fprintf (stderr, ": %s", strerror (errnum));
|
||||
#endif
|
||||
}
|
||||
putc ('\n', stderr);
|
||||
fflush (stderr);
|
||||
if (status)
|
||||
exit (status);
|
||||
}
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Make the weak alias. */
|
||||
# undef error
|
||||
# undef error_at_line
|
||||
weak_alias (__error, error)
|
||||
weak_alias (__error_at_line, error_at_line)
|
||||
#endif
|
||||
|
||||
57
lib/error.h
57
lib/error.h
@@ -1,10 +1,14 @@
|
||||
/* error.h -- declaration for error-reporting function
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Declaration for error-reporting function
|
||||
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
This program is 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
|
||||
@@ -12,26 +16,31 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
#ifndef ERROR_H_
|
||||
# define ERROR_H_
|
||||
#ifndef _ERROR_H
|
||||
#define _ERROR_H 1
|
||||
|
||||
# ifndef __attribute__
|
||||
#ifndef __attribute__
|
||||
/* This feature is available in gcc versions 2.5 and later. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
||||
# define __attribute__(Spec) /* empty */
|
||||
# endif
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
||||
# define __attribute__(Spec) /* empty */
|
||||
# endif
|
||||
/* The __-protected variants of `format' and `printf' attributes
|
||||
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||
# define __format__ format
|
||||
# define __printf__ printf
|
||||
# endif
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||
# define __format__ format
|
||||
# define __printf__ printf
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# if defined (__STDC__) && __STDC__
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
|
||||
/* Print a message with `fprintf (stderr, FORMAT, ...)';
|
||||
if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
|
||||
@@ -49,11 +58,11 @@ extern void error_at_line (int status, int errnum, const char *fname,
|
||||
function without parameters instead. */
|
||||
extern void (*error_print_progname) (void);
|
||||
|
||||
# else
|
||||
#else
|
||||
void error ();
|
||||
void error_at_line ();
|
||||
extern void (*error_print_progname) ();
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* This variable is incremented each time `error' is called. */
|
||||
extern unsigned int error_message_count;
|
||||
@@ -62,4 +71,8 @@ extern unsigned int error_message_count;
|
||||
variable controls whether this mode is selected or not. */
|
||||
extern int error_one_per_line;
|
||||
|
||||
#endif /* not ERROR_H_ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* error.h */
|
||||
|
||||
@@ -21,7 +21,7 @@ Suite 330, Boston, MA 02111-1307, USA. */
|
||||
/* Written by David MacKenzie and Torbjorn Granlund.
|
||||
Adapted for GNU C library by Roland McGrath. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -111,7 +111,7 @@ static gid_t egid;
|
||||
/* Nonzero if UID, GID, EUID, and EGID have valid values. */
|
||||
static int have_ids = 0;
|
||||
|
||||
# ifdef HAVE_GETGROUPS
|
||||
# if HAVE_GETGROUPS
|
||||
int group_member ();
|
||||
# else
|
||||
# define group_member(gid) 0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Convert file size to number of blocks on System V-like machines.
|
||||
Copyright (C) 1990, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -17,22 +17,31 @@
|
||||
|
||||
/* Written by Brian L. Matthews, blm@6sceng.UUCP. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if !HAVE_ST_BLOCKS && !defined _POSIX_SOURCE && defined BSIZE
|
||||
# include <sys/types.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#if !HAVE_ST_BLOCKS && !defined _POSIX_SOURCE && defined BSIZE
|
||||
|
||||
# if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
# endif
|
||||
|
||||
# ifndef NINDIR
|
||||
|
||||
# if defined (__DJGPP__)
|
||||
typedef long daddr_t; /* for disk address */
|
||||
# endif
|
||||
|
||||
/* Some SysV's, like Irix, seem to lack this. Hope it's correct. */
|
||||
/* Number of inode pointers per indirect block. */
|
||||
# define NINDIR (BSIZE/sizeof(daddr_t))
|
||||
# define NINDIR (BSIZE / sizeof (daddr_t))
|
||||
# endif /* !NINDIR */
|
||||
|
||||
/* Number of direct block addresses in an inode. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* filemode.c -- make a string describing file modes
|
||||
Copyright (C) 1985, 1990, 1993 Free Software Foundation, Inc.
|
||||
Copyright (C) 1985, 1990, 1993, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -15,8 +15,8 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -47,45 +47,45 @@
|
||||
#endif
|
||||
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
#undef S_ISBLK
|
||||
#undef S_ISCHR
|
||||
#undef S_ISDIR
|
||||
#undef S_ISFIFO
|
||||
#undef S_ISLNK
|
||||
#undef S_ISMPB
|
||||
#undef S_ISMPC
|
||||
#undef S_ISNWK
|
||||
#undef S_ISREG
|
||||
#undef S_ISSOCK
|
||||
# undef S_ISBLK
|
||||
# undef S_ISCHR
|
||||
# undef S_ISDIR
|
||||
# undef S_ISFIFO
|
||||
# undef S_ISLNK
|
||||
# undef S_ISMPB
|
||||
# undef S_ISMPC
|
||||
# undef S_ISNWK
|
||||
# undef S_ISREG
|
||||
# undef S_ISSOCK
|
||||
#endif /* STAT_MACROS_BROKEN. */
|
||||
|
||||
#if !defined(S_ISBLK) && defined(S_IFBLK)
|
||||
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
||||
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
||||
#endif
|
||||
#if !defined(S_ISCHR) && defined(S_IFCHR)
|
||||
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
||||
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
||||
#endif
|
||||
#if !defined(S_ISDIR) && defined(S_IFDIR)
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
#if !defined(S_ISREG) && defined(S_IFREG)
|
||||
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
#endif
|
||||
#if !defined(S_ISFIFO) && defined(S_IFIFO)
|
||||
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
||||
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
||||
#endif
|
||||
#if !defined(S_ISLNK) && defined(S_IFLNK)
|
||||
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
||||
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
||||
#endif
|
||||
#if !defined(S_ISSOCK) && defined(S_IFSOCK)
|
||||
#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
|
||||
# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
|
||||
#endif
|
||||
#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
|
||||
#define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
|
||||
#define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
|
||||
# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
|
||||
# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
|
||||
#endif
|
||||
#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
|
||||
#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
|
||||
# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
|
||||
#endif
|
||||
|
||||
void mode_string ();
|
||||
|
||||
@@ -1,37 +1,52 @@
|
||||
/* Copyright (C) 1991, 1992, 1993, 1997 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1992, 1993, 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C
|
||||
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* Enable GNU extensions in fnmatch.h. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <fnmatch.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if defined (STDC_HEADERS) || !defined (isascii)
|
||||
# define ISASCII(c) 1
|
||||
#else
|
||||
# define ISASCII(c) isascii(c)
|
||||
#endif
|
||||
|
||||
#define ISUPPER(c) (ISASCII (c) && isupper (c))
|
||||
/* Comment out all this code if we are using the GNU C Library, and are not
|
||||
actually compiling the library itself. This code is part of the GNU C
|
||||
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__
|
||||
|
||||
|
||||
# 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
|
||||
extern int errno;
|
||||
@@ -49,7 +64,7 @@ fnmatch (pattern, string, 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 (c) ? tolower (c) : (c))
|
||||
|
||||
while ((c = *p++) != '\0')
|
||||
{
|
||||
@@ -71,6 +86,9 @@ fnmatch (pattern, string, flags)
|
||||
if (!(flags & FNM_NOESCAPE))
|
||||
{
|
||||
c = *p++;
|
||||
if (c == '\0')
|
||||
/* Trailing \ loses. */
|
||||
return FNM_NOMATCH;
|
||||
c = FOLD (c);
|
||||
}
|
||||
if (FOLD (*n) != c)
|
||||
@@ -82,10 +100,24 @@ fnmatch (pattern, string, flags)
|
||||
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
|
||||
return FNM_NOMATCH;
|
||||
|
||||
for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
|
||||
if (((flags & FNM_FILE_NAME) && *n == '/') ||
|
||||
(c == '?' && *n == '\0'))
|
||||
return FNM_NOMATCH;
|
||||
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 == '?')
|
||||
{
|
||||
/* A ? needs to match one character. */
|
||||
if (*n == '\0')
|
||||
/* There isn't another character; no match. */
|
||||
return FNM_NOMATCH;
|
||||
else
|
||||
/* One character of the string is consumed in matching
|
||||
this ? wildcard, so *??? won't match if there are
|
||||
less than three characters. */
|
||||
++n;
|
||||
}
|
||||
}
|
||||
|
||||
if (c == '\0')
|
||||
return 0;
|
||||
@@ -122,7 +154,11 @@ fnmatch (pattern, string, flags)
|
||||
register char cstart = c, cend = c;
|
||||
|
||||
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||
cstart = cend = *p++;
|
||||
{
|
||||
if (*p == '\0')
|
||||
return FNM_NOMATCH;
|
||||
cstart = cend = *p++;
|
||||
}
|
||||
|
||||
cstart = cend = FOLD (cstart);
|
||||
|
||||
@@ -169,8 +205,12 @@ fnmatch (pattern, string, flags)
|
||||
|
||||
c = *p++;
|
||||
if (!(flags & FNM_NOESCAPE) && c == '\\')
|
||||
/* XXX 1003.2d11 is unclear if this is right. */
|
||||
++p;
|
||||
{
|
||||
if (*p == '\0')
|
||||
return FNM_NOMATCH;
|
||||
/* XXX 1003.2d11 is unclear if this is right. */
|
||||
++p;
|
||||
}
|
||||
}
|
||||
if (not)
|
||||
return FNM_NOMATCH;
|
||||
@@ -196,3 +236,5 @@ fnmatch (pattern, string, flags)
|
||||
|
||||
# undef FOLD
|
||||
}
|
||||
|
||||
#endif /* _LIBC or not __GNU_LIBRARY__. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* fsusage.c -- return space usage of mounted filesystems
|
||||
Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1991, 1992, 1996, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -26,6 +26,13 @@
|
||||
#include <sys/stat.h>
|
||||
#include "fsusage.h"
|
||||
|
||||
#if HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
#ifndef CHAR_BIT
|
||||
# define CHAR_BIT 8
|
||||
#endif
|
||||
|
||||
int statfs ();
|
||||
|
||||
#if HAVE_SYS_PARAM_H
|
||||
@@ -65,6 +72,25 @@ int statfs ();
|
||||
int statvfs ();
|
||||
#endif
|
||||
|
||||
/* Many space usage primitives use all 1 bits to denote a value that is
|
||||
not applicable or unknown. Propagate this information by returning
|
||||
a uintmax_t value that is all 1 bits if the argument is all 1 bits,
|
||||
even if the argument is unsigned and smaller than uintmax_t. */
|
||||
#define PROPAGATE_ALL_ONES(x) ((x) == -1 ? (uintmax_t) -1 : (uintmax_t) (x))
|
||||
|
||||
/* Extract the top bit of X as an uintmax_t value. */
|
||||
#define EXTRACT_TOP_BIT(x) ((x) \
|
||||
& ((uintmax_t) 1 << (sizeof (x) * CHAR_BIT - 1)))
|
||||
|
||||
/* If a value is negative, many space usage primitives store it into an
|
||||
integer variable by assignment, even if the variable's type is unsigned.
|
||||
So, if a space usage variable X's top bit is set, convert X to the
|
||||
uintmax_t value V such that (- (uintmax_t) V) is the negative of
|
||||
the original value. If X's top bit is clear, just yield X.
|
||||
Use PROPAGATE_TOP_BIT if the original value might be negative;
|
||||
otherwise, use PROPAGATE_ALL_ONES. */
|
||||
#define PROPAGATE_TOP_BIT(x) ((x) | ~ (EXTRACT_TOP_BIT (x) - 1))
|
||||
|
||||
int safe_read ();
|
||||
|
||||
/* Fill in the fields of FSP with information about space usage for
|
||||
@@ -87,7 +113,7 @@ get_fs_usage (path, disk, fsp)
|
||||
if (statfs (path, &fsd, sizeof (struct statfs)) != 0)
|
||||
return -1;
|
||||
|
||||
fsp->fsu_blocksize = fsd.f_fsize;
|
||||
fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize);
|
||||
|
||||
#endif /* STAT_STATFS3_OSF1 */
|
||||
|
||||
@@ -99,11 +125,12 @@ get_fs_usage (path, disk, fsp)
|
||||
return -1;
|
||||
|
||||
fsp->fsu_blocksize = 1024;
|
||||
fsp->fsu_blocks = fsd.fd_req.btot;
|
||||
fsp->fsu_bfree = fsd.fd_req.bfree;
|
||||
fsp->fsu_bavail = fsd.fd_req.bfreen;
|
||||
fsp->fsu_files = fsd.fd_req.gtot;
|
||||
fsp->fsu_ffree = fsd.fd_req.gfree;
|
||||
fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.fd_req.btot);
|
||||
fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.fd_req.bfree);
|
||||
fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.fd_req.bfreen);
|
||||
fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.fd_req.bfreen) != 0;
|
||||
fsp->fsu_files = PROPAGATE_ALL_ONES (fsd.fd_req.gtot);
|
||||
fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.fd_req.gfree);
|
||||
|
||||
#endif /* STAT_STATFS2_FS_DATA */
|
||||
|
||||
@@ -132,12 +159,15 @@ get_fs_usage (path, disk, fsp)
|
||||
}
|
||||
close (fd);
|
||||
|
||||
fsp->fsu_blocksize = fsd.s_type == Fs2b ? 1024 : 512;
|
||||
fsp->fsu_blocks = fsd.s_fsize;
|
||||
fsp->fsu_bfree = fsd.s_tfree;
|
||||
fsp->fsu_bavail = fsd.s_tfree;
|
||||
fsp->fsu_files = (fsd.s_isize - 2) * INOPB * (fsd.s_type == Fs2b ? 2 : 1);
|
||||
fsp->fsu_ffree = fsd.s_tinode;
|
||||
fsp->fsu_blocksize = (fsd.s_type == Fs2b ? 1024 : 512);
|
||||
fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.s_fsize);
|
||||
fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.s_tfree);
|
||||
fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.s_tfree);
|
||||
fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.s_tfree) != 0;
|
||||
fsp->fsu_files = (fsd.s_isize == -1
|
||||
? (uintmax_t) -1
|
||||
: (fsd.s_isize - 2) * INOPB * (fsd.s_type == Fs2b ? 2 : 1));
|
||||
fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.s_tinode);
|
||||
|
||||
#endif /* STAT_READ_FILSYS */
|
||||
|
||||
@@ -148,7 +178,7 @@ get_fs_usage (path, disk, fsp)
|
||||
if (statfs (path, &fsd) < 0)
|
||||
return -1;
|
||||
|
||||
fsp->fsu_blocksize = fsd.f_bsize;
|
||||
fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_bsize);
|
||||
|
||||
# ifdef STATFS_TRUNCATES_BLOCK_COUNTS
|
||||
|
||||
@@ -174,7 +204,7 @@ get_fs_usage (path, disk, fsp)
|
||||
if (statfs (path, &fsd) < 0)
|
||||
return -1;
|
||||
|
||||
fsp->fsu_blocksize = fsd.f_fsize;
|
||||
fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize);
|
||||
|
||||
#endif /* STAT_STATFS2_FSIZE */
|
||||
|
||||
@@ -193,7 +223,7 @@ get_fs_usage (path, disk, fsp)
|
||||
systems seem to always be in terms of 512-byte blocks,
|
||||
no matter what value f_bsize has. */
|
||||
# if _AIX || defined(_CRAY)
|
||||
fsp->fsu_blocksize = fsd.f_bsize;
|
||||
fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_bsize);
|
||||
# else
|
||||
fsp->fsu_blocksize = 512;
|
||||
# endif
|
||||
@@ -208,18 +238,20 @@ get_fs_usage (path, disk, fsp)
|
||||
return -1;
|
||||
|
||||
/* f_frsize isn't guaranteed to be supported. */
|
||||
fsp->fsu_blocksize = fsd.f_frsize ? fsd.f_frsize : fsd.f_bsize;
|
||||
fsp->fsu_blocksize =
|
||||
PROPAGATE_ALL_ONES (fsd.f_frsize ? fsd.f_frsize : fsd.f_bsize);
|
||||
|
||||
#endif /* STAT_STATVFS */
|
||||
|
||||
#if !defined(STAT_STATFS2_FS_DATA) && !defined(STAT_READ_FILSYS)
|
||||
/* !Ultrix && !SVR2 */
|
||||
|
||||
fsp->fsu_blocks = fsd.f_blocks;
|
||||
fsp->fsu_bfree = fsd.f_bfree;
|
||||
fsp->fsu_bavail = fsd.f_bavail;
|
||||
fsp->fsu_files = fsd.f_files;
|
||||
fsp->fsu_ffree = fsd.f_ffree;
|
||||
fsp->fsu_blocks = PROPAGATE_ALL_ONES (fsd.f_blocks);
|
||||
fsp->fsu_bfree = PROPAGATE_ALL_ONES (fsd.f_bfree);
|
||||
fsp->fsu_bavail = PROPAGATE_TOP_BIT (fsd.f_bavail);
|
||||
fsp->fsu_bavail_top_bit_set = EXTRACT_TOP_BIT (fsd.f_bavail) != 0;
|
||||
fsp->fsu_files = PROPAGATE_ALL_ONES (fsd.f_files);
|
||||
fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.f_ffree);
|
||||
|
||||
#endif /* not STAT_STATFS2_FS_DATA && not STAT_READ_FILSYS */
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ struct fs_usage
|
||||
uintmax_t fsu_blocks; /* Total blocks. */
|
||||
uintmax_t fsu_bfree; /* Free blocks available to superuser. */
|
||||
uintmax_t fsu_bavail; /* Free blocks available to non-superuser. */
|
||||
int fsu_bavail_top_bit_set; /* 1 if fsu_bavail represents a value < 0. */
|
||||
uintmax_t fsu_files; /* Total file nodes. */
|
||||
uintmax_t fsu_ffree; /* Free file nodes. */
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/* ftruncate emulations that work on some System V's.
|
||||
This file is in the public domain. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -19,15 +19,15 @@ ftruncate (fd, length)
|
||||
}
|
||||
|
||||
#else /* not F_CHSIZE */
|
||||
#ifdef F_FREESP
|
||||
# ifdef F_FREESP
|
||||
|
||||
/* By William Kucharski <kucharsk@netcom.com>. */
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
# include <sys/stat.h>
|
||||
# include <errno.h>
|
||||
# if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
# endif
|
||||
|
||||
int
|
||||
ftruncate (fd, length)
|
||||
@@ -71,8 +71,8 @@ ftruncate (fd, length)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else /* not F_CHSIZE nor F_FREESP */
|
||||
#ifdef HAVE_CHSIZE
|
||||
# else /* not F_CHSIZE nor F_FREESP */
|
||||
# if HAVE_CHSIZE
|
||||
|
||||
int
|
||||
ftruncate (fd, length)
|
||||
@@ -82,12 +82,12 @@ ftruncate (fd, length)
|
||||
return chsize (fd, length);
|
||||
}
|
||||
|
||||
#else /* not F_CHSIZE nor F_FREESP nor HAVE_CHSIZE */
|
||||
# else /* not F_CHSIZE nor F_FREESP nor HAVE_CHSIZE */
|
||||
|
||||
#include <errno.h>
|
||||
#ifndef errno
|
||||
# include <errno.h>
|
||||
# ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
int
|
||||
ftruncate (fd, length)
|
||||
@@ -98,6 +98,6 @@ ftruncate (fd, length)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif /* not HAVE_CHSIZE */
|
||||
#endif /* not F_FREESP */
|
||||
# endif /* not HAVE_CHSIZE */
|
||||
# endif /* not F_FREESP */
|
||||
#endif /* not F_CHSIZE */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* full-write.c -- an interface to write that retries after interrupts
|
||||
Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 1994, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -37,10 +37,7 @@ extern int errno;
|
||||
Return LEN upon success, write's (negative) error code otherwise. */
|
||||
|
||||
int
|
||||
full_write (desc, ptr, len)
|
||||
int desc;
|
||||
char *ptr;
|
||||
size_t len;
|
||||
full_write (int desc, const char *ptr, size_t len)
|
||||
{
|
||||
int total_written;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -14,28 +14,28 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(args) args
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(args) ()
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined (vms)
|
||||
#ifdef vms
|
||||
# include <types.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# include <sys/types.h>
|
||||
# ifdef TIME_WITH_SYS_TIME
|
||||
# if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
# else
|
||||
# ifdef HAVE_SYS_TIME_H
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
** a couple of people on Usenet. Completely overhauled by Rich $alz
|
||||
** <rsalz@bbn.com> and Jim Berets <jberets@bbn.com> in August, 1990.
|
||||
**
|
||||
** This grammar has 13 shift/reduce conflicts.
|
||||
**
|
||||
** This code is in the public domain and has no copyright.
|
||||
*/
|
||||
|
||||
@@ -51,8 +49,6 @@
|
||||
host does not conform to Posix. */
|
||||
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
|
||||
|
||||
#include "getdate.h"
|
||||
|
||||
#if defined (STDC_HEADERS) || defined (USG)
|
||||
# include <string.h>
|
||||
#endif
|
||||
@@ -64,10 +60,6 @@
|
||||
# define bcopy(from, to, len) memcpy ((to), (from), (len))
|
||||
#endif
|
||||
|
||||
extern struct tm *gmtime ();
|
||||
extern struct tm *localtime ();
|
||||
extern time_t mktime ();
|
||||
|
||||
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
|
||||
as well as gratuitiously global symbol names, so we can have multiple
|
||||
yacc generated parsers in the same program. Note that these are only
|
||||
@@ -172,6 +164,9 @@ static int yyRelYear;
|
||||
|
||||
%}
|
||||
|
||||
/* This grammar has 13 shift/reduce conflicts. */
|
||||
%expect 13
|
||||
|
||||
%union {
|
||||
int Number;
|
||||
enum _MERIDIAN Meridian;
|
||||
@@ -441,6 +436,15 @@ o_merid : /* NULL */
|
||||
|
||||
%%
|
||||
|
||||
/* Include this file down here because bison inserts code above which
|
||||
may define-away `const'. We want the prototype for get_date to have
|
||||
the same signature as the function definition does. */
|
||||
#include "getdate.h"
|
||||
|
||||
extern struct tm *gmtime ();
|
||||
extern struct tm *localtime ();
|
||||
extern time_t mktime ();
|
||||
|
||||
/* Month and day table. */
|
||||
static TABLE const MonthDayTable[] = {
|
||||
{ "january", tMONTH, 1 },
|
||||
@@ -886,9 +890,7 @@ difftm (a, b)
|
||||
}
|
||||
|
||||
time_t
|
||||
get_date (p, now)
|
||||
const char *p;
|
||||
const time_t *now;
|
||||
get_date (const char *p, const time_t *now)
|
||||
{
|
||||
struct tm tm, tm0, *tmp;
|
||||
time_t Start;
|
||||
|
||||
22
lib/getopt.c
22
lib/getopt.c
@@ -701,16 +701,18 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
else
|
||||
{
|
||||
if (opterr)
|
||||
if (argv[optind - 1][1] == '-')
|
||||
/* --option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `--%s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
else
|
||||
/* +option or -option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `%c%s' doesn't allow an argument\n"),
|
||||
argv[0], argv[optind - 1][0], pfound->name);
|
||||
{
|
||||
if (argv[optind - 1][1] == '-')
|
||||
/* --option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `--%s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
else
|
||||
/* +option or -option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `%c%s' doesn't allow an argument\n"),
|
||||
argv[0], argv[optind - 1][0], pfound->name);
|
||||
}
|
||||
|
||||
nextchar += strlen (nextchar);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* getugroups.c -- return a list of the groups a user is in
|
||||
Copyright (C) 1990, 1991 Free Software Foundation.
|
||||
Copyright (C) 1990, 1991, 1998 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
|
||||
@@ -45,10 +45,7 @@ struct group *getgrent ();
|
||||
the current process. */
|
||||
|
||||
int
|
||||
getugroups (maxcount, grouplist, username)
|
||||
int maxcount;
|
||||
GETGROUPS_T *grouplist;
|
||||
char *username;
|
||||
getugroups (int maxcount, GETGROUPS_T *grouplist, char *username)
|
||||
{
|
||||
struct group *grp;
|
||||
register char **cp;
|
||||
@@ -59,16 +56,27 @@ getugroups (maxcount, grouplist, username)
|
||||
for (cp = grp->gr_mem; *cp; ++cp)
|
||||
if (!strcmp (username, *cp))
|
||||
{
|
||||
if (maxcount != 0)
|
||||
int n;
|
||||
|
||||
/* See if this group number is already on the list. */
|
||||
for (n = 0; n < count; ++n)
|
||||
if (grouplist[n] == grp->gr_gid)
|
||||
break;
|
||||
|
||||
/* If it's a new group number, then try to add it to the list. */
|
||||
if (n == count)
|
||||
{
|
||||
if (count >= maxcount)
|
||||
if (maxcount != 0)
|
||||
{
|
||||
endgrent ();
|
||||
return count;
|
||||
if (count >= maxcount)
|
||||
{
|
||||
endgrent ();
|
||||
return count;
|
||||
}
|
||||
grouplist[count] = grp->gr_gid;
|
||||
}
|
||||
grouplist[count] = grp->gr_gid;
|
||||
count++;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
endgrent ();
|
||||
return count;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* group-member.c -- determine whether group id is in calling user's group list
|
||||
Copyright (C) 1994, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -15,7 +15,7 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
@@ -41,7 +41,7 @@ struct group_info
|
||||
GETGROUPS_T *group;
|
||||
};
|
||||
|
||||
#ifdef HAVE_GETGROUPS
|
||||
#if HAVE_GETGROUPS
|
||||
|
||||
static void
|
||||
free_group_info (struct group_info *g)
|
||||
|
||||
1409
lib/hash.c
1409
lib/hash.c
File diff suppressed because it is too large
Load Diff
266
lib/hash.h
266
lib/hash.h
@@ -1,193 +1,103 @@
|
||||
#ifndef HASH_H
|
||||
# define HASH_H 1
|
||||
/* hash - hashing table processing.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
Written by Jim Meyering <meyering@ascend.com>, 1998.
|
||||
|
||||
# if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
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. */
|
||||
|
||||
/* A generic hash table package. */
|
||||
|
||||
/* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use
|
||||
obstacks instead of malloc, and recompile `hash.c' with same setting. */
|
||||
|
||||
#ifndef PARAMS
|
||||
# if PROTOTYPES || __STDC__
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# include <stdio.h>
|
||||
# include <assert.h>
|
||||
typedef unsigned int (*Hash_hasher) PARAMS ((const void *, unsigned int));
|
||||
typedef bool (*Hash_comparator) PARAMS ((const void *, const void *));
|
||||
typedef void (*Hash_data_freer) PARAMS ((void *));
|
||||
typedef bool (*Hash_processor) PARAMS ((void *, void *));
|
||||
|
||||
# ifdef STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
# endif
|
||||
|
||||
# ifndef HAVE_DECL_FREE
|
||||
void free ();
|
||||
# endif
|
||||
|
||||
# ifndef HAVE_DECL_MALLOC
|
||||
char *malloc ();
|
||||
# endif
|
||||
|
||||
# ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# define USE_OBSTACK
|
||||
# ifdef USE_OBSTACK
|
||||
# include "obstack.h"
|
||||
# endif
|
||||
|
||||
# define obstack_chunk_alloc malloc
|
||||
# define obstack_chunk_free free
|
||||
|
||||
struct hash_ent
|
||||
struct hash_entry
|
||||
{
|
||||
void *key;
|
||||
struct hash_ent *next;
|
||||
};
|
||||
typedef struct hash_ent HASH_ENT;
|
||||
|
||||
/* This is particularly useful to cast uses in hash_initialize of the
|
||||
system free function. */
|
||||
typedef void (*Hash_key_freer_type) PARAMS((void *key));
|
||||
|
||||
struct HT
|
||||
{
|
||||
/* User-supplied function for freeing keys. It is specified in
|
||||
hash_initialize. If non-null, it is used by hash_free and
|
||||
hash_clear. You should specify `free' here only if you want
|
||||
these functions to free all of your `key' data. This is typically
|
||||
the case when your key is simply an auxilliary struct that you
|
||||
have malloc'd to aggregate several values. */
|
||||
Hash_key_freer_type hash_key_freer;
|
||||
|
||||
/* User-supplied hash function that hashes entry E to an integer
|
||||
in the range 0..TABLE_SIZE-1. */
|
||||
unsigned int (*hash_hash) PARAMS((const void *e, unsigned int table_size));
|
||||
|
||||
/* User-supplied function that determines whether a new entry is
|
||||
unique by comparing the new entry to entries that hashed to the
|
||||
same bucket index. It should return zero for a pair of entries
|
||||
that compare equal, non-zero otherwise. */
|
||||
|
||||
int (*hash_key_comparator) PARAMS((const void *, const void *));
|
||||
|
||||
HASH_ENT **hash_table;
|
||||
unsigned int hash_table_size;
|
||||
unsigned int hash_n_slots_used;
|
||||
unsigned int hash_max_chain_length;
|
||||
|
||||
/* Gets set when an entry is deleted from a chain of length
|
||||
hash_max_chain_length. Indicates that hash_max_chain_length
|
||||
may no longer be valid. */
|
||||
unsigned int hash_dirty_max_chain_length;
|
||||
|
||||
/* Sum of lengths of all chains (not counting any dummy
|
||||
header entries). */
|
||||
unsigned int hash_n_keys;
|
||||
|
||||
/* A linked list of freed HASH_ENT structs.
|
||||
FIXME: Perhaps this is unnecessary and we should simply free
|
||||
and reallocate such structs. */
|
||||
HASH_ENT *hash_free_entry_list;
|
||||
|
||||
/* FIXME: comment. */
|
||||
# ifdef USE_OBSTACK
|
||||
struct obstack ht_obstack;
|
||||
# endif
|
||||
void *data;
|
||||
struct hash_entry *next;
|
||||
};
|
||||
|
||||
typedef struct HT HT;
|
||||
struct hash_table
|
||||
{
|
||||
/* The array of buckets starts at BUCKET and extends to BUCKET_LIMIT-1,
|
||||
for a possibility of N_BUCKETS. Among those, N_BUCKETS_USED buckets
|
||||
are not empty, there are N_ENTRIES active entries in the table. */
|
||||
struct hash_entry *bucket;
|
||||
struct hash_entry *bucket_limit;
|
||||
unsigned int n_buckets;
|
||||
unsigned int n_buckets_used;
|
||||
unsigned int n_entries;
|
||||
|
||||
unsigned int
|
||||
hash_get_n_slots_used PARAMS((const HT *ht));
|
||||
/* Three functions are given to `hash_initialize', see the documentation
|
||||
block for this function. In a word, HASHER randomizes a user entry
|
||||
into a number up from 0 up to some maximum minus 1; COMPARATOR returns
|
||||
true if two user entries compare equally; and DATA_FREER is the cleanup
|
||||
function for a user entry. */
|
||||
Hash_hasher hasher;
|
||||
Hash_comparator comparator;
|
||||
Hash_data_freer data_freer;
|
||||
|
||||
unsigned int
|
||||
hash_get_max_chain_length PARAMS((HT *ht));
|
||||
/* A linked list of freed struct hash_entry structs. */
|
||||
struct hash_entry *free_entry_list;
|
||||
|
||||
int
|
||||
hash_rehash PARAMS((HT *ht, unsigned int new_table_size));
|
||||
#if USE_OBSTACK
|
||||
/* Whenever obstacks are used, it is possible to allocate all overflowed
|
||||
entries into a single stack, so they all can be freed in a single
|
||||
operation. It is not clear if the speedup is worth the trouble. */
|
||||
struct obstack entry_stack;
|
||||
#endif
|
||||
};
|
||||
|
||||
unsigned int
|
||||
hash_get_table_size PARAMS((const HT *ht));
|
||||
typedef struct hash_table Hash_table;
|
||||
|
||||
HT *
|
||||
hash_initialize PARAMS((unsigned int table_size,
|
||||
void (*key_freer) PARAMS((void *key)),
|
||||
unsigned int (*hash) PARAMS((const void *,
|
||||
unsigned int)),
|
||||
int (*equality_tester) PARAMS((const void *,
|
||||
const void *))));
|
||||
/* Information and lookup. */
|
||||
unsigned int hash_get_n_buckets PARAMS ((const Hash_table *));
|
||||
unsigned int hash_get_n_buckets_used PARAMS ((const Hash_table *));
|
||||
unsigned int hash_get_n_entries PARAMS ((const Hash_table *));
|
||||
unsigned int hash_get_max_bucket_length PARAMS ((const Hash_table *));
|
||||
bool hash_table_ok PARAMS ((const Hash_table *));
|
||||
void hash_print_statistics PARAMS ((const Hash_table *, FILE *));
|
||||
void *hash_lookup PARAMS ((const Hash_table *, const void *));
|
||||
|
||||
unsigned int
|
||||
hash_get_n_keys PARAMS((const HT *ht));
|
||||
/* Walking. */
|
||||
void *hash_get_first PARAMS ((const Hash_table *));
|
||||
void *hash_get_next PARAMS ((const Hash_table *, const void *));
|
||||
unsigned int hash_get_entries PARAMS ((const Hash_table *, void **,
|
||||
unsigned int));
|
||||
unsigned int hash_do_for_each PARAMS ((const Hash_table *, Hash_processor,
|
||||
void *));
|
||||
|
||||
int
|
||||
hash_query_in_table PARAMS((const HT *ht, const void *e));
|
||||
/* Allocation and clean-up. */
|
||||
unsigned int hash_string PARAMS ((const char *, unsigned int));
|
||||
Hash_table *hash_initialize PARAMS ((unsigned int, Hash_hasher,
|
||||
Hash_comparator, Hash_data_freer));
|
||||
void hash_clear PARAMS ((Hash_table *));
|
||||
void hash_free PARAMS ((Hash_table *));
|
||||
|
||||
void *
|
||||
hash_lookup PARAMS((const HT *ht, const void *e));
|
||||
|
||||
void *
|
||||
hash_insert_if_absent PARAMS((HT *ht,
|
||||
const void *e,
|
||||
int *failed));
|
||||
|
||||
void *
|
||||
hash_delete_if_present PARAMS((HT *ht, const void *e));
|
||||
|
||||
void
|
||||
hash_print_statistics PARAMS((const HT *ht, FILE *stream));
|
||||
|
||||
int
|
||||
hash_get_statistics PARAMS((const HT *ht, unsigned int *n_slots_used,
|
||||
unsigned int *n_keys,
|
||||
unsigned int *max_chain_length));
|
||||
|
||||
int
|
||||
hash_table_ok PARAMS((HT *ht));
|
||||
|
||||
void
|
||||
hash_do_for_each PARAMS((HT *ht,
|
||||
void (*f) PARAMS((void *e, void *aux)),
|
||||
void *aux));
|
||||
|
||||
int
|
||||
hash_do_for_each_2 PARAMS((HT *ht,
|
||||
int (*f) PARAMS((void *e, void *aux)),
|
||||
void *aux));
|
||||
|
||||
int
|
||||
hash_do_for_each_in_selected_bucket PARAMS((HT *ht,
|
||||
const void *key,
|
||||
int (*f) PARAMS((const void *bucket_key,
|
||||
void *e,
|
||||
void *aux)),
|
||||
void *aux));
|
||||
|
||||
void
|
||||
hash_clear PARAMS((HT *ht));
|
||||
|
||||
void
|
||||
hash_free PARAMS((HT *ht));
|
||||
|
||||
void
|
||||
hash_get_key_list PARAMS((const HT *ht,
|
||||
unsigned int bufsize,
|
||||
void **buf));
|
||||
|
||||
void *
|
||||
hash_get_first PARAMS((const HT *ht));
|
||||
|
||||
void *
|
||||
hash_get_next PARAMS((const HT *ht, const void *e));
|
||||
|
||||
/* This interface to hash_insert_if_absent is used frequently enough to
|
||||
merit a macro here. */
|
||||
|
||||
# define HASH_INSERT_NEW_ITEM(Ht, Item, Failp) \
|
||||
do \
|
||||
{ \
|
||||
void *_already; \
|
||||
_already = hash_insert_if_absent ((Ht), (Item), Failp); \
|
||||
assert (_already == NULL); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#endif /* HASH_H */
|
||||
/* Insertion and deletion. */
|
||||
bool hash_rehash PARAMS ((Hash_table *, unsigned int));
|
||||
void *hash_insert PARAMS ((Hash_table *, const void *, bool *));
|
||||
void *hash_delete PARAMS ((Hash_table *, const void *));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* idcache.c -- map user and group IDs, cached for speed
|
||||
Copyright (C) 1985, 1988, 1989, 1990, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1985, 1988, 1989, 1990, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
|
||||
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
|
||||
#if STDC_HEADERS || HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
@@ -44,6 +44,10 @@ struct group *getgrnam ();
|
||||
char *xmalloc ();
|
||||
char *xstrdup ();
|
||||
|
||||
#ifdef __DJGPP__
|
||||
static char digits[] = "0123456789";
|
||||
#endif
|
||||
|
||||
struct userid
|
||||
{
|
||||
union
|
||||
@@ -55,23 +59,15 @@ struct userid
|
||||
struct userid *next;
|
||||
};
|
||||
|
||||
/* The members of this list have already been looked up.
|
||||
If a name is NULL, the corresponding id is not in the password file. */
|
||||
static struct userid *user_alist;
|
||||
|
||||
#ifdef NOT_USED
|
||||
/* The members of this list are names not in the local passwd file;
|
||||
their names are always not NULL, and their ids are irrelevant. */
|
||||
/* The members of this list have names not in the local passwd file. */
|
||||
static struct userid *nouser_alist;
|
||||
#endif /* NOT_USED */
|
||||
|
||||
/* Translate UID to a login name, with cache.
|
||||
If UID cannot be resolved, return NULL.
|
||||
Cache lookup failures, too. */
|
||||
/* Translate UID to a login name, with cache, or NULL if unresolved. */
|
||||
|
||||
char *
|
||||
getuser (uid)
|
||||
uid_t uid;
|
||||
getuser (uid_t uid)
|
||||
{
|
||||
register struct userid *tail;
|
||||
struct passwd *pwent;
|
||||
@@ -83,31 +79,28 @@ getuser (uid)
|
||||
pwent = getpwuid (uid);
|
||||
tail = (struct userid *) xmalloc (sizeof (struct userid));
|
||||
tail->id.u = uid;
|
||||
tail->name = (pwent ? xstrdup (pwent->pw_name) : NULL);
|
||||
tail->name = pwent ? xstrdup (pwent->pw_name) : NULL;
|
||||
|
||||
/* Add to the head of the list, so most recently added is first. */
|
||||
/* Add to the head of the list, so most recently used is first. */
|
||||
tail->next = user_alist;
|
||||
user_alist = tail;
|
||||
return tail->name;
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
|
||||
/* Translate USER to a UID, with cache.
|
||||
Return NULL if there is no such user.
|
||||
(We also cache which user names have no passwd entry,
|
||||
so we don't keep looking them up.) */
|
||||
|
||||
uid_t *
|
||||
getuidbyname (user)
|
||||
const char *user;
|
||||
getuidbyname (const char *user)
|
||||
{
|
||||
register struct userid *tail;
|
||||
struct passwd *pwent;
|
||||
|
||||
for (tail = user_alist; tail; tail = tail->next)
|
||||
/* Avoid a function call for the most common case. */
|
||||
if (tail->name && *tail->name == *user && !strcmp (tail->name, user))
|
||||
if (*tail->name == *user && !strcmp (tail->name, user))
|
||||
return &tail->id.u;
|
||||
|
||||
for (tail = nouser_alist; tail; tail = tail->next)
|
||||
@@ -116,11 +109,20 @@ getuidbyname (user)
|
||||
return 0;
|
||||
|
||||
pwent = getpwnam (user);
|
||||
#ifdef __DJGPP__
|
||||
/* We need to pretend to be the user USER, to make
|
||||
pwd functions know about an arbitrary user name. */
|
||||
if (!pwent && strspn (user, digits) < strlen (user))
|
||||
{
|
||||
setenv ("USER", user, 1);
|
||||
pwent = getpwnam (user); /* now it will succeed */
|
||||
}
|
||||
#endif
|
||||
|
||||
tail = (struct userid *) xmalloc (sizeof (struct userid));
|
||||
tail->name = xstrdup (user);
|
||||
|
||||
/* Add to the head of the list, so most recently added is first. */
|
||||
/* Add to the head of the list, so most recently used is first. */
|
||||
if (pwent)
|
||||
{
|
||||
tail->id.u = pwent->pw_uid;
|
||||
@@ -134,20 +136,14 @@ getuidbyname (user)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* NOT_USED */
|
||||
|
||||
/* Use the same struct as for userids. */
|
||||
static struct userid *group_alist;
|
||||
#ifdef NOT_USED
|
||||
static struct userid *nogroup_alist;
|
||||
#endif
|
||||
|
||||
/* Translate GID to a group name, with cache.
|
||||
Return NULL if the group has no name. */
|
||||
/* Translate GID to a group name, with cache, or NULL if unresolved. */
|
||||
|
||||
char *
|
||||
getgroup (gid)
|
||||
gid_t gid;
|
||||
getgroup (gid_t gid)
|
||||
{
|
||||
register struct userid *tail;
|
||||
struct group *grent;
|
||||
@@ -159,7 +155,7 @@ getgroup (gid)
|
||||
grent = getgrgid (gid);
|
||||
tail = (struct userid *) xmalloc (sizeof (struct userid));
|
||||
tail->id.g = gid;
|
||||
tail->name = (grent ? xstrdup (grent->gr_name) : NULL);
|
||||
tail->name = grent ? xstrdup (grent->gr_name) : NULL;
|
||||
|
||||
/* Add to the head of the list, so most recently used is first. */
|
||||
tail->next = group_alist;
|
||||
@@ -167,23 +163,20 @@ getgroup (gid)
|
||||
return tail->name;
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
|
||||
/* Translate GROUP to a GID, with cache.
|
||||
Return NULL if there is no such group.
|
||||
(We also cache which group names have no group entry,
|
||||
so we don't keep looking them up.) */
|
||||
|
||||
gid_t *
|
||||
getgidbyname (group)
|
||||
const char *group;
|
||||
getgidbyname (const char *group)
|
||||
{
|
||||
register struct userid *tail;
|
||||
struct group *grent;
|
||||
|
||||
for (tail = group_alist; tail; tail = tail->next)
|
||||
/* Avoid a function call for the most common case. */
|
||||
if (tail->name && *tail->name == *group && !strcmp (tail->name, group))
|
||||
if (*tail->name == *group && !strcmp (tail->name, group))
|
||||
return &tail->id.g;
|
||||
|
||||
for (tail = nogroup_alist; tail; tail = tail->next)
|
||||
@@ -192,6 +185,15 @@ getgidbyname (group)
|
||||
return 0;
|
||||
|
||||
grent = getgrnam (group);
|
||||
#ifdef __DJGPP__
|
||||
/* We need to pretend to belong to group GROUP, to make
|
||||
grp functions know about any arbitrary group name. */
|
||||
if (!grent && strspn (group, digits) < strlen (group))
|
||||
{
|
||||
setenv ("GROUP", group, 1);
|
||||
grent = getgrnam (group); /* now it will succeed */
|
||||
}
|
||||
#endif
|
||||
|
||||
tail = (struct userid *) xmalloc (sizeof (struct userid));
|
||||
tail->name = xstrdup (group);
|
||||
@@ -209,5 +211,3 @@ getgidbyname (group)
|
||||
nogroup_alist = tail;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* NOT_USED */
|
||||
|
||||
16
lib/isdir.c
16
lib/isdir.c
@@ -1,5 +1,5 @@
|
||||
/* isdir.c -- determine whether a directory exists
|
||||
Copyright (C) 1990 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -15,19 +15,19 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
#undef S_ISDIR
|
||||
#endif /* STAT_MACROS_BROKEN. */
|
||||
#if STAT_MACROS_BROKEN
|
||||
# undef S_ISDIR
|
||||
#endif
|
||||
|
||||
#if !defined(S_ISDIR) && defined(S_IFDIR)
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#if !defined S_ISDIR && defined S_IFDIR
|
||||
# define S_ISDIR(Mode) (((Mode) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
|
||||
/* If PATH is an existing directory or symbolic link to a directory,
|
||||
|
||||
44
lib/lchown.c
Normal file
44
lib/lchown.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/* Provide a stub lchown function for systems that lack it.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* written by Jim Meyering */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <errno.h>
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
/* Work just like chown, except when FILE is a symbolic link.
|
||||
In that case, set errno to ENOSYS and return -1. */
|
||||
|
||||
int
|
||||
lchown (const char *file, uid_t uid, gid_t gid)
|
||||
{
|
||||
struct stat stats;
|
||||
|
||||
if (lstat (file, &stats) == 0 && S_ISLNK (stats.st_mode))
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return chown (file, uid, gid);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/* linebuffer.h -- declarations for reading arbitrarily long lines
|
||||
Copyright (C) 1986, 1991 Free Software Foundation, Inc.
|
||||
Copyright (C) 1986, 1991, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -14,7 +14,10 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
#if !defined LINEBUFFER_H
|
||||
# define LINEBUFFER_H
|
||||
|
||||
/* A `struct linebuffer' holds a line of text. */
|
||||
|
||||
struct linebuffer
|
||||
@@ -24,12 +27,13 @@ struct linebuffer
|
||||
char *buffer;
|
||||
};
|
||||
|
||||
#undef PARAMS
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# define PARAMS(Args) Args
|
||||
#else
|
||||
# define PARAMS(Args) ()
|
||||
#endif
|
||||
# ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* Initialize linebuffer LINEBUFFER for use. */
|
||||
void initbuffer PARAMS ((struct linebuffer *linebuffer));
|
||||
@@ -42,3 +46,5 @@ struct linebuffer *readline PARAMS ((struct linebuffer *linebuffer,
|
||||
|
||||
/* Free linebuffer LINEBUFFER and its data, all allocated with malloc. */
|
||||
void freebuffer PARAMS ((struct linebuffer *));
|
||||
|
||||
#endif /* LINEBUFFER_H */
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
/* Written by Jim Meyering. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* makepath.c -- Ensure that a directory path exists.
|
||||
Copyright (C) 1990, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -217,6 +217,14 @@ make_path (const char *argpath,
|
||||
if (!do_chdir)
|
||||
basename_dir = dirpath;
|
||||
|
||||
/* The mkdir and stat calls below appear to be reversed.
|
||||
They are not. It is important to call mkdir first and then to
|
||||
call stat (to distinguish the three cases) only if mkdir fails.
|
||||
The alternative to this approach is to `stat' each directory,
|
||||
then to call mkdir if it doesn't exist. But if some other process
|
||||
were to create the directory between the stat & mkdir, the mkdir
|
||||
would fail with EEXIST. */
|
||||
|
||||
*slash = '\0';
|
||||
if (mkdir (basename_dir, tmp_mode))
|
||||
{
|
||||
@@ -239,29 +247,31 @@ make_path (const char *argpath,
|
||||
}
|
||||
}
|
||||
|
||||
if (newly_created_dir && verbose_fmt_string != NULL)
|
||||
fprintf (stderr, verbose_fmt_string, dirpath);
|
||||
if (newly_created_dir)
|
||||
{
|
||||
if (verbose_fmt_string)
|
||||
fprintf (stderr, verbose_fmt_string, dirpath);
|
||||
|
||||
if (newly_created_dir
|
||||
&& (owner != (uid_t) -1 || group != (gid_t) -1)
|
||||
&& chown (basename_dir, owner, group)
|
||||
if ((owner != (uid_t) -1 || group != (gid_t) -1)
|
||||
&& chown (basename_dir, owner, group)
|
||||
#if defined(AFS) && defined (EPERM)
|
||||
&& errno != EPERM
|
||||
&& errno != EPERM
|
||||
#endif
|
||||
)
|
||||
{
|
||||
error (0, errno, "%s", dirpath);
|
||||
CLEANUP;
|
||||
return 1;
|
||||
}
|
||||
)
|
||||
{
|
||||
error (0, errno, "%s", dirpath);
|
||||
CLEANUP;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (re_protect)
|
||||
{
|
||||
struct ptr_list *new = (struct ptr_list *)
|
||||
alloca (sizeof (struct ptr_list));
|
||||
new->dirname_end = slash;
|
||||
new->next = leading_dirs;
|
||||
leading_dirs = new;
|
||||
if (re_protect)
|
||||
{
|
||||
struct ptr_list *new = (struct ptr_list *)
|
||||
alloca (sizeof (struct ptr_list));
|
||||
new->dirname_end = slash;
|
||||
new->next = leading_dirs;
|
||||
leading_dirs = new;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we were able to save the initial working directory,
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#undef PARAMS
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# define PARAMS(Args) Args
|
||||
#else
|
||||
# define PARAMS(Args) ()
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
int
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1993, 1995, 1997 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1993, 1995, 1997, 1998 Free Software Foundation, Inc.
|
||||
Contributed by Torbjorn Granlund (tege@sics.se).
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
@@ -325,7 +325,7 @@ memcmp_not_common_alignment (srcp1, srcp2, len)
|
||||
}
|
||||
|
||||
int
|
||||
memcmp (s1, s2, len)
|
||||
rpl_memcmp (s1, s2, len)
|
||||
const __ptr_t s1;
|
||||
const __ptr_t s2;
|
||||
size_t len;
|
||||
|
||||
32
lib/mktime.c
32
lib/mktime.c
@@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
/* mktime: convert a `struct tm' to a time_t value zzzzzz
|
||||
Copyright (C) 1993-1997, 1998 Free Software Foundation, Inc.
|
||||
Contributed by Paul Eggert (eggert@twinsun.com).
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
@@ -73,21 +74,26 @@
|
||||
# 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 INT_MIN
|
||||
# define INT_MIN (~0 << (sizeof (int) * CHAR_BIT - 1))
|
||||
# define INT_MIN TYPE_MINIMUM (int)
|
||||
#endif
|
||||
#ifndef INT_MAX
|
||||
# define INT_MAX (~0 - INT_MIN)
|
||||
# define INT_MAX TYPE_MAXIMUM (int)
|
||||
#endif
|
||||
|
||||
#ifndef TIME_T_MIN
|
||||
/* The outer cast to time_t works around a bug in Cray C 5.0.3.0. */
|
||||
# define TIME_T_MIN ((time_t) \
|
||||
(0 < (time_t) -1 ? (time_t) 0 \
|
||||
: ~ (time_t) 0 << (sizeof (time_t) * CHAR_BIT - 1)))
|
||||
# define TIME_T_MIN TYPE_MINIMUM (time_t)
|
||||
#endif
|
||||
#ifndef TIME_T_MAX
|
||||
# define TIME_T_MAX (~ (time_t) 0 - TIME_T_MIN)
|
||||
# define TIME_T_MAX TYPE_MAXIMUM (time_t)
|
||||
#endif
|
||||
|
||||
#define TM_YEAR_BASE 1900
|
||||
@@ -365,7 +371,15 @@ __mktime_internal (tp, convert, offset)
|
||||
double dday = 366 * dyear + mday;
|
||||
double dsec = 60 * (60 * (24 * dday + hour) + min) + sec_requested;
|
||||
|
||||
if (TIME_T_MAX / 3 - TIME_T_MIN / 3 < (dsec < 0 ? - dsec : dsec))
|
||||
/* On Irix4.0.5 cc, dividing TIME_T_MIN by 3 does not produce
|
||||
correct results, ie., it erroneously gives a positive value
|
||||
of 715827882. Setting a variable first then doing math on it
|
||||
seems to work. (ghazi@caip.rutgers.edu) */
|
||||
|
||||
const time_t time_t_max = TIME_T_MAX;
|
||||
const time_t time_t_min = TIME_T_MIN;
|
||||
|
||||
if (time_t_max / 3 - time_t_min / 3 < (dsec < 0 ? - dsec : dsec))
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* mountlist.c -- return a list of mounted filesystems
|
||||
Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1991, 1992, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -15,7 +15,7 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -42,7 +42,7 @@ char *xrealloc ();
|
||||
char *xstrdup ();
|
||||
void error ();
|
||||
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#if HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
|
||||
@@ -101,7 +101,7 @@ void error ();
|
||||
# define MOUNTED_GETMNTTBL
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_MNTENT_H
|
||||
#if HAVE_SYS_MNTENT_H
|
||||
/* This is to get MNTOPT_IGNORE on e.g. SVR4. */
|
||||
# include <sys/mntent.h>
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* path-concat.c -- concatenate two arbitrary pathnames
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
/* Written by Jim Meyering. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_STRING_H
|
||||
#if HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1994, 1997 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1994, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C
|
||||
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
@@ -28,6 +28,8 @@
|
||||
systems like Irix 5.3. */
|
||||
#undef putenv
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined (__GNU_LIBRARY__) || defined (HAVE_STDLIB_H)
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
@@ -51,6 +53,10 @@
|
||||
extern char **environ;
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
# define NULL 0
|
||||
#endif
|
||||
|
||||
|
||||
/* Put STRING, which is of the form "NAME=VALUE", in the environment. */
|
||||
int
|
||||
|
||||
355
lib/quotearg.c
Normal file
355
lib/quotearg.c
Normal file
@@ -0,0 +1,355 @@
|
||||
/* quotearg.c - quote arguments for output
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Written by Paul Eggert <eggert@twinsun.com> */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <quotearg.h>
|
||||
#include <xalloc.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
|
||||
# define ISASCII(c) 1
|
||||
#else
|
||||
# define ISASCII(c) isascii (c)
|
||||
#endif
|
||||
#ifdef isgraph
|
||||
# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
|
||||
#else
|
||||
# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
|
||||
#endif
|
||||
|
||||
#if HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
#ifndef CHAR_BIT
|
||||
# define CHAR_BIT 8
|
||||
#endif
|
||||
#ifndef UCHAR_MAX
|
||||
# define UCHAR_MAX ((unsigned char) -1)
|
||||
#endif
|
||||
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
#define INT_BITS (sizeof (int) * CHAR_BIT)
|
||||
|
||||
struct quoting_options
|
||||
{
|
||||
/* Basic quoting style. */
|
||||
enum quoting_style style;
|
||||
|
||||
/* Quote the chararacters indicated by this bit vector even if the
|
||||
quoting style would not normally require them to be quoted. */
|
||||
int quote_these_too[((UCHAR_MAX + 1) / INT_BITS
|
||||
+ ((UCHAR_MAX + 1) % INT_BITS != 0))];
|
||||
};
|
||||
|
||||
/* Names of quoting styles. */
|
||||
char const *const quoting_style_args[] =
|
||||
{
|
||||
"literal", "shell", "shell-always", "c", "escape", 0
|
||||
};
|
||||
|
||||
/* The default quoting options. */
|
||||
static struct quoting_options default_quoting_options;
|
||||
|
||||
/* Allocate a new set of quoting options, with contents initially identical
|
||||
to O if O is not null, or to the default if O is null.
|
||||
It is the caller's responsibility to free the result. */
|
||||
struct quoting_options *
|
||||
clone_quoting_options (struct quoting_options *o)
|
||||
{
|
||||
struct quoting_options *p
|
||||
= (struct quoting_options *) xmalloc (sizeof (struct quoting_options));
|
||||
*p = *(o ? o : &default_quoting_options);
|
||||
return p;
|
||||
}
|
||||
|
||||
/* Get the value of O's quoting style. If O is null, use the default. */
|
||||
enum quoting_style
|
||||
get_quoting_style (struct quoting_options *o)
|
||||
{
|
||||
return (o ? o : &default_quoting_options)->style;
|
||||
}
|
||||
|
||||
/* In O (or in the default if O is null),
|
||||
set the value of the quoting style to S. */
|
||||
void
|
||||
set_quoting_style (struct quoting_options *o, enum quoting_style s)
|
||||
{
|
||||
(o ? o : &default_quoting_options)->style = s;
|
||||
}
|
||||
|
||||
/* In O (or in the default if O is null),
|
||||
set the value of the quoting options for character C to I.
|
||||
Return the old value. Currently, the only values defined for I are
|
||||
0 (the default) and 1 (which means to quote the character even if
|
||||
it would not otherwise be quoted). */
|
||||
int
|
||||
set_char_quoting (struct quoting_options *o, char c, int i)
|
||||
{
|
||||
unsigned char uc = c;
|
||||
int *p = (o ? o : &default_quoting_options)->quote_these_too + uc / INT_BITS;
|
||||
int shift = uc % INT_BITS;
|
||||
int r = (*p >> shift) & 1;
|
||||
*p ^= ((i & 1) ^ r) << shift;
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
|
||||
argument ARG (of size ARGSIZE), using O to control quoting.
|
||||
If O is null, use the default.
|
||||
Terminate the output with a null character, and return the written
|
||||
size of the output, not counting the terminating null.
|
||||
If BUFFERSIZE is too small to store the output string, return the
|
||||
value that would have been returned had BUFFERSIZE been large enough.
|
||||
If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */
|
||||
size_t
|
||||
quotearg_buffer (char *buffer, size_t buffersize,
|
||||
char const *arg, size_t argsize,
|
||||
struct quoting_options const *o)
|
||||
{
|
||||
unsigned char c;
|
||||
size_t i;
|
||||
size_t len;
|
||||
int quote_mark;
|
||||
struct quoting_options const *p = o ? o : &default_quoting_options;
|
||||
enum quoting_style quoting_style = p->style;
|
||||
#define STORE(c) \
|
||||
do \
|
||||
{ \
|
||||
if (len < buffersize) \
|
||||
buffer[len] = (c); \
|
||||
len++; \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
switch (quoting_style)
|
||||
{
|
||||
case shell_quoting_style:
|
||||
if (! (argsize == -1 ? arg[0] == '\0' : argsize == 0))
|
||||
{
|
||||
switch (arg[0])
|
||||
{
|
||||
case '#': case '~':
|
||||
break;
|
||||
|
||||
default:
|
||||
len = 0;
|
||||
for (i = 0; ; i++)
|
||||
{
|
||||
if (argsize == -1 ? arg[i] == '\0' : i == argsize)
|
||||
goto done;
|
||||
|
||||
c = arg[i];
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '\t': case '\n': case ' ':
|
||||
case '!': /* special in csh */
|
||||
case '"': case '$': case '&': case '\'':
|
||||
case '(': case ')': case '*': case ';':
|
||||
case '<': case '>': case '?': case '[': case '\\':
|
||||
case '^': /* special in old /bin/sh, e.g. SunOS 4.1.4 */
|
||||
case '`': case '|':
|
||||
goto needs_quoting;
|
||||
}
|
||||
|
||||
if (p->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS)))
|
||||
goto needs_quoting;
|
||||
|
||||
STORE (c);
|
||||
}
|
||||
|
||||
needs_quoting:;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* Fall through. */
|
||||
|
||||
case shell_always_quoting_style:
|
||||
quote_mark = '\'';
|
||||
break;
|
||||
|
||||
case c_quoting_style:
|
||||
quote_mark = '"';
|
||||
break;
|
||||
|
||||
default:
|
||||
quote_mark = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
len = 0;
|
||||
|
||||
if (quote_mark)
|
||||
STORE (quote_mark);
|
||||
|
||||
for (i = 0; ! (argsize == -1 ? arg[i] == '\0' : i == argsize); i++)
|
||||
{
|
||||
c = arg[i];
|
||||
|
||||
switch (quoting_style)
|
||||
{
|
||||
case literal_quoting_style:
|
||||
break;
|
||||
|
||||
case shell_quoting_style:
|
||||
case shell_always_quoting_style:
|
||||
if (c == '\'')
|
||||
{
|
||||
STORE ('\'');
|
||||
STORE ('\\');
|
||||
STORE ('\'');
|
||||
}
|
||||
break;
|
||||
|
||||
case c_quoting_style:
|
||||
case escape_quoting_style:
|
||||
switch (c)
|
||||
{
|
||||
case '?': /* Do not generate trigraphs. */
|
||||
case '\\': goto store_escape;
|
||||
/* Not all C compilers know what \a means. */
|
||||
case 7 : c = 'a'; goto store_escape;
|
||||
case '\b': c = 'b'; goto store_escape;
|
||||
case '\f': c = 'f'; goto store_escape;
|
||||
case '\n': c = 'n'; goto store_escape;
|
||||
case '\r': c = 'r'; goto store_escape;
|
||||
case '\t': c = 't'; goto store_escape;
|
||||
case '\v': c = 'v'; goto store_escape;
|
||||
|
||||
case ' ':
|
||||
if (quoting_style == escape_quoting_style)
|
||||
goto store_escape;
|
||||
break;
|
||||
|
||||
case '"':
|
||||
if (quoting_style == c_quoting_style)
|
||||
goto store_escape;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!ISGRAPH (c))
|
||||
{
|
||||
STORE ('\\');
|
||||
STORE ('0' + (c >> 6));
|
||||
STORE ('0' + ((c >> 3) & 3));
|
||||
c = '0' + (c & 3);
|
||||
goto store_c;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (! (p->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS))))
|
||||
goto store_c;
|
||||
|
||||
store_escape:
|
||||
STORE ('\\');
|
||||
}
|
||||
|
||||
store_c:
|
||||
STORE (c);
|
||||
}
|
||||
|
||||
if (quote_mark)
|
||||
STORE (quote_mark);
|
||||
|
||||
done:
|
||||
if (len < buffersize)
|
||||
buffer[len] = '\0';
|
||||
return len;
|
||||
}
|
||||
|
||||
/* Use storage slot N to return a quoted version of the string ARG.
|
||||
OPTIONS specifies the quoting options.
|
||||
The returned value points to static storage that can be
|
||||
reused by the next call to this function with the same value of N.
|
||||
N must be nonnegative. */
|
||||
static char *
|
||||
quotearg_n_options (int n, char const *arg, struct quoting_options *options)
|
||||
{
|
||||
static unsigned nslots;
|
||||
static struct slotvec
|
||||
{
|
||||
size_t size;
|
||||
char *val;
|
||||
} *slotvec;
|
||||
|
||||
if (nslots <= n)
|
||||
{
|
||||
int n1 = n + 1;
|
||||
size_t s = n1 * sizeof (struct slotvec);
|
||||
if (! (0 < n1 && n1 == s / sizeof (struct slotvec)))
|
||||
abort ();
|
||||
slotvec = (struct slotvec *) xrealloc (slotvec, s);
|
||||
memset (slotvec + nslots, 0, (n1 - nslots) * sizeof (struct slotvec));
|
||||
nslots = n;
|
||||
}
|
||||
|
||||
{
|
||||
size_t size = slotvec[n].size;
|
||||
char *val = slotvec[n].val;
|
||||
size_t qsize = quotearg_buffer (val, size, arg, (size_t) -1, options);
|
||||
|
||||
if (size <= qsize)
|
||||
{
|
||||
slotvec[n].size = size = qsize + 1;
|
||||
slotvec[n].val = val = xrealloc (val, size);
|
||||
quotearg_buffer (val, size, arg, (size_t) -1, options);
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
quotearg_n (int n, char const *arg)
|
||||
{
|
||||
return quotearg_n_options (n, arg, &default_quoting_options);
|
||||
}
|
||||
|
||||
char *
|
||||
quotearg (char const *arg)
|
||||
{
|
||||
return quotearg_n (0, arg);
|
||||
}
|
||||
|
||||
char *
|
||||
quotearg_char (char const *arg, char ch)
|
||||
{
|
||||
struct quoting_options options;
|
||||
options = default_quoting_options;
|
||||
set_char_quoting (&options, ch, 1);
|
||||
return quotearg_n_options (0, arg, &options);
|
||||
}
|
||||
|
||||
char *
|
||||
quotearg_colon (char const *arg)
|
||||
{
|
||||
return quotearg_char (arg, ':');
|
||||
}
|
||||
99
lib/quotearg.h
Normal file
99
lib/quotearg.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/* quotearg.h - quote arguments for output
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Written by Paul Eggert <eggert@twinsun.com> */
|
||||
|
||||
/* Basic quoting styles. */
|
||||
enum quoting_style
|
||||
{
|
||||
literal_quoting_style, /* --quoting-style=literal */
|
||||
shell_quoting_style, /* --quoting-style=shell */
|
||||
shell_always_quoting_style, /* --quoting-style=shell-always */
|
||||
c_quoting_style, /* --quoting-style=c */
|
||||
escape_quoting_style /* --quoting-style=escape */
|
||||
};
|
||||
|
||||
/* For now, --quoting-style=literal is the default, but
|
||||
this is planned to change to --quoting-style=shell in the future. */
|
||||
#ifndef DEFAULT_QUOTING_STYLE
|
||||
# define DEFAULT_QUOTING_STYLE literal_quoting_style
|
||||
#endif
|
||||
|
||||
/* Names of quoting styles. */
|
||||
extern char const *const quoting_style_args[];
|
||||
|
||||
struct quoting_options;
|
||||
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || defined __STDC__
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* The functions listed below set and use a hidden variable
|
||||
that contains the default quoting style options. */
|
||||
|
||||
/* Allocate a new set of quoting options, with contents initially identical
|
||||
to O if O is not null, or to the default if O is null.
|
||||
It is the caller's responsibility to free the result. */
|
||||
struct quoting_options *clone_quoting_options
|
||||
PARAMS ((struct quoting_options *o));
|
||||
|
||||
/* Get the value of O's quoting style. If O is null, use the default. */
|
||||
enum quoting_style get_quoting_style PARAMS ((struct quoting_options *o));
|
||||
|
||||
/* In O (or in the default if O is null),
|
||||
set the value of the quoting style to S. */
|
||||
void set_quoting_style PARAMS ((struct quoting_options *o,
|
||||
enum quoting_style s));
|
||||
|
||||
/* In O (or in the default if O is null),
|
||||
set the value of the quoting options for character C to I.
|
||||
Return the old value. Currently, the only values defined for I are
|
||||
0 (the default) and 1 (which means to quote the character even if
|
||||
it would not otherwise be quoted). */
|
||||
int set_char_quoting PARAMS ((struct quoting_options *o, char c, int i));
|
||||
|
||||
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
|
||||
argument ARG (of size ARGSIZE), using O to control quoting.
|
||||
If O is null, use the default.
|
||||
Terminate the output with a null character, and return the written
|
||||
size of the output, not counting the terminating null.
|
||||
If BUFFERSIZE is too small to store the output string, return the
|
||||
value that would have been returned had BUFFERSIZE been large enough.
|
||||
If ARGSIZE is -1, use the string length of the argument for ARGSIZE. */
|
||||
size_t quotearg_buffer PARAMS ((char *buffer, size_t buffersize,
|
||||
char const *arg, size_t argsize,
|
||||
struct quoting_options const *o));
|
||||
|
||||
/* Use storage slot N to return a quoted version of the string ARG.
|
||||
Use the default quoting options.
|
||||
The returned value points to static storage that can be
|
||||
reused by the next call to this function with the same value of N.
|
||||
N must be nonnegative. */
|
||||
char *quotearg_n PARAMS ((int n, char const *arg));
|
||||
|
||||
/* Equivalent to quotearg_n (ARG, 0). */
|
||||
char *quotearg PARAMS ((char const *arg));
|
||||
|
||||
/* Like quotearg (ARG), except also quote any instances of CH. */
|
||||
char *quotearg_char PARAMS ((char const *arg, char ch));
|
||||
|
||||
/* Equivalent to quotearg_char (ARG, ':'). */
|
||||
char *quotearg_colon PARAMS ((char const *arg));
|
||||
@@ -1,5 +1,5 @@
|
||||
/* GNU's read utmp module.
|
||||
Copyright (C) 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 92, 93, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -34,8 +34,7 @@ char *xmalloc ();
|
||||
trailing spaces from the copy, NUL terminate it, and return the copy. */
|
||||
|
||||
char *
|
||||
extract_trimmed_name (ut)
|
||||
const STRUCT_UTMP *ut;
|
||||
extract_trimmed_name (const STRUCT_UTMP *ut)
|
||||
{
|
||||
char *p, *trimmed_name;
|
||||
|
||||
@@ -54,11 +53,74 @@ extract_trimmed_name (ut)
|
||||
number of entries read, and return zero. If there is any error,
|
||||
return non-zero and don't modify the parameters. */
|
||||
|
||||
#ifdef HAVE_UTMPNAME
|
||||
|
||||
int
|
||||
read_utmp (filename, n_entries, utmp_buf)
|
||||
const char *filename;
|
||||
int *n_entries;
|
||||
STRUCT_UTMP **utmp_buf;
|
||||
read_utmp (const char *filename, int *n_entries, STRUCT_UTMP **utmp_buf)
|
||||
{
|
||||
int count_utmp = 0;
|
||||
int n_read;
|
||||
STRUCT_UTMP *u;
|
||||
STRUCT_UTMP *uptr;
|
||||
STRUCT_UTMP *utmp_contents;
|
||||
|
||||
if (utmpname (filename))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* FIXME: going through the list twice is wasteful. */
|
||||
|
||||
/* count the entries in utmp */
|
||||
setutent ();
|
||||
while ((u = getutent ()) != NULL)
|
||||
++count_utmp;
|
||||
|
||||
if (count_utmp == 0)
|
||||
return 0;
|
||||
|
||||
utmp_contents = (STRUCT_UTMP *) xmalloc (count_utmp * sizeof (STRUCT_UTMP));
|
||||
|
||||
/* read the entries in utmp */
|
||||
|
||||
/* FIXME: can this fail? */
|
||||
setutent ();
|
||||
|
||||
n_read = 0;
|
||||
uptr = utmp_contents;
|
||||
while ((u = getutent ()) != NULL)
|
||||
{
|
||||
++n_read;
|
||||
if (n_read > count_utmp)
|
||||
{
|
||||
STRUCT_UTMP *old_utmp_contents = utmp_contents;
|
||||
++count_utmp;
|
||||
utmp_contents = (STRUCT_UTMP *) xrealloc (utmp_contents,
|
||||
(count_utmp
|
||||
* sizeof (STRUCT_UTMP)));
|
||||
uptr = utmp_contents + (uptr - old_utmp_contents);
|
||||
}
|
||||
*uptr = *u;
|
||||
++uptr;
|
||||
}
|
||||
|
||||
if (n_read != count_utmp)
|
||||
utmp_contents = (STRUCT_UTMP *) xrealloc (utmp_contents,
|
||||
n_read * sizeof (STRUCT_UTMP));
|
||||
|
||||
/* FIXME: can this fail? */
|
||||
endutent ();
|
||||
|
||||
*n_entries = n_read;
|
||||
*utmp_buf = utmp_contents;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
read_utmp (const char *filename, int *n_entries, STRUCT_UTMP **utmp_buf)
|
||||
{
|
||||
FILE *utmp;
|
||||
struct stat file_stats;
|
||||
@@ -91,3 +153,5 @@ read_utmp (filename, n_entries, utmp_buf)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* HAVE_UTMPNAME */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Declarations for GNU's read utmp module.
|
||||
Copyright (C) 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 92, 93, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -20,6 +20,14 @@
|
||||
#ifndef __READUTMP_H__
|
||||
# define __READUTMP_H__
|
||||
|
||||
# ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# include <stdio.h>
|
||||
# include <sys/types.h>
|
||||
|
||||
|
||||
475
lib/regex.c
475
lib/regex.c
@@ -2,30 +2,28 @@
|
||||
version 0.12.
|
||||
(Implements POSIX draft P1003.2/D11.2, except for some of the
|
||||
internationalization features.)
|
||||
Copyright (C) 1993, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the
|
||||
GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
/* AIX requires this to be the first thing in the file. */
|
||||
#if defined (_AIX) && !defined (REGEX_MALLOC)
|
||||
#if defined _AIX && !defined REGEX_MALLOC
|
||||
#pragma alloca
|
||||
#endif
|
||||
|
||||
@@ -33,25 +31,36 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined(STDC_HEADERS) && !defined(emacs)
|
||||
#include <stddef.h>
|
||||
#ifndef PARAMS
|
||||
# if defined __GNUC__ || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(args) args
|
||||
# else
|
||||
# define PARAMS(args) ()
|
||||
# endif /* GCC. */
|
||||
#endif /* Not PARAMS. */
|
||||
|
||||
#if defined STDC_HEADERS && !defined emacs
|
||||
# include <stddef.h>
|
||||
#else
|
||||
/* We need this for `regex.h', and perhaps for the Emacs include files. */
|
||||
#include <sys/types.h>
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#define WIDE_CHAR_SUPPORT \
|
||||
defined _LIBC || (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC)
|
||||
|
||||
/* For platform which support the ISO C amendement 1 functionality we
|
||||
support user defined character classes. */
|
||||
#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||
# include <wctype.h>
|
||||
#if WIDE_CHAR_SUPPORT
|
||||
# include <wchar.h>
|
||||
# include <wctype.h>
|
||||
#endif
|
||||
|
||||
/* This is for other GNU distributions with internationalized messages. */
|
||||
#if HAVE_LIBINTL_H || defined (_LIBC)
|
||||
#if HAVE_LIBINTL_H || defined _LIBC
|
||||
# include <libintl.h>
|
||||
#else
|
||||
# define gettext(msgid) (msgid)
|
||||
@@ -60,83 +69,83 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#ifndef gettext_noop
|
||||
/* This define is so xgettext can find the internationalizable
|
||||
strings. */
|
||||
#define gettext_noop(String) String
|
||||
# define gettext_noop(String) String
|
||||
#endif
|
||||
|
||||
/* The `emacs' switch turns on certain matching commands
|
||||
that make sense only in Emacs. */
|
||||
#ifdef emacs
|
||||
|
||||
#include "lisp.h"
|
||||
#include "buffer.h"
|
||||
#include "syntax.h"
|
||||
# include "lisp.h"
|
||||
# include "buffer.h"
|
||||
# include "syntax.h"
|
||||
|
||||
#else /* not emacs */
|
||||
|
||||
/* If we are not linking with Emacs proper,
|
||||
we can't use the relocating allocator
|
||||
even if config.h says that we can. */
|
||||
#undef REL_ALLOC
|
||||
# undef REL_ALLOC
|
||||
|
||||
#if defined (STDC_HEADERS) || defined (_LIBC)
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
# if defined STDC_HEADERS || defined _LIBC
|
||||
# include <stdlib.h>
|
||||
# else
|
||||
char *malloc ();
|
||||
char *realloc ();
|
||||
#endif
|
||||
# endif
|
||||
|
||||
/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow.
|
||||
If nothing else has been done, use the method below. */
|
||||
#ifdef INHIBIT_STRING_HEADER
|
||||
#if !(defined (HAVE_BZERO) && defined (HAVE_BCOPY))
|
||||
#if !defined (bzero) && !defined (bcopy)
|
||||
#undef INHIBIT_STRING_HEADER
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
# ifdef INHIBIT_STRING_HEADER
|
||||
# if !(defined HAVE_BZERO && defined HAVE_BCOPY)
|
||||
# if !defined bzero && !defined bcopy
|
||||
# undef INHIBIT_STRING_HEADER
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* This is the normal way of making sure we have a bcopy and a bzero.
|
||||
This is used in most programs--a few other programs avoid this
|
||||
by defining INHIBIT_STRING_HEADER. */
|
||||
#ifndef INHIBIT_STRING_HEADER
|
||||
#if defined (HAVE_STRING_H) || defined (STDC_HEADERS) || defined (_LIBC)
|
||||
#include <string.h>
|
||||
#ifndef bcmp
|
||||
#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
|
||||
#endif
|
||||
#ifndef bcopy
|
||||
#define bcopy(s, d, n) memcpy ((d), (s), (n))
|
||||
#endif
|
||||
#ifndef bzero
|
||||
#define bzero(s, n) memset ((s), 0, (n))
|
||||
#endif
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
#endif
|
||||
# ifndef INHIBIT_STRING_HEADER
|
||||
# if defined HAVE_STRING_H || defined STDC_HEADERS || defined _LIBC
|
||||
# include <string.h>
|
||||
# if !defined bzero && !defined _LIBC
|
||||
# define bzero(s, n) (memset (s, '\0', n), (s))
|
||||
# endif
|
||||
# else
|
||||
# include <strings.h>
|
||||
# ifndef memcmp
|
||||
# define memcmp(s1, s2, n) bcmp (s1, s2, n)
|
||||
# endif
|
||||
# ifndef memcpy
|
||||
# define memcpy(d, s, n) (bcopy (s, d, n), (d))
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* Define the syntax stuff for \<, \>, etc. */
|
||||
|
||||
/* This must be nonzero for the wordchar and notwordchar pattern
|
||||
commands in re_match_2. */
|
||||
#ifndef Sword
|
||||
#define Sword 1
|
||||
#endif
|
||||
# ifndef Sword
|
||||
# define Sword 1
|
||||
# endif
|
||||
|
||||
#ifdef SWITCH_ENUM_BUG
|
||||
#define SWITCH_ENUM_CAST(x) ((int)(x))
|
||||
#else
|
||||
#define SWITCH_ENUM_CAST(x) (x)
|
||||
#endif
|
||||
# ifdef SWITCH_ENUM_BUG
|
||||
# define SWITCH_ENUM_CAST(x) ((int)(x))
|
||||
# else
|
||||
# define SWITCH_ENUM_CAST(x) (x)
|
||||
# endif
|
||||
|
||||
#ifdef SYNTAX_TABLE
|
||||
/* How many characters in the character set. */
|
||||
# define CHAR_SET_SIZE 256
|
||||
|
||||
# ifdef SYNTAX_TABLE
|
||||
|
||||
extern char *re_syntax_table;
|
||||
|
||||
#else /* not SYNTAX_TABLE */
|
||||
|
||||
/* How many characters in the character set. */
|
||||
#define CHAR_SET_SIZE 256
|
||||
# else /* not SYNTAX_TABLE */
|
||||
|
||||
static char re_syntax_table[CHAR_SET_SIZE];
|
||||
|
||||
@@ -165,9 +174,9 @@ init_syntax_once ()
|
||||
done = 1;
|
||||
}
|
||||
|
||||
#endif /* not SYNTAX_TABLE */
|
||||
# endif /* not SYNTAX_TABLE */
|
||||
|
||||
#define SYNTAX(c) re_syntax_table[c]
|
||||
# define SYNTAX(c) re_syntax_table[c]
|
||||
|
||||
#endif /* not emacs */
|
||||
|
||||
@@ -188,23 +197,25 @@ init_syntax_once ()
|
||||
Defining isascii to 1 should let any compiler worth its salt
|
||||
eliminate the && through constant folding." */
|
||||
|
||||
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
|
||||
#define ISASCII(c) 1
|
||||
#undef ISASCII
|
||||
#if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII)
|
||||
# define ISASCII(c) 1
|
||||
#else
|
||||
#define ISASCII(c) isascii(c)
|
||||
# define ISASCII(c) isascii(c)
|
||||
#endif
|
||||
|
||||
#ifdef isblank
|
||||
#define ISBLANK(c) (ISASCII (c) && isblank (c))
|
||||
# define ISBLANK(c) (ISASCII (c) && isblank (c))
|
||||
#else
|
||||
#define ISBLANK(c) ((c) == ' ' || (c) == '\t')
|
||||
# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
|
||||
#endif
|
||||
#ifdef isgraph
|
||||
#define ISGRAPH(c) (ISASCII (c) && isgraph (c))
|
||||
# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
|
||||
#else
|
||||
#define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
|
||||
# define ISGRAPH(c) (ISASCII (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))
|
||||
@@ -217,7 +228,7 @@ init_syntax_once ()
|
||||
#define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL (void *)0
|
||||
# define NULL (void *)0
|
||||
#endif
|
||||
|
||||
/* We remove any previous definition of `SIGN_EXTEND_CHAR',
|
||||
@@ -226,10 +237,10 @@ init_syntax_once ()
|
||||
(Per Bothner suggested the basic approach.) */
|
||||
#undef SIGN_EXTEND_CHAR
|
||||
#if __STDC__
|
||||
#define SIGN_EXTEND_CHAR(c) ((signed char) (c))
|
||||
# define SIGN_EXTEND_CHAR(c) ((signed char) (c))
|
||||
#else /* not __STDC__ */
|
||||
/* As in Harbison and Steele. */
|
||||
#define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
|
||||
# define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
|
||||
#endif
|
||||
|
||||
/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
|
||||
@@ -244,74 +255,67 @@ init_syntax_once ()
|
||||
|
||||
#ifdef REGEX_MALLOC
|
||||
|
||||
#define REGEX_ALLOCATE malloc
|
||||
#define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize)
|
||||
#define REGEX_FREE free
|
||||
# define REGEX_ALLOCATE malloc
|
||||
# define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize)
|
||||
# define REGEX_FREE free
|
||||
|
||||
#else /* not REGEX_MALLOC */
|
||||
|
||||
/* Emacs already defines alloca, sometimes. */
|
||||
#ifndef alloca
|
||||
# ifndef alloca
|
||||
|
||||
/* Make alloca work the best possible way. */
|
||||
#ifdef __GNUC__
|
||||
#define alloca __builtin_alloca
|
||||
#else /* not __GNUC__ */
|
||||
#if HAVE_ALLOCA_H
|
||||
#include <alloca.h>
|
||||
#else /* not __GNUC__ or HAVE_ALLOCA_H */
|
||||
#if 0 /* It is a bad idea to declare alloca. We always cast the result. */
|
||||
#ifndef _AIX /* Already did AIX, up at the top. */
|
||||
char *alloca ();
|
||||
#endif /* not _AIX */
|
||||
#endif
|
||||
#endif /* not HAVE_ALLOCA_H */
|
||||
#endif /* not __GNUC__ */
|
||||
# ifdef __GNUC__
|
||||
# define alloca __builtin_alloca
|
||||
# else /* not __GNUC__ */
|
||||
# if HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
# endif /* HAVE_ALLOCA_H */
|
||||
# endif /* not __GNUC__ */
|
||||
|
||||
#endif /* not alloca */
|
||||
# endif /* not alloca */
|
||||
|
||||
#define REGEX_ALLOCATE alloca
|
||||
# define REGEX_ALLOCATE alloca
|
||||
|
||||
/* Assumes a `char *destination' variable. */
|
||||
#define REGEX_REALLOCATE(source, osize, nsize) \
|
||||
# define REGEX_REALLOCATE(source, osize, nsize) \
|
||||
(destination = (char *) alloca (nsize), \
|
||||
bcopy (source, destination, osize), \
|
||||
destination)
|
||||
memcpy (destination, source, osize))
|
||||
|
||||
/* No need to do anything to free, after alloca. */
|
||||
#define REGEX_FREE(arg) ((void)0) /* Do nothing! But inhibit gcc warning. */
|
||||
# define REGEX_FREE(arg) ((void)0) /* Do nothing! But inhibit gcc warning. */
|
||||
|
||||
#endif /* not REGEX_MALLOC */
|
||||
|
||||
/* Define how to allocate the failure stack. */
|
||||
|
||||
#if defined (REL_ALLOC) && defined (REGEX_MALLOC)
|
||||
#if defined REL_ALLOC && defined REGEX_MALLOC
|
||||
|
||||
#define REGEX_ALLOCATE_STACK(size) \
|
||||
# define REGEX_ALLOCATE_STACK(size) \
|
||||
r_alloc (&failure_stack_ptr, (size))
|
||||
#define REGEX_REALLOCATE_STACK(source, osize, nsize) \
|
||||
# define REGEX_REALLOCATE_STACK(source, osize, nsize) \
|
||||
r_re_alloc (&failure_stack_ptr, (nsize))
|
||||
#define REGEX_FREE_STACK(ptr) \
|
||||
# define REGEX_FREE_STACK(ptr) \
|
||||
r_alloc_free (&failure_stack_ptr)
|
||||
|
||||
#else /* not using relocating allocator */
|
||||
|
||||
#ifdef REGEX_MALLOC
|
||||
# ifdef REGEX_MALLOC
|
||||
|
||||
#define REGEX_ALLOCATE_STACK malloc
|
||||
#define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize)
|
||||
#define REGEX_FREE_STACK free
|
||||
# define REGEX_ALLOCATE_STACK malloc
|
||||
# define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize)
|
||||
# define REGEX_FREE_STACK free
|
||||
|
||||
#else /* not REGEX_MALLOC */
|
||||
# else /* not REGEX_MALLOC */
|
||||
|
||||
#define REGEX_ALLOCATE_STACK alloca
|
||||
# define REGEX_ALLOCATE_STACK alloca
|
||||
|
||||
#define REGEX_REALLOCATE_STACK(source, osize, nsize) \
|
||||
# define REGEX_REALLOCATE_STACK(source, osize, nsize) \
|
||||
REGEX_REALLOCATE (source, osize, nsize)
|
||||
/* No need to explicitly free anything. */
|
||||
#define REGEX_FREE_STACK(arg)
|
||||
# define REGEX_FREE_STACK(arg)
|
||||
|
||||
#endif /* not REGEX_MALLOC */
|
||||
# endif /* not REGEX_MALLOC */
|
||||
#endif /* not using relocating allocator */
|
||||
|
||||
|
||||
@@ -341,7 +345,12 @@ typedef char boolean;
|
||||
#define false 0
|
||||
#define true 1
|
||||
|
||||
static int re_match_2_internal ();
|
||||
static int re_match_2_internal PARAMS ((struct re_pattern_buffer *bufp,
|
||||
const char *string1, int size1,
|
||||
const char *string2, int size2,
|
||||
int pos,
|
||||
struct re_registers *regs,
|
||||
int stop));
|
||||
|
||||
/* These are the command codes that appear in compiled regular
|
||||
expressions. Some opcodes are followed by argument bytes. A
|
||||
@@ -523,10 +532,10 @@ extract_number (dest, source)
|
||||
*dest += temp << 8;
|
||||
}
|
||||
|
||||
#ifndef EXTRACT_MACROS /* To debug the macros. */
|
||||
#undef EXTRACT_NUMBER
|
||||
#define EXTRACT_NUMBER(dest, src) extract_number (&dest, src)
|
||||
#endif /* not EXTRACT_MACROS */
|
||||
# ifndef EXTRACT_MACROS /* To debug the macros. */
|
||||
# undef EXTRACT_NUMBER
|
||||
# define EXTRACT_NUMBER(dest, src) extract_number (&dest, src)
|
||||
# endif /* not EXTRACT_MACROS */
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
@@ -551,11 +560,11 @@ extract_number_and_incr (destination, source)
|
||||
*source += 2;
|
||||
}
|
||||
|
||||
#ifndef EXTRACT_MACROS
|
||||
#undef EXTRACT_NUMBER_AND_INCR
|
||||
#define EXTRACT_NUMBER_AND_INCR(dest, src) \
|
||||
# ifndef EXTRACT_MACROS
|
||||
# undef EXTRACT_NUMBER_AND_INCR
|
||||
# define EXTRACT_NUMBER_AND_INCR(dest, src) \
|
||||
extract_number_and_incr (&dest, &src)
|
||||
#endif /* not EXTRACT_MACROS */
|
||||
# endif /* not EXTRACT_MACROS */
|
||||
|
||||
#endif /* DEBUG */
|
||||
|
||||
@@ -568,21 +577,21 @@ extract_number_and_incr (destination, source)
|
||||
#ifdef DEBUG
|
||||
|
||||
/* We use standard I/O for debugging. */
|
||||
#include <stdio.h>
|
||||
# include <stdio.h>
|
||||
|
||||
/* It is useful to test things that ``must'' be true when debugging. */
|
||||
#include <assert.h>
|
||||
# include <assert.h>
|
||||
|
||||
static int debug = 0;
|
||||
|
||||
#define DEBUG_STATEMENT(e) e
|
||||
#define DEBUG_PRINT1(x) if (debug) printf (x)
|
||||
#define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2)
|
||||
#define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3)
|
||||
#define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4)
|
||||
#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \
|
||||
# define DEBUG_STATEMENT(e) e
|
||||
# define DEBUG_PRINT1(x) if (debug) printf (x)
|
||||
# define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2)
|
||||
# define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3)
|
||||
# define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4)
|
||||
# define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \
|
||||
if (debug) print_partial_compiled_pattern (s, e)
|
||||
#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \
|
||||
# define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \
|
||||
if (debug) print_double_string (w, s1, sz1, s2, sz2)
|
||||
|
||||
|
||||
@@ -802,7 +811,7 @@ print_partial_compiled_pattern (start, end)
|
||||
case wordend:
|
||||
printf ("/wordend");
|
||||
|
||||
#ifdef emacs
|
||||
# ifdef emacs
|
||||
case before_dot:
|
||||
printf ("/before_dot");
|
||||
break;
|
||||
@@ -826,7 +835,7 @@ print_partial_compiled_pattern (start, end)
|
||||
mcnt = *p++;
|
||||
printf ("/%d", mcnt);
|
||||
break;
|
||||
#endif /* emacs */
|
||||
# endif /* emacs */
|
||||
|
||||
case wordchar:
|
||||
printf ("/wordchar");
|
||||
@@ -919,16 +928,16 @@ printchar (c)
|
||||
|
||||
#else /* not DEBUG */
|
||||
|
||||
#undef assert
|
||||
#define assert(e)
|
||||
# undef assert
|
||||
# define assert(e)
|
||||
|
||||
#define DEBUG_STATEMENT(e)
|
||||
#define DEBUG_PRINT1(x)
|
||||
#define DEBUG_PRINT2(x1, x2)
|
||||
#define DEBUG_PRINT3(x1, x2, x3)
|
||||
#define DEBUG_PRINT4(x1, x2, x3, x4)
|
||||
#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e)
|
||||
#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)
|
||||
# define DEBUG_STATEMENT(e)
|
||||
# define DEBUG_PRINT1(x)
|
||||
# define DEBUG_PRINT2(x1, x2)
|
||||
# define DEBUG_PRINT3(x1, x2, x3)
|
||||
# define DEBUG_PRINT4(x1, x2, x3, x4)
|
||||
# define DEBUG_PRINT_COMPILED_PATTERN(p, s, e)
|
||||
# define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)
|
||||
|
||||
#endif /* not DEBUG */
|
||||
|
||||
@@ -1014,7 +1023,7 @@ static const char *re_error_msgid[] =
|
||||
/* When using GNU C, we are not REALLY using the C alloca, no matter
|
||||
what config.h may say. So don't take precautions for it. */
|
||||
#ifdef __GNUC__
|
||||
#undef C_ALLOCA
|
||||
# undef C_ALLOCA
|
||||
#endif
|
||||
|
||||
/* The match routines may not allocate if (1) they would do it with malloc
|
||||
@@ -1022,8 +1031,8 @@ static const char *re_error_msgid[] =
|
||||
Note that if REL_ALLOC is defined, matching would not use malloc for the
|
||||
failure stack, but we would still use it for the register vectors;
|
||||
so REL_ALLOC should not affect this. */
|
||||
#if (defined (C_ALLOCA) || defined (REGEX_MALLOC)) && defined (emacs)
|
||||
#undef MATCH_MAY_ALLOCATE
|
||||
#if (defined C_ALLOCA || defined REGEX_MALLOC) && defined emacs
|
||||
# undef MATCH_MAY_ALLOCATE
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1036,7 +1045,7 @@ static const char *re_error_msgid[] =
|
||||
when matching. If this number is exceeded, we allocate more
|
||||
space, so it is not a hard limit. */
|
||||
#ifndef INIT_FAILURE_ALLOC
|
||||
#define INIT_FAILURE_ALLOC 5
|
||||
# define INIT_FAILURE_ALLOC 5
|
||||
#endif
|
||||
|
||||
/* Roughly the maximum number of failure points on the stack. Would be
|
||||
@@ -1046,13 +1055,13 @@ static const char *re_error_msgid[] =
|
||||
|
||||
#ifdef INT_IS_16BIT
|
||||
|
||||
#if defined (MATCH_MAY_ALLOCATE)
|
||||
# if defined MATCH_MAY_ALLOCATE
|
||||
/* 4400 was enough to cause a crash on Alpha OSF/1,
|
||||
whose default stack limit is 2mb. */
|
||||
long int re_max_failures = 4000;
|
||||
#else
|
||||
# else
|
||||
long int re_max_failures = 2000;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
union fail_stack_elt
|
||||
{
|
||||
@@ -1071,13 +1080,13 @@ typedef struct
|
||||
|
||||
#else /* not INT_IS_16BIT */
|
||||
|
||||
#if defined (MATCH_MAY_ALLOCATE)
|
||||
# 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;
|
||||
#else
|
||||
# else
|
||||
int re_max_failures = 2000;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
union fail_stack_elt
|
||||
{
|
||||
@@ -1105,10 +1114,10 @@ typedef struct
|
||||
Do `return -2' if the alloc fails. */
|
||||
|
||||
#ifdef MATCH_MAY_ALLOCATE
|
||||
#define INIT_FAIL_STACK() \
|
||||
# define INIT_FAIL_STACK() \
|
||||
do { \
|
||||
fail_stack.stack = (fail_stack_elt_t *) \
|
||||
REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \
|
||||
REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \
|
||||
\
|
||||
if (fail_stack.stack == NULL) \
|
||||
return -2; \
|
||||
@@ -1117,14 +1126,14 @@ typedef struct
|
||||
fail_stack.avail = 0; \
|
||||
} while (0)
|
||||
|
||||
#define RESET_FAIL_STACK() REGEX_FREE_STACK (fail_stack.stack)
|
||||
# define RESET_FAIL_STACK() REGEX_FREE_STACK (fail_stack.stack)
|
||||
#else
|
||||
#define INIT_FAIL_STACK() \
|
||||
# define INIT_FAIL_STACK() \
|
||||
do { \
|
||||
fail_stack.avail = 0; \
|
||||
} while (0)
|
||||
|
||||
#define RESET_FAIL_STACK()
|
||||
# define RESET_FAIL_STACK()
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1185,11 +1194,11 @@ typedef struct
|
||||
|
||||
/* Used to omit pushing failure point id's when we're not debugging. */
|
||||
#ifdef DEBUG
|
||||
#define DEBUG_PUSH PUSH_FAILURE_INT
|
||||
#define DEBUG_POP(item_addr) (item_addr)->integer = POP_FAILURE_INT ()
|
||||
# define DEBUG_PUSH PUSH_FAILURE_INT
|
||||
# define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_INT ()
|
||||
#else
|
||||
#define DEBUG_PUSH(item)
|
||||
#define DEBUG_POP(item_addr)
|
||||
# define DEBUG_PUSH(item)
|
||||
# define DEBUG_POP(item_addr)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1197,8 +1206,8 @@ typedef struct
|
||||
if we ever fail back to it.
|
||||
|
||||
Requires variables fail_stack, regstart, regend, reg_info, and
|
||||
num_regs be declared. DOUBLE_FAIL_STACK requires `destination' be
|
||||
declared.
|
||||
num_regs_pushed be declared. DOUBLE_FAIL_STACK requires `destination'
|
||||
be declared.
|
||||
|
||||
Does `return FAILURE_CODE' if runs out of memory. */
|
||||
|
||||
@@ -1210,7 +1219,7 @@ typedef struct
|
||||
/* Can't be int, since there is not a shred of a guarantee that int \
|
||||
is wide enough to hold a value of something to which pointer can \
|
||||
be assigned */ \
|
||||
s_reg_t this_reg; \
|
||||
active_reg_t this_reg; \
|
||||
\
|
||||
DEBUG_STATEMENT (failure_id++); \
|
||||
DEBUG_STATEMENT (nfailure_points_pushed++); \
|
||||
@@ -1218,7 +1227,7 @@ typedef struct
|
||||
DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\
|
||||
DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\
|
||||
\
|
||||
DEBUG_PRINT2 (" slots needed: %d\n", NUM_FAILURE_ITEMS); \
|
||||
DEBUG_PRINT2 (" slots needed: %ld\n", NUM_FAILURE_ITEMS); \
|
||||
DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \
|
||||
\
|
||||
/* Ensure we have enough space allocated for what we will push. */ \
|
||||
@@ -1239,16 +1248,17 @@ typedef struct
|
||||
for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \
|
||||
this_reg++) \
|
||||
{ \
|
||||
DEBUG_PRINT2 (" Pushing reg: %d\n", this_reg); \
|
||||
DEBUG_PRINT2 (" Pushing reg: %lu\n", this_reg); \
|
||||
DEBUG_STATEMENT (num_regs_pushed++); \
|
||||
\
|
||||
DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \
|
||||
DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \
|
||||
PUSH_FAILURE_POINTER (regstart[this_reg]); \
|
||||
\
|
||||
DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \
|
||||
DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \
|
||||
PUSH_FAILURE_POINTER (regend[this_reg]); \
|
||||
\
|
||||
DEBUG_PRINT2 (" info: 0x%x\n ", reg_info[this_reg]); \
|
||||
DEBUG_PRINT2 (" info: %p\n ", \
|
||||
reg_info[this_reg].word.pointer); \
|
||||
DEBUG_PRINT2 (" match_null=%d", \
|
||||
REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \
|
||||
DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \
|
||||
@@ -1260,17 +1270,17 @@ typedef struct
|
||||
PUSH_FAILURE_ELT (reg_info[this_reg].word); \
|
||||
} \
|
||||
\
|
||||
DEBUG_PRINT2 (" Pushing low active reg: %d\n", lowest_active_reg);\
|
||||
DEBUG_PRINT2 (" Pushing low active reg: %ld\n", lowest_active_reg);\
|
||||
PUSH_FAILURE_INT (lowest_active_reg); \
|
||||
\
|
||||
DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\
|
||||
DEBUG_PRINT2 (" Pushing high active reg: %ld\n", highest_active_reg);\
|
||||
PUSH_FAILURE_INT (highest_active_reg); \
|
||||
\
|
||||
DEBUG_PRINT2 (" Pushing pattern 0x%x:\n", pattern_place); \
|
||||
DEBUG_PRINT2 (" Pushing pattern %p:\n", pattern_place); \
|
||||
DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \
|
||||
PUSH_FAILURE_POINTER (pattern_place); \
|
||||
\
|
||||
DEBUG_PRINT2 (" Pushing string 0x%x: `", string_place); \
|
||||
DEBUG_PRINT2 (" Pushing string %p: `", string_place); \
|
||||
DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \
|
||||
size2); \
|
||||
DEBUG_PRINT1 ("'\n"); \
|
||||
@@ -1286,9 +1296,9 @@ typedef struct
|
||||
|
||||
/* Individual items aside from the registers. */
|
||||
#ifdef DEBUG
|
||||
#define NUM_NONREG_ITEMS 5 /* Includes failure point id. */
|
||||
# define NUM_NONREG_ITEMS 5 /* Includes failure point id. */
|
||||
#else
|
||||
#define NUM_NONREG_ITEMS 4
|
||||
# define NUM_NONREG_ITEMS 4
|
||||
#endif
|
||||
|
||||
/* We push at most this many items on the stack. */
|
||||
@@ -1322,8 +1332,8 @@ typedef struct
|
||||
|
||||
#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\
|
||||
{ \
|
||||
DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \
|
||||
s_reg_t this_reg; \
|
||||
DEBUG_STATEMENT (unsigned failure_id;) \
|
||||
active_reg_t this_reg; \
|
||||
const unsigned char *string_temp; \
|
||||
\
|
||||
assert (!FAIL_STACK_EMPTY ()); \
|
||||
@@ -1345,34 +1355,35 @@ typedef struct
|
||||
if (string_temp != NULL) \
|
||||
str = (const char *) string_temp; \
|
||||
\
|
||||
DEBUG_PRINT2 (" Popping string 0x%x: `", str); \
|
||||
DEBUG_PRINT2 (" Popping string %p: `", str); \
|
||||
DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \
|
||||
DEBUG_PRINT1 ("'\n"); \
|
||||
\
|
||||
pat = (unsigned char *) POP_FAILURE_POINTER (); \
|
||||
DEBUG_PRINT2 (" Popping pattern 0x%x:\n", pat); \
|
||||
DEBUG_PRINT2 (" Popping pattern %p:\n", pat); \
|
||||
DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \
|
||||
\
|
||||
/* Restore register info. */ \
|
||||
high_reg = (active_reg_t) POP_FAILURE_INT (); \
|
||||
DEBUG_PRINT2 (" Popping high active reg: %d\n", high_reg); \
|
||||
DEBUG_PRINT2 (" Popping high active reg: %ld\n", high_reg); \
|
||||
\
|
||||
low_reg = (active_reg_t) POP_FAILURE_INT (); \
|
||||
DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \
|
||||
DEBUG_PRINT2 (" Popping low active reg: %ld\n", low_reg); \
|
||||
\
|
||||
if (1) \
|
||||
for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \
|
||||
{ \
|
||||
DEBUG_PRINT2 (" Popping reg: %d\n", this_reg); \
|
||||
DEBUG_PRINT2 (" Popping reg: %ld\n", this_reg); \
|
||||
\
|
||||
reg_info[this_reg].word = POP_FAILURE_ELT (); \
|
||||
DEBUG_PRINT2 (" info: 0x%x\n", reg_info[this_reg]); \
|
||||
DEBUG_PRINT2 (" info: %p\n", \
|
||||
reg_info[this_reg].word.pointer); \
|
||||
\
|
||||
regend[this_reg] = (const char *) POP_FAILURE_POINTER (); \
|
||||
DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \
|
||||
DEBUG_PRINT2 (" end: %p\n", regend[this_reg]); \
|
||||
\
|
||||
regstart[this_reg] = (const char *) POP_FAILURE_POINTER (); \
|
||||
DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \
|
||||
DEBUG_PRINT2 (" start: %p\n", regstart[this_reg]); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
@@ -1478,7 +1489,7 @@ static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
|
||||
string passed to us by the user to an unsigned char that we can use
|
||||
as an array index (in, e.g., `translate'). */
|
||||
#ifndef PATFETCH
|
||||
#define PATFETCH(c) \
|
||||
# define PATFETCH(c) \
|
||||
do {if (p == pend) return REG_EEND; \
|
||||
c = (unsigned char) *p++; \
|
||||
if (translate) c = (unsigned char) translate[c]; \
|
||||
@@ -1501,7 +1512,7 @@ static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
|
||||
`char *', to avoid warnings when a string constant is passed. But
|
||||
when we use a character as a subscript we must make it unsigned. */
|
||||
#ifndef TRANSLATE
|
||||
#define TRANSLATE(d) \
|
||||
# define TRANSLATE(d) \
|
||||
(translate ? (char) translate[(unsigned char) (d)] : (d))
|
||||
#endif
|
||||
|
||||
@@ -1569,15 +1580,15 @@ static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
|
||||
MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up
|
||||
reallocating to 0 bytes. Such thing is not going to work too well.
|
||||
You have been warned!! */
|
||||
#if defined(_MSC_VER) && !defined(WIN32)
|
||||
#if defined _MSC_VER && !defined WIN32
|
||||
/* Microsoft C 16-bit versions limit malloc to approx 65512 bytes.
|
||||
The REALLOC define eliminates a flurry of conversion warnings,
|
||||
but is not required. */
|
||||
#define MAX_BUF_SIZE 65500L
|
||||
#define REALLOC(p,s) realloc ((p), (size_t) (s))
|
||||
# define MAX_BUF_SIZE 65500L
|
||||
# define REALLOC(p,s) realloc ((p), (size_t) (s))
|
||||
#else
|
||||
#define MAX_BUF_SIZE (1L << 16)
|
||||
#define REALLOC(p,s) realloc ((p), (s))
|
||||
# define MAX_BUF_SIZE (1L << 16)
|
||||
# define REALLOC(p,s) realloc ((p), (s))
|
||||
#endif
|
||||
|
||||
/* Extend the buffer by twice its current size via realloc and
|
||||
@@ -1677,7 +1688,7 @@ typedef struct
|
||||
} \
|
||||
}
|
||||
|
||||
#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||
#if WIDE_CHAR_SUPPORT
|
||||
/* The GNU C library provides support for user-defined character classes
|
||||
and the functions from ISO C amendement 1. */
|
||||
# ifdef CHARCLASS_NAME_MAX
|
||||
@@ -1864,7 +1875,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
/* Always count groups, whether or not bufp->no_sub is set. */
|
||||
bufp->re_nsub = 0;
|
||||
|
||||
#if !defined (emacs) && !defined (SYNTAX_TABLE)
|
||||
#if !defined emacs && !defined SYNTAX_TABLE
|
||||
/* Initialize the syntax table. */
|
||||
init_syntax_once ();
|
||||
#endif
|
||||
@@ -2177,7 +2188,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
the leading `:' and `[' (but set bits for them). */
|
||||
if (c == ':' && *p == ']')
|
||||
{
|
||||
#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
|
||||
#if WIDE_CHAR_SUPPORT
|
||||
boolean is_lower = STREQ (str, "lower");
|
||||
boolean is_upper = STREQ (str, "upper");
|
||||
wctype_t wt;
|
||||
@@ -2378,10 +2389,12 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
if (syntax & RE_NO_BK_PARENS) goto normal_backslash;
|
||||
|
||||
if (COMPILE_STACK_EMPTY)
|
||||
if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
|
||||
goto normal_backslash;
|
||||
else
|
||||
FREE_STACK_RETURN (REG_ERPAREN);
|
||||
{
|
||||
if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
|
||||
goto normal_backslash;
|
||||
else
|
||||
FREE_STACK_RETURN (REG_ERPAREN);
|
||||
}
|
||||
|
||||
handle_close:
|
||||
if (fixup_alt_jump)
|
||||
@@ -2398,10 +2411,12 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
|
||||
/* See similar code for backslashed left paren above. */
|
||||
if (COMPILE_STACK_EMPTY)
|
||||
if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
|
||||
goto normal_char;
|
||||
else
|
||||
FREE_STACK_RETURN (REG_ERPAREN);
|
||||
{
|
||||
if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
|
||||
goto normal_char;
|
||||
else
|
||||
FREE_STACK_RETURN (REG_ERPAREN);
|
||||
}
|
||||
|
||||
/* Since we just checked for an empty stack above, this
|
||||
``can't happen''. */
|
||||
@@ -2841,7 +2856,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
{
|
||||
fail_stack.size = (2 * re_max_failures * MAX_FAILURE_ITEMS);
|
||||
|
||||
#ifdef emacs
|
||||
# ifdef emacs
|
||||
if (! fail_stack.stack)
|
||||
fail_stack.stack
|
||||
= (fail_stack_elt_t *) xmalloc (fail_stack.size
|
||||
@@ -2851,7 +2866,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
= (fail_stack_elt_t *) xrealloc (fail_stack.stack,
|
||||
(fail_stack.size
|
||||
* sizeof (fail_stack_elt_t)));
|
||||
#else /* not emacs */
|
||||
# else /* not emacs */
|
||||
if (! fail_stack.stack)
|
||||
fail_stack.stack
|
||||
= (fail_stack_elt_t *) malloc (fail_stack.size
|
||||
@@ -2861,7 +2876,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
= (fail_stack_elt_t *) realloc (fail_stack.stack,
|
||||
(fail_stack.size
|
||||
* sizeof (fail_stack_elt_t)));
|
||||
#endif /* not emacs */
|
||||
# endif /* not emacs */
|
||||
}
|
||||
|
||||
regex_grow_registers (num_regs);
|
||||
@@ -3540,9 +3555,9 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
|
||||
val = re_match_2_internal (bufp, string1, size1, string2, size2,
|
||||
startpos, regs, stop);
|
||||
#ifndef REGEX_MALLOC
|
||||
#ifdef C_ALLOCA
|
||||
# ifdef C_ALLOCA
|
||||
alloca (0);
|
||||
#endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
if (val >= 0)
|
||||
@@ -3619,8 +3634,8 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
|
||||
|
||||
/* Free everything we malloc. */
|
||||
#ifdef MATCH_MAY_ALLOCATE
|
||||
#define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL
|
||||
#define FREE_VARIABLES() \
|
||||
# define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL
|
||||
# define FREE_VARIABLES() \
|
||||
do { \
|
||||
REGEX_FREE_STACK (fail_stack.stack); \
|
||||
FREE_VAR (regstart); \
|
||||
@@ -3634,7 +3649,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
|
||||
FREE_VAR (reg_info_dummy); \
|
||||
} while (0)
|
||||
#else
|
||||
#define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */
|
||||
# define FREE_VARIABLES() ((void)0) /* Do nothing! But inhibit gcc warning. */
|
||||
#endif /* not MATCH_MAY_ALLOCATE */
|
||||
|
||||
/* These values must meet several constraints. They must not be valid
|
||||
@@ -3661,11 +3676,11 @@ re_match (bufp, string, size, pos, regs)
|
||||
{
|
||||
int result = re_match_2_internal (bufp, NULL, 0, string, size,
|
||||
pos, regs, size);
|
||||
#ifndef REGEX_MALLOC
|
||||
#ifdef C_ALLOCA
|
||||
# ifndef REGEX_MALLOC
|
||||
# ifdef C_ALLOCA
|
||||
alloca (0);
|
||||
#endif
|
||||
#endif
|
||||
# endif
|
||||
# endif
|
||||
return result;
|
||||
}
|
||||
#endif /* not emacs */
|
||||
@@ -3707,9 +3722,9 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
|
||||
int result = re_match_2_internal (bufp, string1, size1, string2, size2,
|
||||
pos, regs, stop);
|
||||
#ifndef REGEX_MALLOC
|
||||
#ifdef C_ALLOCA
|
||||
# ifdef C_ALLOCA
|
||||
alloca (0);
|
||||
#endif
|
||||
# endif
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
@@ -4457,7 +4472,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
|
||||
past them. */
|
||||
if (translate
|
||||
? bcmp_translate (d, d2, mcnt, translate)
|
||||
: bcmp (d, d2, mcnt))
|
||||
: memcmp (d, d2, mcnt))
|
||||
goto fail;
|
||||
d += mcnt, d2 += mcnt;
|
||||
|
||||
@@ -4823,7 +4838,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
|
||||
DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n");
|
||||
/* It doesn't matter what we push for the string here. What
|
||||
the code at `fail' tests is the value for the pattern. */
|
||||
PUSH_FAILURE_POINT (0, 0, -2);
|
||||
PUSH_FAILURE_POINT (NULL, NULL, -2);
|
||||
goto unconditional_jump;
|
||||
|
||||
|
||||
@@ -4836,7 +4851,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
|
||||
DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n");
|
||||
/* See comments just above at `dummy_failure_jump' about the
|
||||
two zeroes. */
|
||||
PUSH_FAILURE_POINT (0, 0, -2);
|
||||
PUSH_FAILURE_POINT (NULL, NULL, -2);
|
||||
break;
|
||||
|
||||
/* Have to succeed matching what follows at least n times.
|
||||
@@ -5410,7 +5425,7 @@ re_compile_pattern (pattern, length, bufp)
|
||||
/* Entry points compatible with 4.2 BSD regex library. We don't define
|
||||
them unless specifically requested. */
|
||||
|
||||
#if defined (_REGEX_RE_COMP) || defined (_LIBC)
|
||||
#if defined _REGEX_RE_COMP || defined _LIBC
|
||||
|
||||
/* BSD has one and only one pattern buffer. */
|
||||
static struct re_pattern_buffer re_comp_buf;
|
||||
@@ -5684,11 +5699,15 @@ regerror (errcode, preg, errbuf, errbuf_size)
|
||||
{
|
||||
if (msg_size > errbuf_size)
|
||||
{
|
||||
strncpy (errbuf, msg, errbuf_size - 1);
|
||||
#if defined HAVE_MEMPCPY || defined _LIBC
|
||||
*((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
|
||||
#else
|
||||
memcpy (errbuf, msg, errbuf_size - 1);
|
||||
errbuf[errbuf_size - 1] = 0;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
strcpy (errbuf, msg);
|
||||
memcpy (errbuf, msg, msg_size);
|
||||
}
|
||||
|
||||
return msg_size;
|
||||
|
||||
50
lib/regex.h
50
lib/regex.h
@@ -2,24 +2,24 @@
|
||||
expression library, version 0.12.
|
||||
Copyright (C) 1985,89,90,91,92,93,95,96,97 Free Software Foundation, Inc.
|
||||
|
||||
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.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
#ifndef _REGEX_H
|
||||
#define _REGEX_H 1
|
||||
@@ -32,10 +32,10 @@ extern "C" {
|
||||
/* POSIX says that <sys/types.h> must be included (by the caller) before
|
||||
<regex.h>. */
|
||||
|
||||
#if !defined (_POSIX_C_SOURCE) && !defined (_POSIX_SOURCE) && defined (VMS)
|
||||
#if !defined _POSIX_C_SOURCE && !defined _POSIX_SOURCE && defined VMS
|
||||
/* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
|
||||
should be there. */
|
||||
#include <stddef.h>
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
|
||||
/* The following two types have to be signed and unsigned integer type
|
||||
@@ -240,7 +240,7 @@ extern reg_syntax_t re_syntax_options;
|
||||
(erroneously) define this in other header files, but we want our
|
||||
value, so remove any previous define. */
|
||||
#ifdef RE_DUP_MAX
|
||||
#undef RE_DUP_MAX
|
||||
# undef RE_DUP_MAX
|
||||
#endif
|
||||
/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */
|
||||
#define RE_DUP_MAX (0x7fff)
|
||||
@@ -283,6 +283,10 @@ extern reg_syntax_t re_syntax_options;
|
||||
`re_error_msg' table in regex.c. */
|
||||
typedef enum
|
||||
{
|
||||
#if (_XOPEN_SOURCE - 0) == 500
|
||||
REG_NOSYS = -1, /* This will never happen for this implementation. */
|
||||
#endif
|
||||
|
||||
REG_NOERROR = 0, /* Success. */
|
||||
REG_NOMATCH, /* Didn't find a match (for regexec). */
|
||||
|
||||
@@ -314,7 +318,7 @@ typedef enum
|
||||
private to the regex routines. */
|
||||
|
||||
#ifndef RE_TRANSLATE_TYPE
|
||||
#define RE_TRANSLATE_TYPE char *
|
||||
# define RE_TRANSLATE_TYPE char *
|
||||
#endif
|
||||
|
||||
struct re_pattern_buffer
|
||||
@@ -405,7 +409,7 @@ struct re_registers
|
||||
`re_match_2' returns information about at least this many registers
|
||||
the first time a `regs' structure is passed. */
|
||||
#ifndef RE_NREGS
|
||||
#define RE_NREGS 30
|
||||
# define RE_NREGS 30
|
||||
#endif
|
||||
|
||||
|
||||
@@ -428,11 +432,11 @@ typedef struct
|
||||
|
||||
#if __STDC__
|
||||
|
||||
#define _RE_ARGS(args) args
|
||||
# define _RE_ARGS(args) args
|
||||
|
||||
#else /* not __STDC__ */
|
||||
|
||||
#define _RE_ARGS(args) ()
|
||||
# define _RE_ARGS(args) ()
|
||||
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
@@ -503,11 +507,11 @@ extern void re_set_registers
|
||||
unsigned num_regs, regoff_t *starts, regoff_t *ends));
|
||||
|
||||
#ifdef _REGEX_RE_COMP
|
||||
#ifndef _CRAY
|
||||
# ifndef _CRAY
|
||||
/* 4.2 bsd compatibility. */
|
||||
extern char *re_comp _RE_ARGS ((const char *));
|
||||
extern int re_exec _RE_ARGS ((const char *));
|
||||
#endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* POSIX compatibility. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* safe-read.c -- an interface to read that retries after interrupts
|
||||
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 1994, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -31,17 +31,16 @@
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#include "safe-read.h"
|
||||
|
||||
/* Read LEN bytes at PTR from descriptor DESC, retrying if interrupted.
|
||||
Return the actual number of bytes read, zero for EOF, or negative
|
||||
for an error. */
|
||||
|
||||
int
|
||||
safe_read (desc, ptr, len)
|
||||
int desc;
|
||||
char *ptr;
|
||||
int len;
|
||||
ssize_t
|
||||
safe_read (int desc, char *ptr, size_t len)
|
||||
{
|
||||
int n_chars;
|
||||
ssize_t n_chars;
|
||||
|
||||
if (len <= 0)
|
||||
return len;
|
||||
|
||||
10
lib/safe-read.h
Normal file
10
lib/safe-read.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
ssize_t
|
||||
safe_read PARAMS ((int desc, char *ptr, size_t len));
|
||||
@@ -1,5 +1,5 @@
|
||||
/* save-cwd.c -- Save and restore current working directory.
|
||||
Copyright (C) 1995, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
/* Written by Jim Meyering <meyering@na-net.ornl.gov>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#if HAVE_FCNTL_H
|
||||
# include <fcntl.h>
|
||||
#else
|
||||
# include <sys/file.h>
|
||||
@@ -67,7 +67,7 @@ save_cwd (cwd)
|
||||
|
||||
if (have_working_fchdir)
|
||||
{
|
||||
#ifdef HAVE_FCHDIR
|
||||
#if HAVE_FCHDIR
|
||||
cwd->desc = open (".", O_RDONLY);
|
||||
if (cwd->desc < 0)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* savedir.c -- save the list of files in a directory in a string
|
||||
Copyright (C) 1990, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -17,13 +17,13 @@
|
||||
|
||||
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
12
lib/stat.c
12
lib/stat.c
@@ -1,7 +1,7 @@
|
||||
/* Work around the bug in some systems whereby stat succeeds when
|
||||
given the zero-length file name argument. The stat from SunOS4.1.4
|
||||
has this bug.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -33,7 +33,13 @@
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
/* FIXME: describe. */
|
||||
/* This is a wrapper for stat(2).
|
||||
If FILE is the empty string, fail with errno == ENOENT.
|
||||
Otherwise, return the result of calling the real stat.
|
||||
|
||||
This works around the bug in some systems whereby stat succeeds when
|
||||
given the zero-length file name argument. The stat from SunOS4.1.4
|
||||
has this bug. */
|
||||
|
||||
int
|
||||
rpl_stat (file, sbuf)
|
||||
@@ -42,7 +48,7 @@ rpl_stat (file, sbuf)
|
||||
{
|
||||
if (file && *file == 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
errno = ENOENT;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 1992, 1995, 1997 Free Software Foundation, Inc.
|
||||
/* stpcpy.c -- copy a string and return pointer to end of new string
|
||||
Copyright (C) 1992, 1995, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
10
lib/strdup.c
10
lib/strdup.c
@@ -1,5 +1,5 @@
|
||||
/* strdup.c -- return a newly allocated copy of a string
|
||||
Copyright (C) 1990 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -15,13 +15,13 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
char *malloc ();
|
||||
char *strcpy ();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991,92,93,94,95,96,97,98 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
@@ -490,7 +490,7 @@ my_strftime (s, maxsize, format, tp)
|
||||
|
||||
for (f = format; *f != '\0'; ++f)
|
||||
{
|
||||
int pad; /* Padding for number ('-', '_', or 0). */
|
||||
int pad = 0; /* Padding for number ('-', '_', or 0). */
|
||||
int modifier; /* Field modifier ('E', 'O', or 0). */
|
||||
int digits; /* Max digits for numeric format. */
|
||||
int number_value; /* Numeric value to be printed. */
|
||||
@@ -580,7 +580,6 @@ my_strftime (s, maxsize, format, tp)
|
||||
#endif /* ! DO_MULTIBYTE */
|
||||
|
||||
/* Check for flags that can modify a format. */
|
||||
pad = 0;
|
||||
while (1)
|
||||
{
|
||||
switch (*++f)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* userspec.c -- Parse a user and group string.
|
||||
Copyright (C) 1989, 1990, 1991, 1992, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989, 1990, 1991, 1992, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -24,7 +24,7 @@
|
||||
#ifdef __GNUC__
|
||||
# define alloca __builtin_alloca
|
||||
#else
|
||||
# ifdef HAVE_ALLOCA_H
|
||||
# if HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
# else
|
||||
# ifdef _AIX
|
||||
@@ -85,7 +85,9 @@ struct group *getgrgid ();
|
||||
|
||||
#define isdigit(c) ((c) >= '0' && (c) <= '9')
|
||||
|
||||
#ifndef strdup
|
||||
char *strdup ();
|
||||
#endif
|
||||
|
||||
/* Return nonzero if STR represents an unsigned decimal integer,
|
||||
otherwise return 0. */
|
||||
@@ -153,6 +155,15 @@ parse_user_spec (spec_arg, uid, gid, username_arg, groupname_arg)
|
||||
if (u == NULL && g == NULL)
|
||||
return "can not omit both user and group";
|
||||
|
||||
#ifdef __DJGPP__
|
||||
/* Pretend that we are the user U whose group is G. This makes
|
||||
pwd and grp functions ``know'' about the UID and GID of these. */
|
||||
if (u && !is_number (u))
|
||||
setenv ("USER", u, 1);
|
||||
if (g && !is_number (g))
|
||||
setenv ("GROUP", g, 1);
|
||||
#endif
|
||||
|
||||
if (u != NULL)
|
||||
{
|
||||
pwd = getpwnam (u);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* xstrdup.c -- copy a string with out of memory checking
|
||||
Copyright (C) 1990, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1996, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -19,24 +19,28 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if STDC_HEADERS || HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
char *xmalloc (size_t);
|
||||
char *xstrdup (char *string);
|
||||
#else
|
||||
char *xmalloc ();
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
|
||||
char *xmalloc PARAMS ((size_t n));
|
||||
|
||||
/* Return a newly allocated copy of STRING. */
|
||||
|
||||
char *
|
||||
xstrdup (string)
|
||||
char *string;
|
||||
xstrdup (const char *string)
|
||||
{
|
||||
return strcpy (xmalloc (strlen (string) + 1), string);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#ifndef XSTRTOD_H
|
||||
# define XSTRTOD_H 1
|
||||
|
||||
#undef PARAMS
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# define PARAMS(Args) Args
|
||||
#else
|
||||
# define PARAMS(Args) ()
|
||||
#endif
|
||||
# ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
# endif
|
||||
|
||||
int
|
||||
xstrtod PARAMS ((const char *str, const char **ptr, double *result));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* A more useful interface to strtol.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -46,27 +46,45 @@ extern int errno;
|
||||
# include <limits.h>
|
||||
#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) 0 - TYPE_MINIMUM (t))
|
||||
|
||||
#ifndef ULONG_MAX
|
||||
# define ULONG_MAX ((unsigned long) ~(unsigned long) 0)
|
||||
# define ULONG_MAX TYPE_MAXIMUM (unsigned long int)
|
||||
#endif
|
||||
|
||||
#ifndef LONG_MAX
|
||||
# define LONG_MAX ((long int) (ULONG_MAX >> 1))
|
||||
# define LONG_MAX TYPE_MAXIMUM (long int)
|
||||
#endif
|
||||
|
||||
#include "xstrtol.h"
|
||||
|
||||
#define BKM_SCALE(x, scale_factor, error_return) \
|
||||
do \
|
||||
{ \
|
||||
if ((x) > (double) __ZLONG_MAX / (scale_factor)) \
|
||||
return (error_return); \
|
||||
(x) *= (scale_factor); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
__unsigned long int __strtol ();
|
||||
|
||||
static int
|
||||
bkm_scale (x, scale_factor)
|
||||
__unsigned long int *x;
|
||||
int scale_factor;
|
||||
{
|
||||
/* The cast to `__unsigned long int' before the cast to double is
|
||||
required to work around a bug in SunOS's /bin/cc. */
|
||||
if (*x > (double) ((__unsigned long int) __ZLONG_MAX) / scale_factor)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
*x *= scale_factor;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* FIXME: comment. */
|
||||
|
||||
strtol_error
|
||||
@@ -109,7 +127,8 @@ __xstrtol (s, ptr, base, val, valid_suffixes)
|
||||
switch (**p)
|
||||
{
|
||||
case 'b':
|
||||
BKM_SCALE (tmp, 512, LONGINT_OVERFLOW);
|
||||
if (bkm_scale (&tmp, 512))
|
||||
return LONGINT_OVERFLOW;
|
||||
++(*p);
|
||||
break;
|
||||
|
||||
@@ -119,17 +138,20 @@ __xstrtol (s, ptr, base, val, valid_suffixes)
|
||||
|
||||
case 'B':
|
||||
case 'k':
|
||||
BKM_SCALE (tmp, 1024, LONGINT_OVERFLOW);
|
||||
if (bkm_scale (&tmp, 1024))
|
||||
return LONGINT_OVERFLOW;
|
||||
++(*p);
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
BKM_SCALE (tmp, 1024 * 1024, LONGINT_OVERFLOW);
|
||||
if (bkm_scale (&tmp, 1024 * 1024))
|
||||
return LONGINT_OVERFLOW;
|
||||
++(*p);
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
BKM_SCALE (tmp, 2, LONGINT_OVERFLOW);
|
||||
if (bkm_scale (&tmp, 2))
|
||||
return LONGINT_OVERFLOW;
|
||||
++(*p);
|
||||
break;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* yesno.c -- read a yes/no response from stdin
|
||||
Copyright (C) 1990 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -15,12 +15,12 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
|
||||
76
m4/ChangeLog
76
m4/ChangeLog
@@ -1,3 +1,79 @@
|
||||
1998-05-19 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* jm-macros.m4: Add jm_FUNC_LCHOWN.
|
||||
* lchown.m4: New file.
|
||||
|
||||
* Makefile.am.in: New file.
|
||||
* Makefile.am (Makefile.am): Depend on Makefile.am.in.
|
||||
|
||||
1998-05-14 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add them.
|
||||
* jm-macros.m4: New file.
|
||||
* utimbuf.m4: New file.
|
||||
|
||||
1998-05-12 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add isc-posix.m4.
|
||||
|
||||
1998-05-11 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* isc-posix.m4: New file.
|
||||
|
||||
1998-05-10 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* jm-mktime.m4: Use AM_FUNC_MKTIME, now that it's up to date.
|
||||
|
||||
1998-05-09 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add ssize_t.m4.
|
||||
(EXTRA_DIST): Remove mktime.m4, now that the new version is included
|
||||
with automake.
|
||||
|
||||
* ssize_t.m4: New file.
|
||||
* mktime.m4: Remove file -- the new automake has this now.
|
||||
|
||||
1998-04-26 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* assert.m4: New file.
|
||||
* Makefile.am (EXTRA_DIST): Add assert.m4.
|
||||
|
||||
1998-04-05 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* prereq.m4 (jm_PREREQ_REGEX): New macro.
|
||||
(jm_PREREQ): Use it here.
|
||||
|
||||
1998-03-23 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* inttypes_h.m4: Kludges so I don't have to add HAVE_INTTYPES_H
|
||||
in acconfig.h.
|
||||
|
||||
1998-03-15 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* prereq.m4: New file.
|
||||
* error.m4: New file.
|
||||
* Makefile.am (EXTRA_DIST): Add error.m4 and prereq.m4.
|
||||
|
||||
1998-02-07 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* getline.m4: Don't set am_cv_func_working_getline before the
|
||||
cache-check for the same variable -- that defeated the purpose of
|
||||
the test; the test program was never run. This was a problem only
|
||||
on systems with losing getline functions -- HP-UX 10.20 is one.
|
||||
Reported by Bjorn Helgaas.
|
||||
|
||||
1998-02-06 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add perl.m4.
|
||||
|
||||
1998-01-10 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add const.m4.
|
||||
|
||||
* const.m4: New file. Use an initializer in this declaration
|
||||
typedef int charset[2]; const charset x;
|
||||
Reported by Bob Glickstein.
|
||||
|
||||
1997-12-21 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* chown.m4: Fix reversed types on -1 args to chown.
|
||||
|
||||
@@ -1,11 +1,23 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
|
||||
# Generate this list with
|
||||
# find . -type f -name '*.m4' -printf '%f\n'|sort |fmt |tr '\012' @ \
|
||||
# |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012'
|
||||
EXTRA_DIST = README \
|
||||
check-decl.m4 chown.m4 d-ino.m4 d-type.m4 decl.m4 getgroups.m4 getline.m4 \
|
||||
getloadavg.m4 inttypes_h.m4 jm-mktime.m4 jm-winsz1.m4 jm-winsz2.m4 lfs.m4 \
|
||||
lstat.m4 malloc.m4 memcmp.m4 putenv.m4 readdir.m4 realloc.m4 \
|
||||
stat.m4 strftime.m4 uintmax_t.m4 uptime.m4 \
|
||||
mktime.m4
|
||||
##m4-files-begin
|
||||
EXTRA_DIST = README Makefile.am.in assert.m4 check-decl.m4 chown.m4 \
|
||||
const.m4 d-ino.m4 d-type.m4 decl.m4 error.m4 getgroups.m4 getline.m4 \
|
||||
getloadavg.m4 inttypes_h.m4 isc-posix.m4 jm-macros.m4 jm-mktime.m4 \
|
||||
jm-winsz1.m4 jm-winsz2.m4 lchown.m4 lfs.m4 lstat.m4 malloc.m4 memcmp.m4 \
|
||||
perl.m4 prereq.m4 putenv.m4 readdir.m4 realloc.m4 ssize_t.m4 stat.m4 \
|
||||
strftime.m4 uintmax_t.m4 uptime.m4 utimbuf.m4
|
||||
|
||||
##m4-files-end
|
||||
|
||||
Makefile.am: Makefile.am.in
|
||||
rm -f $@ $@t
|
||||
sed -n '1,/^##m4-files-begin/p' $< > $@t
|
||||
( echo EXTRA_DIST = README Makefile.am.in; \
|
||||
find . -type f -name '*.m4' -print |sed 's,^\./,,' |sort ) \
|
||||
|fmt | (tr '\012' @; echo) \
|
||||
|sed 's/@$$/%/;s/@/ \\@/g' |tr @% '\012\012' \
|
||||
>> $@t
|
||||
sed -n '/^##m4-files-end/,$$p' $< >> $@t
|
||||
chmod a-w $@t
|
||||
mv $@t $@
|
||||
|
||||
16
m4/Makefile.am.in
Normal file
16
m4/Makefile.am.in
Normal file
@@ -0,0 +1,16 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
|
||||
##m4-files-begin
|
||||
##m4-files-end
|
||||
|
||||
Makefile.am: Makefile.am.in
|
||||
rm -f $@ $@t
|
||||
sed -n '1,/^##m4-files-begin/p' $< > $@t
|
||||
( echo EXTRA_DIST = README Makefile.am.in; \
|
||||
find . -type f -name '*.m4' -print |sed 's,^\./,,' |sort ) \
|
||||
|fmt | (tr '\012' @; echo) \
|
||||
|sed 's/@$$/%/;s/@/ \\@/g' |tr @% '\012\012' \
|
||||
>> $@t
|
||||
sed -n '/^##m4-files-end/,$$p' $< >> $@t
|
||||
chmod a-w $@t
|
||||
mv $@t $@
|
||||
@@ -1,6 +1,6 @@
|
||||
# Makefile.in generated automatically by automake 1.2d from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.3 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998 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.
|
||||
@@ -10,10 +10,6 @@
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Generate this list with
|
||||
# find . -type f -name '*.m4' -printf '%f\n'|sort |fmt |tr '\012' @ \
|
||||
# |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012'
|
||||
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
@@ -36,6 +32,8 @@ mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DISTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
@@ -64,38 +62,40 @@ CATOBJEXT = @CATOBJEXT@
|
||||
CC = @CC@
|
||||
CPP = @CPP@
|
||||
DATADIRNAME = @DATADIRNAME@
|
||||
DF_PROG = @DF_PROG@
|
||||
GENCAT = @GENCAT@
|
||||
GMOFILES = @GMOFILES@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GT_NO = @GT_NO@
|
||||
GT_YES = @GT_YES@
|
||||
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
MVDIR_PROG = @MVDIR_PROG@
|
||||
PACKAGE = @PACKAGE@
|
||||
PERL = @PERL@
|
||||
POFILES = @POFILES@
|
||||
POSUB = @POSUB@
|
||||
POW_LIBM = @POW_LIBM@
|
||||
RANLIB = @RANLIB@
|
||||
U = @U@
|
||||
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
YACC = @YACC@
|
||||
l = @l@
|
||||
|
||||
EXTRA_DIST = README \
|
||||
check-decl.m4 chown.m4 d-ino.m4 d-type.m4 decl.m4 getgroups.m4 getline.m4 \
|
||||
getloadavg.m4 inttypes_h.m4 jm-mktime.m4 jm-winsz1.m4 jm-winsz2.m4 lfs.m4 \
|
||||
lstat.m4 malloc.m4 memcmp.m4 putenv.m4 readdir.m4 realloc.m4 \
|
||||
stat.m4 strftime.m4 uintmax_t.m4 uptime.m4 \
|
||||
mktime.m4
|
||||
EXTRA_DIST = README Makefile.am.in assert.m4 check-decl.m4 chown.m4 \
|
||||
const.m4 d-ino.m4 d-type.m4 decl.m4 error.m4 getgroups.m4 getline.m4 \
|
||||
getloadavg.m4 inttypes_h.m4 isc-posix.m4 jm-macros.m4 jm-mktime.m4 \
|
||||
jm-winsz1.m4 jm-winsz2.m4 lchown.m4 lfs.m4 lstat.m4 malloc.m4 memcmp.m4 \
|
||||
perl.m4 prereq.m4 putenv.m4 readdir.m4 realloc.m4 ssize_t.m4 stat.m4 \
|
||||
strftime.m4 uintmax_t.m4 uptime.m4 utimbuf.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
@@ -106,13 +106,13 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP = --best
|
||||
default: all
|
||||
all: Makefile
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnits m4/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@@ -152,8 +152,6 @@ install: install-exec install-data all
|
||||
|
||||
uninstall:
|
||||
|
||||
all: Makefile
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs:
|
||||
@@ -184,12 +182,24 @@ maintainer-clean: maintainer-clean-generic distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
.PHONY: default tags distdir info dvi installcheck install-exec \
|
||||
install-data install uninstall all installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
.PHONY: tags distdir info dvi installcheck install-exec install-data \
|
||||
install uninstall all installdirs mostlyclean-generic distclean-generic \
|
||||
clean-generic maintainer-clean-generic clean mostlyclean distclean \
|
||||
maintainer-clean
|
||||
|
||||
|
||||
Makefile.am: Makefile.am.in
|
||||
rm -f $@ $@t
|
||||
sed -n '1,/^##m4-files-begin/p' $< > $@t
|
||||
( echo EXTRA_DIST = README Makefile.am.in; \
|
||||
find . -type f -name '*.m4' -print |sed 's,^\./,,' |sort ) \
|
||||
|fmt | (tr '\012' @; echo) \
|
||||
|sed 's/@$$/%/;s/@/ \\@/g' |tr @% '\012\012' \
|
||||
>> $@t
|
||||
sed -n '/^##m4-files-end/,$$p' $< >> $@t
|
||||
chmod a-w $@t
|
||||
mv $@t $@
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
||||
@@ -2,3 +2,7 @@ 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
|
||||
this distribution.
|
||||
|
||||
The Makefile.am file in this directory is automatically generated
|
||||
from the template file, Makefile.am.in. The generation will fail
|
||||
if you don't have all the right tools.
|
||||
|
||||
13
m4/assert.m4
Normal file
13
m4/assert.m4
Normal file
@@ -0,0 +1,13 @@
|
||||
#serial 1
|
||||
dnl based on code from Eleftherios Gkioulekas
|
||||
|
||||
AC_DEFUN(jm_ASSERT,
|
||||
[
|
||||
AC_MSG_CHECKING(whether to enable assertions)
|
||||
AC_ARG_ENABLE(assert,
|
||||
[ --disable-assert turn off assertions],
|
||||
[ AC_MSG_RESULT(no)
|
||||
AC_DEFINE(NDEBUG) ],
|
||||
[ AC_MSG_RESULT(yes) ]
|
||||
)
|
||||
])
|
||||
66
m4/const.m4
Normal file
66
m4/const.m4
Normal file
@@ -0,0 +1,66 @@
|
||||
#serial 1
|
||||
|
||||
dnl Just like AC_C_CONST from autoconf-2.12, but with an initializer
|
||||
dnl for `charset x' and with
|
||||
dnl AC_DEFINE(const, )
|
||||
dnl changed to
|
||||
dnl AC_DEFINE_UNQUOTED(const, [/* empty */])
|
||||
dnl to avoid this warning:
|
||||
dnl [...]/m4: Warning: Excess arguments to built-in `define' ignored
|
||||
|
||||
undefine([AC_C_CONST])
|
||||
AC_DEFUN(AC_C_CONST,
|
||||
[dnl This message is consistent in form with the other checking messages,
|
||||
dnl and with the result message.
|
||||
AC_CACHE_CHECK([for working const], ac_cv_c_const,
|
||||
[AC_TRY_COMPILE(,
|
||||
changequote(<<, >>)dnl
|
||||
<<
|
||||
/* Ultrix mips cc rejects this. */
|
||||
typedef int charset[2]; const charset x = {0, 0};
|
||||
/* SunOS 4.1.1 cc rejects this. */
|
||||
char const *const *ccp;
|
||||
char **p;
|
||||
/* NEC SVR4.0.2 mips cc rejects this. */
|
||||
struct point {int x, y;};
|
||||
static struct point const zero = {0,0};
|
||||
/* AIX XL C 1.02.0.0 rejects this.
|
||||
It does not let you subtract one const X* pointer from another in an arm
|
||||
of an if-expression whose if-part is not a constant expression */
|
||||
const char *g = "string";
|
||||
ccp = &g + (g ? g-g : 0);
|
||||
/* HPUX 7.0 cc rejects these. */
|
||||
++ccp;
|
||||
p = (char**) ccp;
|
||||
ccp = (char const *const *) p;
|
||||
{ /* SCO 3.2v4 cc rejects this. */
|
||||
char *t;
|
||||
char const *s = 0 ? (char *) 0 : (char const *) 0;
|
||||
|
||||
*t++ = 0;
|
||||
}
|
||||
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
|
||||
int x[] = {25, 17};
|
||||
const int *foo = &x[0];
|
||||
++foo;
|
||||
}
|
||||
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
|
||||
typedef const int *iptr;
|
||||
iptr p = 0;
|
||||
++p;
|
||||
}
|
||||
{ /* AIX XL C 1.02.0.0 rejects this saying
|
||||
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
|
||||
struct s { int j; const int *ap[3]; };
|
||||
struct s *b; b->j = 5;
|
||||
}
|
||||
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
|
||||
const int foo = 10;
|
||||
}
|
||||
>>,
|
||||
changequote([, ])dnl
|
||||
ac_cv_c_const=yes, ac_cv_c_const=no)])
|
||||
if test $ac_cv_c_const = no; then
|
||||
AC_DEFINE_UNQUOTED(const, [/* empty */])
|
||||
fi
|
||||
])
|
||||
11
m4/error.m4
Normal file
11
m4/error.m4
Normal file
@@ -0,0 +1,11 @@
|
||||
#serial 1
|
||||
|
||||
dnl FIXME: put these prerequisite-only *.m4 files in a separate
|
||||
dnl directory -- otherwise, they'll conflict with existing files.
|
||||
|
||||
dnl These are the prerequisite macros for GNU's error.c file.
|
||||
AC_DEFUN(jm_PREREQ_ERROR,
|
||||
[
|
||||
AC_CHECK_FUNCS(strerror strerror_r vprintf doprnt)
|
||||
AC_HEADER_STDC
|
||||
])
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 2
|
||||
#serial 3
|
||||
|
||||
dnl See if there's a working, system-supplied version of the getline function.
|
||||
dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
|
||||
@@ -7,7 +7,6 @@ dnl to do with the function we need.
|
||||
AC_DEFUN(AM_FUNC_GETLINE,
|
||||
[dnl
|
||||
am_getline_needs_run_time_check=no
|
||||
am_cv_func_working_getline=yes
|
||||
AC_CHECK_FUNC(getline,
|
||||
dnl Found it in some library. Verify that it works.
|
||||
am_getline_needs_run_time_check=yes,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 1
|
||||
#serial 2
|
||||
|
||||
dnl From Paul Eggert.
|
||||
|
||||
@@ -7,6 +7,12 @@ dnl From Paul Eggert.
|
||||
|
||||
AC_DEFUN(jm_AC_HEADER_INTTYPES_H,
|
||||
[
|
||||
if test x = y; then
|
||||
dnl This code is deliberately never run via ./configure.
|
||||
dnl FIXME: this is a gross hack to make autoheader put an entry
|
||||
dnl for `HAVE_INTTYPES_H' in config.h.in.
|
||||
AC_CHECK_FUNCS(INTTYPES_H)
|
||||
fi
|
||||
AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
|
||||
[AC_TRY_COMPILE(
|
||||
[#include <sys/types.h>
|
||||
@@ -15,6 +21,7 @@ AC_DEFUN(jm_AC_HEADER_INTTYPES_H,
|
||||
jm_ac_cv_header_inttypes_h=yes,
|
||||
jm_ac_cv_header_inttypes_h=no)])
|
||||
if test $jm_ac_cv_header_inttypes_h = yes; then
|
||||
AC_DEFINE(HAVE_INTTYPES_H)
|
||||
ac_kludge=HAVE_INTTYPES_H
|
||||
AC_DEFINE_UNQUOTED($ac_kludge)
|
||||
fi
|
||||
])
|
||||
|
||||
16
m4/isc-posix.m4
Normal file
16
m4/isc-posix.m4
Normal file
@@ -0,0 +1,16 @@
|
||||
#serial 1
|
||||
dnl This test replaces the one in autoconf.
|
||||
dnl Currently this macro should have the same name as the autoconf macro
|
||||
dnl because gettext's gettext.m4 (distributed in the automake package)
|
||||
dnl still uses it. Otherwise, the use in gettext.m4 makes autoheader
|
||||
dnl give these diagnostics:
|
||||
dnl configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
|
||||
dnl configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
|
||||
|
||||
undefine([AC_ISC_POSIX])
|
||||
AC_DEFUN(AC_ISC_POSIX,
|
||||
[
|
||||
dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
|
||||
AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
|
||||
]
|
||||
)
|
||||
30
m4/jm-macros.m4
Normal file
30
m4/jm-macros.m4
Normal file
@@ -0,0 +1,30 @@
|
||||
#serial 1
|
||||
|
||||
dnl Misc type-related macros for fileutils, sh-utils, textutils.
|
||||
|
||||
AC_DEFUN(jm_MACROS,
|
||||
[
|
||||
dnl This macro actually runs replacement code. See isc-posix.m4.
|
||||
AC_REQUIRE([AC_ISC_POSIX])dnl
|
||||
|
||||
AC_REQUIRE([jm_ASSERT])
|
||||
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
|
||||
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
|
||||
AC_REQUIRE([jm_TYPE_SSIZE_T])
|
||||
AC_REQUIRE([jm_STRUCT_UTIMBUF])
|
||||
AC_REQUIRE([jm_STRUCT_DIRENT_D_TYPE])
|
||||
AC_REQUIRE([jm_STRUCT_DIRENT_D_INO])
|
||||
AC_REQUIRE([jm_CHECK_DECLS])
|
||||
|
||||
AC_REQUIRE([jm_PREREQ])
|
||||
|
||||
AC_REQUIRE([jm_FUNC_LCHOWN])
|
||||
AC_REQUIRE([jm_FUNC_CHOWN])
|
||||
AC_REQUIRE([jm_FUNC_MKTIME])
|
||||
AC_REQUIRE([jm_FUNC_LSTAT])
|
||||
AC_REQUIRE([jm_FUNC_STAT])
|
||||
AC_REQUIRE([jm_FUNC_REALLOC])
|
||||
AC_REQUIRE([jm_FUNC_MALLOC])
|
||||
AC_REQUIRE([jm_FUNC_READDIR])
|
||||
AC_REQUIRE([jm_FUNC_MEMCMP])
|
||||
])
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 2
|
||||
#serial 3
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl If you use this macro in a package, you should
|
||||
@@ -7,12 +7,12 @@ dnl /* Define to rpl_mktime if the replacement function should be used. */
|
||||
dnl #undef mktime
|
||||
dnl
|
||||
AC_DEFUN(jm_FUNC_MKTIME,
|
||||
[AC_REQUIRE([jm_AM_FUNC_MKTIME])dnl
|
||||
[AC_REQUIRE([AM_FUNC_MKTIME])dnl
|
||||
|
||||
dnl mktime.c uses localtime_r if it exists. Check for it.
|
||||
AC_CHECK_FUNCS(localtime_r)
|
||||
|
||||
if test $jm_am_cv_func_working_mktime = no; then
|
||||
if test $am_cv_func_working_mktime = no; then
|
||||
AC_DEFINE_UNQUOTED(mktime, rpl_mktime)
|
||||
fi
|
||||
])
|
||||
|
||||
10
m4/lchown.m4
Normal file
10
m4/lchown.m4
Normal file
@@ -0,0 +1,10 @@
|
||||
#serial 1
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl Provide lchown on systems that lack it.
|
||||
|
||||
AC_DEFUN(jm_FUNC_LCHOWN,
|
||||
[
|
||||
AC_REQUIRE([AC_TYPE_UID_T])
|
||||
AC_REPLACE_FUNCS(lchown)
|
||||
])
|
||||
144
m4/mktime.m4
144
m4/mktime.m4
@@ -1,144 +0,0 @@
|
||||
#serial 103
|
||||
dnl FIXME: when this goes back into automake, reset this to a small number
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl FIXME: this should migrate into libit.
|
||||
|
||||
dnl FIXME: when this goes back into automake, remove all jm_ prefixes
|
||||
|
||||
AC_DEFUN(jm_AM_FUNC_MKTIME,
|
||||
[AC_REQUIRE([AC_HEADER_TIME])dnl
|
||||
AC_CHECK_HEADERS(sys/time.h unistd.h)
|
||||
AC_CHECK_FUNCS(alarm)
|
||||
AC_CACHE_CHECK([for working mktime], jm_am_cv_func_working_mktime,
|
||||
[AC_TRY_RUN(
|
||||
changequote(<<, >>)dnl
|
||||
<</* Test program from Paul Eggert (eggert@twinsun.com)
|
||||
and Tony Leneis (tony@plaza.ds.adp.com). */
|
||||
#if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if !HAVE_ALARM
|
||||
# define alarm(X) /* empty */
|
||||
#endif
|
||||
|
||||
/* Work around redefinition to rpl_putenv by other config tests. */
|
||||
#undef putenv
|
||||
|
||||
static time_t time_t_max;
|
||||
|
||||
/* Values we'll use to set the TZ environment variable. */
|
||||
static const char *const tz_strings[] = {
|
||||
(const char *) 0, "GMT0", "JST-9",
|
||||
"EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
|
||||
};
|
||||
#define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
|
||||
|
||||
static void
|
||||
mktime_test (now)
|
||||
time_t now;
|
||||
{
|
||||
struct tm *lt;
|
||||
if ((lt = localtime (&now)) && mktime (lt) != now)
|
||||
exit (1);
|
||||
now = time_t_max - now;
|
||||
if ((lt = localtime (&now)) && mktime (lt) != now)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
static void
|
||||
irix_6_4_bug ()
|
||||
{
|
||||
/* Based on code from Ariel Faigon. */
|
||||
struct tm tm;
|
||||
tm.tm_year = 96;
|
||||
tm.tm_mon = 3;
|
||||
tm.tm_mday = 0;
|
||||
tm.tm_hour = 0;
|
||||
tm.tm_min = 0;
|
||||
tm.tm_sec = 0;
|
||||
tm.tm_isdst = -1;
|
||||
mktime (&tm);
|
||||
if (tm.tm_mon != 2 || tm.tm_mday != 31)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
static void
|
||||
bigtime_test (j)
|
||||
int j;
|
||||
{
|
||||
struct tm tm;
|
||||
time_t now;
|
||||
tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
|
||||
/* This test makes some buggy mktime implementations loop.
|
||||
Give up after 10 seconds. */
|
||||
alarm (10);
|
||||
now = mktime (&tm);
|
||||
alarm (0);
|
||||
if (now != (time_t) -1)
|
||||
{
|
||||
struct tm *lt = localtime (&now);
|
||||
if (! (lt
|
||||
&& lt->tm_year == tm.tm_year
|
||||
&& lt->tm_mon == tm.tm_mon
|
||||
&& lt->tm_mday == tm.tm_mday
|
||||
&& lt->tm_hour == tm.tm_hour
|
||||
&& lt->tm_min == tm.tm_min
|
||||
&& lt->tm_sec == tm.tm_sec
|
||||
&& lt->tm_yday == tm.tm_yday
|
||||
&& lt->tm_wday == tm.tm_wday
|
||||
&& ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
|
||||
== (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
time_t t, delta;
|
||||
int i, j;
|
||||
|
||||
for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
|
||||
continue;
|
||||
time_t_max--;
|
||||
delta = time_t_max / 997; /* a suitable prime number */
|
||||
for (i = 0; i < N_STRINGS; i++)
|
||||
{
|
||||
if (tz_strings[i])
|
||||
putenv (tz_strings[i]);
|
||||
|
||||
for (t = 0; t <= time_t_max - delta; t += delta)
|
||||
mktime_test (t);
|
||||
mktime_test ((time_t) 60 * 60);
|
||||
mktime_test ((time_t) 60 * 60 * 24);
|
||||
|
||||
for (j = 1; 0 < j; j *= 2)
|
||||
bigtime_test (j);
|
||||
bigtime_test (j - 1);
|
||||
}
|
||||
irix_6_4_bug ();
|
||||
exit (0);
|
||||
}
|
||||
>>,
|
||||
changequote([, ])dnl
|
||||
jm_am_cv_func_working_mktime=yes, jm_am_cv_func_working_mktime=no,
|
||||
dnl When crosscompiling, assume mktime is missing or broken.
|
||||
jm_am_cv_func_working_mktime=no)
|
||||
])
|
||||
if test $jm_am_cv_func_working_mktime = no; then
|
||||
LIBOBJS="$LIBOBJS mktime.o"
|
||||
fi
|
||||
])
|
||||
39
m4/perl.m4
Normal file
39
m4/perl.m4
Normal file
@@ -0,0 +1,39 @@
|
||||
#serial 1
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl Find a new-enough version of Perl.
|
||||
dnl
|
||||
|
||||
AC_DEFUN(jm_PERL,
|
||||
[
|
||||
dnl FIXME: don't hard-code 5.003
|
||||
dnl FIXME: should we cache the result?
|
||||
AC_MSG_CHECKING([for perl5.003 or newer])
|
||||
if test "${PERL+set}" = set; then
|
||||
# `PERL' is set in the user's environment.
|
||||
candidate_perl_names="$PERL"
|
||||
perl_specified=yes
|
||||
else
|
||||
candidate_perl_names='perl perl5'
|
||||
perl_specified=no
|
||||
fi
|
||||
|
||||
found=no
|
||||
AC_SUBST(PERL)
|
||||
PERL="$missing_dir/missing perl"
|
||||
for perl in $candidate_perl_names; do
|
||||
# Run test in a subshell; some versions of sh will print an error if
|
||||
# an executable is not found, even if stderr is redirected.
|
||||
if ( $perl -e 'require 5.003' ) > /dev/null 2>&1; then
|
||||
PERL=$perl
|
||||
found=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
AC_MSG_RESULT($found)
|
||||
test $found = no && AC_MSG_WARN([
|
||||
*** You don't seem to have perl5.003 or newer installed.
|
||||
*** Because of that, you may be unable to regenerate certain files
|
||||
*** if you modify the sources from which they are derived.] )
|
||||
])
|
||||
22
m4/prereq.m4
Normal file
22
m4/prereq.m4
Normal file
@@ -0,0 +1,22 @@
|
||||
#serial 2
|
||||
|
||||
dnl These are the prerequisite macros for files in the lib/
|
||||
dnl directories of the fileutils, sh-utils, and textutils packages.
|
||||
|
||||
AC_DEFUN(jm_PREREQ,
|
||||
[
|
||||
jm_PREREQ_ERROR
|
||||
jm_PREREQ_REGEX
|
||||
])
|
||||
|
||||
dnl FIXME: maybe put this in a separate file
|
||||
AC_DEFUN(jm_PREREQ_REGEX,
|
||||
[
|
||||
dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks it.
|
||||
dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
|
||||
dnl to get them.
|
||||
AC_CHECK_FUNCS(bzero bcopy isascii btowc)
|
||||
AC_CHECK_HEADERS(alloca.h libintl.h wctype.h wchar.h)
|
||||
AC_HEADER_STDC
|
||||
AC_FUNC_ALLOCA
|
||||
])
|
||||
19
m4/ssize_t.m4
Normal file
19
m4/ssize_t.m4
Normal file
@@ -0,0 +1,19 @@
|
||||
#serial 1
|
||||
|
||||
dnl From Jim Meyering
|
||||
|
||||
# If ssize_t is not defined in sys/types.h, define it to `int'.
|
||||
|
||||
AC_DEFUN(jm_TYPE_SSIZE_T,
|
||||
[AC_CACHE_CHECK(for ssize_t in sys/types.h, jm_ac_cv_type_ssize_t,
|
||||
[
|
||||
AC_EGREP_HEADER(ssize_t, sys/types.h,
|
||||
jm_ac_cv_type_ssize_t=yes,
|
||||
jm_ac_cv_type_ssize_t=no)
|
||||
if test $jm_ac_cv_type_ssize_t = no; then
|
||||
AC_DEFINE(ssize_t, int)
|
||||
fi
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
49
m4/utimbuf.m4
Normal file
49
m4/utimbuf.m4
Normal file
@@ -0,0 +1,49 @@
|
||||
#serial 1
|
||||
|
||||
dnl From Jim Meyering
|
||||
|
||||
dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
|
||||
dnl usually in <utime.h>.
|
||||
dnl Some systems have utime.h but don't declare the struct anywhere.
|
||||
|
||||
AC_DEFUN(jm_STRUCT_UTIMBUF,
|
||||
[
|
||||
AC_CHECK_HEADERS(utime.h)
|
||||
AC_REQUIRE([AC_HEADER_TIME])
|
||||
AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
|
||||
[AC_TRY_COMPILE(
|
||||
[
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# ifdef HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
#ifdef HAVE_UTIME_H
|
||||
# include <utime.h>
|
||||
#endif
|
||||
],
|
||||
[static struct utimbuf x; x.actime = x.modtime;],
|
||||
fu_cv_sys_struct_utimbuf=yes,
|
||||
fu_cv_sys_struct_utimbuf=no)
|
||||
])
|
||||
|
||||
if test $fu_cv_sys_struct_utimbuf = yes; then
|
||||
if test x = y; then
|
||||
# This code is deliberately never run via ./configure.
|
||||
# FIXME: this is a hack to make autoheader put the corresponding
|
||||
# HAVE_* undef for this symbol in config.h.in. This saves me the
|
||||
# trouble of having to maintain the #undef in acconfig.h manually.
|
||||
AC_CHECK_FUNCS(STRUCT_UTIMBUF)
|
||||
fi
|
||||
# Defining it this way (rather than via AC_DEFINE) short-circuits the
|
||||
# autoheader check -- autoheader doesn't know it's already been taken
|
||||
# care of by the hack above.
|
||||
ac_kludge=HAVE_STRUCT_UTIMBUF
|
||||
AC_DEFINE_UNQUOTED($ac_kludge)
|
||||
fi
|
||||
])
|
||||
File diff suppressed because it is too large
Load Diff
6160
old/fileutils/ChangeLog-1997
Normal file
6160
old/fileutils/ChangeLog-1997
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,48 @@
|
||||
Changes in release 3.17:
|
||||
[3.16o]
|
||||
* chown accepts new option, --dereference. --no-dereference is now the default.
|
||||
* install now shares core copying code with mv and cp
|
||||
* mv (between distinct filesystems) now uses more of the core copying code
|
||||
* fixed a bug or two in mv
|
||||
* df once again displays negative numbers when that's what's returned
|
||||
by get_fs_usage
|
||||
[3.16n]
|
||||
* `mv dir dir' once again does *not* remove dir/
|
||||
* ls accepts new options:
|
||||
--indicator-style=none (no indicators, the default)
|
||||
--indicator-style=classify (all indicators)
|
||||
(equivalent to -F or --classify)
|
||||
--indicator-style=file-type (file type indicators)
|
||||
(equivalent to -p or --file-type)
|
||||
|
||||
--quoting-style=literal (do not quote output)
|
||||
--quoting-style=shell (minimally quote output for the shell)
|
||||
--quoting-style=shell-always (always quote output with '' for the shell)
|
||||
--quoting-style=c (quote output as for a C-language string)
|
||||
(equivalent to -Q or --quote-name)
|
||||
--quoting-style=escape (like c but omit enclosing "")
|
||||
(equivalent to -b or --escape)
|
||||
|
||||
--show-control-chars is the opposite of --hide-control-chars
|
||||
This option can be useful if output is to a terminal,
|
||||
to override the default beahvior of hiding control characters.
|
||||
|
||||
* The QUOTING_STYLE environment variable can now be used to specify the
|
||||
default value for ls's --quoting-style option. If not specified,
|
||||
the default quoting style is 'literal', but this default may change to
|
||||
'shell' in a future version of this package.
|
||||
* ls's quoting style now affects operands in diagnostics, too.
|
||||
* ls's --dired option now outputs the quoting style
|
||||
using the format of the new --quoting-style option.
|
||||
* ls's -e or --quote-shell option (introduced in 3.16j) has been removed;
|
||||
use --quoting-style=shell to get its functionality.
|
||||
[3.16m]
|
||||
* mv can move (and doesn't read) special files
|
||||
* remove maintainer mode
|
||||
[3.16l]
|
||||
* mv can finally move non-regular files between partitions
|
||||
[3.16k]
|
||||
* install accepts new option, -D
|
||||
[3.16j]
|
||||
* du accepts new options, --exclude=PAT and --exclude-from=FILE (-X FILE)
|
||||
* ls now quotes file names for the shell by default, if they contain
|
||||
|
||||
@@ -1,3 +1,175 @@
|
||||
1998-05-16 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* Version 1.16f.
|
||||
|
||||
* lib/readutmp.c (read_utmp): Add variant for systems that have
|
||||
the utmpname function.
|
||||
Ansideclify.
|
||||
* configure.in: Check for utmpname.
|
||||
|
||||
* configure.in (jm_MACROS): New wrapper macro.
|
||||
Remove uses of most jm_* macros.
|
||||
|
||||
* acconfig.h: (chown): Add undef.
|
||||
(D_INO_IN_DIRENT): Likewise.
|
||||
(D_TYPE_IN_DIRENT): Likewise.
|
||||
(ssize_t): Likewise.
|
||||
|
||||
* lib/Makefile.am (EXTRA_DIST): Remove. Automake groks the `LIBOBJS='
|
||||
lines from the m4/*.m4 macros, so the hack of including some
|
||||
custom-replaced C source file names here is no longer needed.
|
||||
|
||||
1998-05-03 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* po/: Update from gettext-0.10.35.
|
||||
* intl/: Likewise.
|
||||
* configure.in: Remove use of AC_LINK_FILES.
|
||||
(AC_OUTPUT): Remove po/Makefile-generating sed command.
|
||||
|
||||
1998-05-02 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* src/seq.c (check_format): Use ISDIGIT, not isdigit.
|
||||
|
||||
1998-04-26 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* configure.in: Use jm_ASSERT.
|
||||
* acconfig.h: Add NDEBUG.
|
||||
|
||||
1998-04-13 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* lib/Makefile.am (noinst_HEADERS): Add safe-read.h.
|
||||
|
||||
1998-04-09 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* configure.in (AM_MAINTAINER_MODE): Remove it.
|
||||
No longer use AC_PATH_PROG to check for perl.
|
||||
(jm_PERL): Use this instead.
|
||||
|
||||
1998-04-04 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* lib/readutmp.h (PARAMS): Define.
|
||||
|
||||
* tests/Makefile.am (SUBDIRS): Add stty.
|
||||
* tests/stty/row-col-1: New file.
|
||||
* tests/stty: New directory.
|
||||
* configure.in (AC_OUTPUT): Add tests/stty/Makefile.
|
||||
|
||||
* src/stty.c: Use STREQ in place of strcmp everywhere.
|
||||
(valid_options): Indent.
|
||||
Parenthesize assignment in while expr.
|
||||
(main): s/case 'f':/case 'F':/
|
||||
Tweak error messages to make them consistent.
|
||||
Remove #if-0'd block.
|
||||
Move dcl of `fdflags' into scope where it's used.
|
||||
Remove dcl of unused `cp'.
|
||||
Use "%s", not device_name, as the format string, in case the
|
||||
latter contains `%'.
|
||||
|
||||
[1998-03-31 Theodore Ts'o <tytso@rsts-11.mit.edu>]
|
||||
* src/stty.c (valid_options): New function.
|
||||
(main): Fix broken options parsing that worked only
|
||||
by serendipity (getopt_long_only already parsed short options; no
|
||||
need to parse them again manually!). Add support for the --file
|
||||
option, which allows the user to specify the device whose line
|
||||
settings are to be set. This is necessary because POSIX ttys will
|
||||
block waiting for carrier detect to go high if CLOCAL is not set,
|
||||
unless the device is opened with the O_NONBLOCK flag.
|
||||
Unfortunately, the shell doesn't use this flag, so users lose.
|
||||
Opening the device in stty is the easist way to fix this.
|
||||
(speeds): Add support for 230400 and 460800 line speeds, which are
|
||||
supported by Linux.
|
||||
|
||||
* acconfig.h (uintmax_t): Add #undef.
|
||||
|
||||
* configure.in (jm_AC_HEADER_INTTYPES_H): Use it.
|
||||
(jm_AC_TYPE_UINTMAX_T): Use it.
|
||||
(jm_PREREQ): Use it.
|
||||
|
||||
* src/system.h: Sync with system.c from fileutils.
|
||||
|
||||
* Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal
|
||||
know about the m4/ subdirectory.
|
||||
* Makefile.maint (aclocal-files): Remove now-unnecessary (with
|
||||
automake-1.2h and the above change) aclocal-related rules and includes.
|
||||
|
||||
1998-04-03 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* lib/closeout.c: New file.
|
||||
* lib/closeout.h: New file.
|
||||
* lib/Makefile.am (libsu_a_SOURCES): Add closeout.c.
|
||||
(noinst_HEADERS): Add closeout.h.
|
||||
|
||||
1998-03-27 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h.
|
||||
|
||||
1998-03-26 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* src/date.c (batch_convert): Remove spurious space in error message.
|
||||
Reported by Karl Berry.
|
||||
|
||||
1998-03-13 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* lib/getugroups.c (getugroups): Don't add a group number if it
|
||||
would be a duplicate. From Ulrich Drepper.
|
||||
|
||||
1998-02-22 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* tests/Makefile.am (EXTRA_DIST): Add mk-script.
|
||||
* tests/Makefile.am.in (EXTRA_DIST): Remove mk-script.pl.
|
||||
(mk_script): Set to ../mk-script.
|
||||
(x-tests): Use `$(PERL) -w -- $(mk_script)', not ./mk-script.
|
||||
Remove @MAINT@ cruft.
|
||||
(Makefile.am): Likewise.
|
||||
Remove @MAINT@ cruft. Now `missing' will explain the failure
|
||||
when people don't have Perl yet modify a file whose rebuilding
|
||||
would lead to the use of Perl.
|
||||
|
||||
* src/Makefile.am (pinky_LDADD): Explicitly add @GETHOSTBYNAME_LIB@.
|
||||
(who_LDADD): Likewise.
|
||||
(pinky_DEPENDENCIES): Set to $(LDADD)
|
||||
(who_DEPENDENCIES): Likewise.
|
||||
|
||||
1998-02-20 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* lib/getdate.h: Removed. Could cause confusion with an
|
||||
automake-generated `.y.h' rule.
|
||||
* lib/get-date.h: Renamed from getdate.h.
|
||||
* lib/getdate.y: s/getdate.h/get-date.h/
|
||||
* lib/Makefile.am (noinst_HEADERS): s/getdate.h/get-date.h/
|
||||
* src/date.c: s/getdate.h/get-date.h/
|
||||
|
||||
1998-02-16 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* configure.in (jm_FUNC_LSTAT): Use it.
|
||||
(jm_FUNC_STAT): Use it.
|
||||
* acconfig.h: Add lstat.
|
||||
* lib/Makefile.am (EXTRA_DIST): Add lstat.c and stat.c.
|
||||
|
||||
1998-02-06 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* tests/nice: Fail immediately if this test is run with `nice'
|
||||
level different from zero. Reported by Philippe De Muyter.
|
||||
|
||||
1998-02-03 Philippe De Muyter <phdm@macqel.be>
|
||||
|
||||
* src/id.c (xgetgroups): Guard function defn with #if HAVE_GETGROUPS.
|
||||
|
||||
* lib/putenv.c (sys/types.h): Include to get size_t on some systems.
|
||||
(NULL): Define if needed.
|
||||
|
||||
1998-01-31 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* configure.in (AC_LFS): Use it.
|
||||
|
||||
1998-01-25 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* Makefile.maint: New file.
|
||||
* Makefile.am: Move rules common to textutils, fileutils, sh-utils
|
||||
into Makefile.maint.
|
||||
Include Makefile.maint.
|
||||
(EXTRA_DIST): Add Makefile.maint.
|
||||
|
||||
1998-01-03 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* lib/Makefile.am (AUTOMAKE_OPTIONS): Define to ../src/ansi2knr.
|
||||
|
||||
@@ -1,3 +1,329 @@
|
||||
1998-05-16 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* Version 1.22f.
|
||||
|
||||
* configure.in (jm_MACROS): New wrapper macro.
|
||||
Remove uses of most jm_* macros.
|
||||
|
||||
* src/tac.c (tac_seekable): Fix error in handling regex separators.
|
||||
* tests/tac/Test.pm (opt-b, opt-s, opt_sb, opt_r): New tests.
|
||||
(opt_br): New test -- exercises above-fixed bug.
|
||||
|
||||
* lib/Makefile.am (EXTRA_DIST): Remove. Automake groks the `LIBOBJS='
|
||||
lines from the m4/*.m4 macros, so the hack of including some
|
||||
custom-replaced C source file names here is no longer needed.
|
||||
|
||||
* acconfig.h (chown): Add undef.
|
||||
(D_INO_IN_DIRENT): Likewise.
|
||||
(D_TYPE_IN_DIRENT): Likewise.
|
||||
(ssize_t): Likewise.
|
||||
|
||||
1998-05-09 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* src/tac.c (tac_seekable): Rename from tac_stream.
|
||||
Change `FILE *in' parameter to `int input_fd'. Adjust callers.
|
||||
|
||||
1998-05-03 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* po/: Update from gettext-0.10.35.
|
||||
* intl/: Likewise.
|
||||
* configure.in: Remove use of AC_LINK_FILES.
|
||||
(AC_OUTPUT): Remove po/Makefile-generating sed command.
|
||||
|
||||
1998-04-26 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* tests/tail/Test.pm: Disable test f-1, now that it fails.
|
||||
|
||||
* src/sort.c (keycompare) (CMP_WITH_IGNORE): Don't return 0 from inside
|
||||
the keyspec-iterating loop. With this change, test 22a passes.
|
||||
Reported by Zvi Har'El.
|
||||
(strncoll): Remove bogus assertion.
|
||||
* tests/sort/Test.pm: Add tests for the above fix.
|
||||
|
||||
* configure.in: Use jm_ASSERT.
|
||||
* acconfig.h: Add NDEBUG.
|
||||
|
||||
* src/cut.c: Don't define NDEBUG.
|
||||
* src/csplit.c: Likewise.
|
||||
* src/join.c: Likewise.
|
||||
* src/sort.c: Likewise.
|
||||
* src/tr.c: Likewise.
|
||||
|
||||
* src/cut.c: Don't define _GNU_SOURCE (now it's in config.h).
|
||||
* src/expand.c: Likewise.
|
||||
* src/fold.c: Likewise.
|
||||
* src/join.c: Likewise.
|
||||
* src/sort.c: Likewise.
|
||||
* src/tr.c: Likewise.
|
||||
* src/unexpand.c: Likewise.
|
||||
* src/uniq.c: Likewise.
|
||||
|
||||
* src/tail.c (close_fd): New function -- converted from macro.
|
||||
[struct File_spec] (n_stat_calls): New member.
|
||||
[struct File_spec] (n_unchanged_stats): New member.
|
||||
(max_n_unchanged_stats): New global.
|
||||
Initialize new members.
|
||||
(xwrite): New function -- converted from macro.
|
||||
[struct File_spec] (pretty_name): Remove member.
|
||||
(pretty_name): New function.
|
||||
|
||||
* src/md5sum.c (md5_check): Declare local, `md5num' as _unsigned_ char*.
|
||||
(hex_digits): Declare parameter `s' as _unsigned_ char*.
|
||||
(split_3): Declare parameter `u' as _unsigned_ char**.
|
||||
|
||||
1998-04-17 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* src/fmt.c (check_punctuation): Used unsigned char* pointers to avoid
|
||||
new warning.
|
||||
* src/join.c (xfields): Likewise.
|
||||
|
||||
1998-04-12 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* src/cat.c: Use STREQ macro rather than strcmp.
|
||||
* src/cksum.c: Likewise.
|
||||
* src/comm.c: Likewise.
|
||||
* src/csplit.c: Likewise.
|
||||
* src/cut.c: Likewise.
|
||||
* src/fmt.c: Likewise.
|
||||
* src/fold.c: Likewise.
|
||||
* src/head.c: Likewise.
|
||||
* src/join.c: Likewise.
|
||||
* src/md5sum.c: Likewise.
|
||||
* src/nl.c: Likewise.
|
||||
* src/paste.c: Likewise.
|
||||
* src/pr.c: Likewise.
|
||||
* src/split.c: Likewise.
|
||||
* src/sum.c: Likewise.
|
||||
* src/tac.c: Likewise.
|
||||
* src/uniq.c: Likewise.
|
||||
* src/wc.c: Likewise.
|
||||
|
||||
1998-04-11 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* lib/safe-read.h: New file.
|
||||
* lib/safe-read.c: Include it.
|
||||
* src/cat.c: Include it instead of merely declaring safe_read.
|
||||
* src/csplit.c: Likewise.
|
||||
* src/head.c: Likewise.
|
||||
* src/split.c: Likewise.
|
||||
* src/sum.c: Likewise.
|
||||
* src/tac.c: Likewise.
|
||||
* src/tail.c: Likewise.
|
||||
* src/tr.c: Likewise.
|
||||
* src/wc.c: Likewise.
|
||||
|
||||
* lib/Makefile.am (noinst_HEADERS): Add safe-read.h.
|
||||
|
||||
* src/wc.c [HAVE_INTTYPES_H]: Include inttypes.h.
|
||||
Declare counters to be of type uintmax_t.
|
||||
(write_counts): Use human_readable to format potentially-long-long
|
||||
numbers. Suggestion from Rogier Wolff.
|
||||
(wc): Declare per-file counters to be of type uintmax_t.
|
||||
Declare bytes_read to be ssize_t.
|
||||
* lib/Makefile.am (libtu_a_SOURCES): Add human.c.
|
||||
(noinst_HEADERS): Add human.h.
|
||||
|
||||
* lib/human.c: New file.
|
||||
* lib/human.h: New file.
|
||||
|
||||
1998-04-04 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* configure.in (jm_AC_HEADER_INTTYPES_H): Use it.
|
||||
(jm_AC_TYPE_UINTMAX_T): Use it.
|
||||
(jm_PREREQ): Use it.
|
||||
|
||||
* Makefile.am (ACLOCAL_AMFLAGS): Define this, so automake/aclocal
|
||||
know about the m4/ subdirectory.
|
||||
* Makefile.maint (aclocal-files): Remove now-unnecessary (with
|
||||
automake-1.2h and the above change) aclocal-related rules and includes.
|
||||
|
||||
1998-04-03 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* lib/closeout.c: New file.
|
||||
* lib/closeout.h: New file.
|
||||
* lib/Makefile.am (libtu_a_SOURCES): Add closeout.c.
|
||||
(noinst_HEADERS): Add closeout.h.
|
||||
|
||||
1998-03-31 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* lib/xstrtol.c: Merge with the version from fileutils.
|
||||
|
||||
1998-03-27 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* Makefile.am (AUTOMAKE_OPTIONS): Require 1.2h.
|
||||
|
||||
1998-03-23 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* acconfig.h: Remove HAVE_INTTYPES_H, now that m4/inttypes_h.m4
|
||||
automatically handles it.
|
||||
|
||||
1998-03-19 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* src/system.h (SCHAR_MIN): Define.
|
||||
(SHRT_MIN): Define.
|
||||
od.c needs these when compiling with NCR's R2.0c C compiler.
|
||||
(TYPE_MAXIMUM): Cast result to `(t)' so this macro works with
|
||||
`unsigned char'.
|
||||
From Greg Wooledge.
|
||||
|
||||
1998-03-15 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* src/tail.c (tail_file): Merge largely-duplicated blocks of code.
|
||||
|
||||
1998-03-03 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/sort.c (xtmpfopen): Open temporary file exclusively, to
|
||||
foil a common denial-of-service attack.
|
||||
* src/tac.c (save_stdin): Likewise.
|
||||
|
||||
1998-02-16 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* 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>
|
||||
|
||||
* configure.in: Don't use AM_MAINTAINER_MODE or
|
||||
AC_PATH_PROG(PERL, perl).
|
||||
(jm_PERL): Use this.
|
||||
|
||||
1998-02-04 Jim Meyering <meyering@eng.ascend.com>
|
||||
|
||||
* tests/Makefile.am.in (EXTRA_DIST): Remove mk-script.pl.
|
||||
(mk_script): Set to ../mk-script.
|
||||
(x-tests): Use `$(PERL) -w -- $(mk_script)', not ./mk-script.
|
||||
Remove @MAINT@ cruft.
|
||||
(Makefile.am): Likewise.
|
||||
Remove @MAINT@ cruft. Now `missing' will explain the failure
|
||||
when people don't have Perl yet modify a file whose rebuilding
|
||||
would lead to the use of Perl.
|
||||
|
||||
* tests/Makefile.am (EXTRA_DIST): Add mk-script.
|
||||
* tests/*/mk-script.pl: Remove files.
|
||||
|
||||
* GNUmakefile: New file.
|
||||
* Makefile.am (EXTRA_DIST): Add GNUmakefile.
|
||||
Don't include Makefile.maint from here. It's included from GNUmakefile.
|
||||
|
||||
1998-01-30 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* 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>
|
||||
|
||||
* Makefile.maint: New file.
|
||||
* Makefile.am: Move rules common to textutils, fileutils, sh-utils
|
||||
into Makefile.maint.
|
||||
Include Makefile.maint.
|
||||
(EXTRA_DIST): Add Makefile.maint.
|
||||
|
||||
* src/cat.c (cat): Convert comma-expressions to pairs of
|
||||
semicolon-terminated stmts.
|
||||
Add braces around compound if/else stmts.
|
||||
|
||||
1998-01-24 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/tail.c (parse_obsolescent_option): Do not interpret `-f -n 1 ...'
|
||||
as obsolescent options.
|
||||
Accept new option: --sleep-interval=SECONDS (-s).
|
||||
FIXME: document new option in textutils.texi.
|
||||
(parse_options): Recognize it.
|
||||
(usage): Describe it.
|
||||
(tail_forever): Use it.
|
||||
(dump_remainder): Use it.
|
||||
* tests/tail/Test.pm (f-1): Add test for option-processing of `-f -n 1'.
|
||||
|
||||
* tests/cut/: Rename directory to remove `-test' suffix.
|
||||
* tests/join/: Likewise.
|
||||
* tests/md5sum/: Likewise.
|
||||
* tests/pr/: Likewise.
|
||||
* tests/sort/: Likewise.
|
||||
* tests/tr/: Likewise.
|
||||
* configure.in (AC_OUTPUT): Reflect renamings in tests/.
|
||||
* tests/Makefile.am (SUBDIRS): Reflect renamings in tests/.
|
||||
|
||||
* src/system.h (TYPE_MINIMUM): Add extra outer cast to work around
|
||||
bug in Cray C 5.0.3.0 when T == time_t.
|
||||
|
||||
1998-01-18 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/sort.c (strncoll, strncoll_s2_readonly, look_for_fraction,
|
||||
numcompare): Remove the `unsigned' from some `unsigned char*'
|
||||
parameter types. Add casts via UCHAR where necessary to avoid
|
||||
problems with unwanted sign extension. Based on a patch from
|
||||
Kaveh Ghazi to appease Irix4's cc compiler.
|
||||
|
||||
1998-01-17 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/split.c (next_file_name): Rewrite. This removes an artificial
|
||||
limit (albeit already high, at INT_MAX :-) on the number of files
|
||||
split could create. Reported by Ralf W. Stephan.
|
||||
|
||||
1998-01-16 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/sort.c: (mergefps): Add braces to avoid ambiguous `else' stmt.
|
||||
(nls_set_fraction): Likewise.
|
||||
|
||||
* src/sort.c: Guard inclusion of langinfo.h also with HAVE_LANGINFO_H,
|
||||
for Irix-4.0.5. From Kaveh Ghazi.
|
||||
* configure.in: Check for langinfo.h.
|
||||
|
||||
* lib/getline.c: Make PARAMS-defining conditionals consistent.
|
||||
* lib/linebuffer.h: Likewise.
|
||||
* lib/long-options.h: Likewise.
|
||||
* lib/memcasecmp.h: Likewise.
|
||||
* lib/xstrtod.h: Likewise.
|
||||
* lib/xstrtol.h: Likewise.
|
||||
Suggestion from Kaveh Ghazi.
|
||||
|
||||
* tests/head/Test.pm (fail-0): Disable test. It depends on
|
||||
sizeof(long) being 32 bits. Reported by Kaveh Ghazi.
|
||||
|
||||
1998-01-10 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* Version 1.22d.
|
||||
|
||||
* src/system.h [HAVE_LIMITS_H]: Include limits.h
|
||||
(TYPE_SIGNED): Define.
|
||||
(TYPE_MINIMUM): Define.
|
||||
(TYPE_MAXIMUM): Define.
|
||||
(CHAR_BIT): Define.
|
||||
(SCHAR_MAX): Define.
|
||||
(UCHAR_MAX): Define.
|
||||
(SHRT_MAX): Define.
|
||||
(INT_MAX): Define.
|
||||
(UINT_MAX): Define.
|
||||
(LONG_MAX): Define.
|
||||
(ULONG_MAX): Define.
|
||||
* src/*.c: Remove definitions of those symbols.
|
||||
|
||||
* src/csplit.c: Move inclusion of regex.h/rx.h to follow system.h
|
||||
since it now includes limit.h which defines RE_DUP_MAX.
|
||||
* src/nl.c: Likewise.
|
||||
* src/tac.c: Likewise.
|
||||
|
||||
* lib/xstrtol.c (bkm_scale): Renamed from BKM_SCALE.
|
||||
Rewrite macro as function. Return a value. Update caller.
|
||||
Cast __ZLONG_MAX `__unsigned long int' before casting to double to
|
||||
avoid SunOS /bin/cc compiler bug.
|
||||
|
||||
1998-01-08 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/tac-pipe.c: New file. But not yet used.
|
||||
* src/Makefile.am (EXTRA_DIST): Add tac-pipe.c.
|
||||
|
||||
* src/tac.c (tac_stream): Don't perform arithmetic on now-void* pointer
|
||||
result of xrealloc (until recently it was char*).
|
||||
|
||||
* configure.in (AC_CHECK_FUNCS): Add nl_langinfo.
|
||||
* src/sort.c (inittables): Add && HAVE_NL_LANGINFO to the #if-test
|
||||
guarding the nls month-checking code.
|
||||
(nls_numeric_format): Remove unnecessary (and error-evoking w/SunOS' cc)
|
||||
`unsigned' from dcls of text and lim.
|
||||
(main): Cast lconvp->grouping to `unsigned char*' to appease SunOS's cc.
|
||||
|
||||
1998-01-03 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* lib/Makefile.am (AUTOMAKE_OPTIONS): Define to ../src/ansi2knr.
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
Changes in release 1.23
|
||||
[1.22f]
|
||||
* fix tac bug when using -b, -r, and -s SEPARATOR
|
||||
* fix sort bug whereby using key-local `d' option would cause following
|
||||
key specs to be ignored when any two keys (in the `d'-modified test)
|
||||
compared equal.
|
||||
[1.22e]
|
||||
* remove maintainer mode
|
||||
[1.22d]
|
||||
* wc accepts new option: --max-line-length (-L)
|
||||
* sort can sort according to your locale if your C library supports that
|
||||
|
||||
@@ -1,19 +1,10 @@
|
||||
# Makefile for program source directory in GNU NLS utilities package.
|
||||
# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
# 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
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
@@ -94,9 +85,10 @@ all-no:
|
||||
$(srcdir)/$(PACKAGE).pot: $(POTFILES)
|
||||
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
|
||||
--add-comments --keyword=_ --keyword=N_ \
|
||||
--files-from=$(srcdir)/POTFILES.in
|
||||
rm -f $(srcdir)/$(PACKAGE).pot
|
||||
mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
|
||||
--files-from=$(srcdir)/POTFILES.in \
|
||||
&& test ! -f $(PACKAGE).po \
|
||||
|| ( rm -f $(srcdir)/$(PACKAGE).pot \
|
||||
&& mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
|
||||
|
||||
$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
|
||||
$(srcdir)/stamp-cat-id: $(PACKAGE).pot
|
||||
@@ -118,10 +110,10 @@ install-exec:
|
||||
install-data: install-data-@USE_NLS@
|
||||
install-data-no: all
|
||||
install-data-yes: all
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
if test -r "$(MKINSTALLDIRS)"; then \
|
||||
$(MKINSTALLDIRS) $(datadir); \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $(datadir); \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(datadir); \
|
||||
fi
|
||||
@catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
@@ -132,10 +124,10 @@ install-data-yes: all
|
||||
esac; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
dir=$$destdir/$$lang/LC_MESSAGES; \
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
if test -r "$(MKINSTALLDIRS)"; then \
|
||||
$(MKINSTALLDIRS) $$dir; \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $$dir; \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
|
||||
fi; \
|
||||
if test -r $$cat; then \
|
||||
$(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
|
||||
@@ -160,10 +152,10 @@ install-data-yes: all
|
||||
fi; \
|
||||
done
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
if test -r "$(MKINSTALLDIRS)"; then \
|
||||
$(MKINSTALLDIRS) $(gettextsrcdir); \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
|
||||
fi; \
|
||||
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
|
||||
$(gettextsrcdir)/Makefile.in.in; \
|
||||
|
||||
106
src/ansi2knr.c
106
src/ansi2knr.c
@@ -1,4 +1,6 @@
|
||||
/* ansi2knr.c */
|
||||
/* Copyright (C) 1989, 1997 Aladdin Enterprises. All rights reserved. */
|
||||
|
||||
/*$Id: ansi2knr.c,v 1.8 1998/05/24 17:43:17 meyering Exp $*/
|
||||
/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
|
||||
|
||||
/*
|
||||
@@ -11,9 +13,10 @@ License (the "GPL") for full details.
|
||||
Everyone is granted permission to copy, modify and redistribute ansi2knr,
|
||||
but only under the conditions described in the GPL. A copy of this license
|
||||
is supposed to have been given to you along with ansi2knr so you can know
|
||||
your rights and responsibilities. It should be in a file named COPYLEFT.
|
||||
Among other things, the copyright notice and this notice must be preserved
|
||||
on all copies.
|
||||
your rights and responsibilities. It should be in a file named COPYLEFT,
|
||||
or, if there is no file named COPYLEFT, a file named COPYING. Among other
|
||||
things, the copyright notice and this notice must be preserved on all
|
||||
copies.
|
||||
|
||||
We explicitly state here what we believe is already implied by the GPL: if
|
||||
the ansi2knr program is distributed as a separate set of sources and a
|
||||
@@ -26,7 +29,10 @@ program under the GPL.
|
||||
|
||||
/*
|
||||
* Usage:
|
||||
ansi2knr input_file [output_file]
|
||||
ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]
|
||||
* --filename provides the file name for the #line directive in the output,
|
||||
* overriding input_file (if present).
|
||||
* If no input_file is supplied, input is read from stdin.
|
||||
* If no output_file is supplied, output goes to stdout.
|
||||
* There are no error messages.
|
||||
*
|
||||
@@ -49,6 +55,11 @@ program under the GPL.
|
||||
* The original and principal author of ansi2knr is L. Peter Deutsch
|
||||
* <ghost@aladdin.com>. Other authors are noted in the change history
|
||||
* that follows (in reverse chronological order):
|
||||
lpd 97-12-08 made input_file optional; only closes input and/or
|
||||
output file if not stdin or stdout respectively; prints
|
||||
usage message on stderr rather than stdout; adds
|
||||
--filename switch (changes suggested by
|
||||
<ceder@lysator.liu.se>)
|
||||
lpd 96-01-21 added code to cope with not HAVE_CONFIG_H and with
|
||||
compilers that don't understand void, as suggested by
|
||||
Tom Lane
|
||||
@@ -169,11 +180,15 @@ int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{ FILE *in, *out;
|
||||
{ FILE *in = stdin;
|
||||
FILE *out = stdout;
|
||||
char *filename = 0;
|
||||
#define bufsize 5000 /* arbitrary size */
|
||||
char *buf;
|
||||
char *line;
|
||||
char *more;
|
||||
char *usage =
|
||||
"Usage: ansi2knr [--filename FILENAME] [INPUT_FILE [OUTPUT_FILE]]\n";
|
||||
/*
|
||||
* In previous versions, ansi2knr recognized a --varargs switch.
|
||||
* If this switch was supplied, ansi2knr would attempt to convert
|
||||
@@ -184,42 +199,49 @@ main(argc, argv)
|
||||
*/
|
||||
int convert_varargs = 1;
|
||||
|
||||
if ( argc > 1 && argv[1][0] == '-' )
|
||||
{ if ( !strcmp(argv[1], "--varargs") )
|
||||
{ convert_varargs = 1;
|
||||
argc--;
|
||||
argv++;
|
||||
}
|
||||
else
|
||||
{ fprintf(stderr, "Unrecognized switch: %s\n", argv[1]);
|
||||
exit(1);
|
||||
}
|
||||
while ( argc > 1 && argv[1][0] == '-' ) {
|
||||
if ( !strcmp(argv[1], "--varargs") ) {
|
||||
convert_varargs = 1;
|
||||
argc--;
|
||||
argv++;
|
||||
continue;
|
||||
}
|
||||
if (argc < 2 || argc > 3)
|
||||
if ( !strcmp(argv[1], "--filename") && argc > 2 ) {
|
||||
filename = argv[2];
|
||||
argc -= 2;
|
||||
argv += 2;
|
||||
continue;
|
||||
}
|
||||
fprintf(stderr, "Unrecognized switch: %s\n", argv[1]);
|
||||
fprintf(stderr, usage);
|
||||
exit(1);
|
||||
}
|
||||
switch ( argc )
|
||||
{
|
||||
printf("Usage: ansi2knr input_file [output_file]\n");
|
||||
exit(1);
|
||||
}
|
||||
in = fopen(argv[1], "r");
|
||||
if ( in == NULL )
|
||||
{
|
||||
fprintf(stderr, "Cannot open input file %s\n", argv[1]);
|
||||
exit(1);
|
||||
default:
|
||||
fprintf(stderr, usage);
|
||||
exit(0);
|
||||
case 3:
|
||||
out = fopen(argv[2], "w");
|
||||
if ( out == NULL ) {
|
||||
fprintf(stderr, "Cannot open output file %s\n", argv[2]);
|
||||
exit(1);
|
||||
}
|
||||
/* falls through */
|
||||
case 2:
|
||||
in = fopen(argv[1], "r");
|
||||
if ( in == NULL ) {
|
||||
fprintf(stderr, "Cannot open input file %s\n", argv[1]);
|
||||
exit(1);
|
||||
}
|
||||
if ( filename == 0 )
|
||||
filename = argv[1];
|
||||
/* falls through */
|
||||
case 1:
|
||||
break;
|
||||
}
|
||||
if (argc == 3)
|
||||
{
|
||||
out = fopen(argv[2], "w");
|
||||
if ( out == NULL )
|
||||
{
|
||||
fprintf(stderr, "Cannot open output file %s\n", argv[2]);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
out = stdout;
|
||||
}
|
||||
fprintf(out, "#line 1 \"%s\"\n", argv[1]);
|
||||
if ( filename )
|
||||
fprintf(out, "#line 1 \"%s\"\n", filename);
|
||||
buf = malloc(bufsize);
|
||||
line = buf;
|
||||
while ( fgets(line, (unsigned)(buf + bufsize - line), in) != NULL )
|
||||
@@ -271,8 +293,10 @@ wl: fputs(buf, out);
|
||||
if ( line != buf )
|
||||
fputs(buf, out);
|
||||
free(buf);
|
||||
fclose(out);
|
||||
fclose(in);
|
||||
if ( out != stdout )
|
||||
fclose(out);
|
||||
if ( in != stdin )
|
||||
fclose(in);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
120
src/cat.c
120
src/cat.c
@@ -1,5 +1,5 @@
|
||||
/* cat -- concatenate files and print on the standard output.
|
||||
Copyright (C) 88, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 88, 90, 91, 95, 96, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -32,13 +32,13 @@
|
||||
#endif
|
||||
#include "system.h"
|
||||
#include "error.h"
|
||||
#include "safe-read.h"
|
||||
|
||||
/* Undefine, to avoid warning about redefinition on some systems. */
|
||||
#undef max
|
||||
#define max(h,i) ((h) > (i) ? (h) : (i))
|
||||
|
||||
int full_write ();
|
||||
int safe_read ();
|
||||
|
||||
/* Name under which this program was invoked. */
|
||||
char *program_name;
|
||||
@@ -381,60 +381,76 @@ cat (
|
||||
/* If quoting, i.e. at least one of -v, -e, or -t specified,
|
||||
scan for chars that need conversion. */
|
||||
if (quote)
|
||||
for (;;)
|
||||
{
|
||||
if (ch >= 32)
|
||||
{
|
||||
if (ch < 127)
|
||||
*bpout++ = ch;
|
||||
else if (ch == 127)
|
||||
*bpout++ = '^',
|
||||
*bpout++ = '?';
|
||||
else
|
||||
{
|
||||
*bpout++ = 'M',
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
if (ch >= 32)
|
||||
{
|
||||
if (ch < 127)
|
||||
*bpout++ = ch;
|
||||
else if (ch == 127)
|
||||
{
|
||||
*bpout++ = '^';
|
||||
*bpout++ = '?';
|
||||
}
|
||||
else
|
||||
{
|
||||
*bpout++ = 'M';
|
||||
*bpout++ = '-';
|
||||
if (ch >= 128 + 32)
|
||||
if (ch < 128 + 127)
|
||||
*bpout++ = ch - 128;
|
||||
if (ch >= 128 + 32)
|
||||
{
|
||||
if (ch < 128 + 127)
|
||||
*bpout++ = ch - 128;
|
||||
else
|
||||
{
|
||||
*bpout++ = '^';
|
||||
*bpout++ = '?';
|
||||
}
|
||||
}
|
||||
else
|
||||
*bpout++ = '^',
|
||||
*bpout++ = '?';
|
||||
else
|
||||
*bpout++ = '^',
|
||||
*bpout++ = ch - 128 + 64;
|
||||
}
|
||||
}
|
||||
else if (ch == '\t' && output_tabs)
|
||||
*bpout++ = '\t';
|
||||
else if (ch == '\n')
|
||||
{
|
||||
newlines = -1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
*bpout++ = '^',
|
||||
*bpout++ = ch + 64;
|
||||
{
|
||||
*bpout++ = '^';
|
||||
*bpout++ = ch - 128 + 64;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (ch == '\t' && output_tabs)
|
||||
*bpout++ = '\t';
|
||||
else if (ch == '\n')
|
||||
{
|
||||
newlines = -1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
*bpout++ = '^';
|
||||
*bpout++ = ch + 64;
|
||||
}
|
||||
|
||||
ch = *bpin++;
|
||||
}
|
||||
ch = *bpin++;
|
||||
}
|
||||
}
|
||||
else
|
||||
/* Not quoting, neither of -v, -e, or -t specified. */
|
||||
for (;;)
|
||||
{
|
||||
if (ch == '\t' && !output_tabs)
|
||||
*bpout++ = '^',
|
||||
*bpout++ = ch + 64;
|
||||
else if (ch != '\n')
|
||||
*bpout++ = ch;
|
||||
else
|
||||
{
|
||||
newlines = -1;
|
||||
break;
|
||||
}
|
||||
{
|
||||
/* Not quoting, neither of -v, -e, or -t specified. */
|
||||
for (;;)
|
||||
{
|
||||
if (ch == '\t' && !output_tabs)
|
||||
{
|
||||
*bpout++ = '^';
|
||||
*bpout++ = ch + 64;
|
||||
}
|
||||
else if (ch != '\n')
|
||||
*bpout++ = ch;
|
||||
else
|
||||
{
|
||||
newlines = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
ch = *bpin++;
|
||||
}
|
||||
ch = *bpin++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -706,7 +722,7 @@ main (int argc, char **argv)
|
||||
free (inbuf);
|
||||
|
||||
contin:
|
||||
if (strcmp (infile, "-") && close (input_desc) < 0)
|
||||
if (!STREQ (infile, "-") && close (input_desc) < 0)
|
||||
{
|
||||
error (0, errno, "%s", infile);
|
||||
exit_status = 1;
|
||||
|
||||
@@ -39,11 +39,11 @@
|
||||
struct group *getgrnam ();
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ENDGRENT
|
||||
#if ! HAVE_ENDGRENT
|
||||
# define endgrent() ((void) 0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LCHOWN
|
||||
#if HAVE_LCHOWN
|
||||
# define LCHOWN(FILE, OWNER, GROUP) lchown (FILE, OWNER, GROUP)
|
||||
#else
|
||||
# define LCHOWN(FILE, OWNER, GROUP) 1
|
||||
@@ -379,7 +379,7 @@ main (int argc, char **argv)
|
||||
usage (1);
|
||||
}
|
||||
|
||||
#ifndef HAVE_LCHOWN
|
||||
#if ! HAVE_LCHOWN
|
||||
if (change_symlinks)
|
||||
{
|
||||
error (1, 0, _("--no-dereference (-h) is not supported on this system"));
|
||||
|
||||
63
src/chown.c
63
src/chown.c
@@ -46,21 +46,16 @@ struct group *getgrnam ();
|
||||
struct group *getgrgid ();
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ENDPWENT
|
||||
#if ! HAVE_ENDPWENT
|
||||
# define endpwent() ((void) 0)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LCHOWN
|
||||
# define LCHOWN(FILE, OWNER, GROUP) lchown (FILE, OWNER, GROUP)
|
||||
#else
|
||||
# define LCHOWN(FILE, OWNER, GROUP) 1
|
||||
#endif
|
||||
|
||||
char *parse_user_spec ();
|
||||
void strip_trailing_slashes ();
|
||||
|
||||
enum Change_status
|
||||
{
|
||||
CH_NOT_APPLIED,
|
||||
CH_SUCCEEDED,
|
||||
CH_FAILED,
|
||||
CH_NO_CHANGE_REQUESTED
|
||||
@@ -86,7 +81,7 @@ 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;
|
||||
static int change_symlinks = 1;
|
||||
|
||||
/* If nonzero, change the ownership of directories recursively. */
|
||||
static int recurse;
|
||||
@@ -117,6 +112,7 @@ static struct option const long_options[] =
|
||||
{
|
||||
{"recursive", no_argument, 0, 'R'},
|
||||
{"changes", no_argument, 0, 'c'},
|
||||
{"dereference", no_argument, 0, 13},
|
||||
{"no-dereference", no_argument, 0, 'h'},
|
||||
{"quiet", no_argument, 0, 'f'},
|
||||
{"silent", no_argument, 0, 'f'},
|
||||
@@ -134,6 +130,14 @@ 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"),
|
||||
file);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (changed)
|
||||
{
|
||||
case CH_SUCCEEDED:
|
||||
@@ -160,7 +164,7 @@ describe_change (const char *file, enum Change_status changed)
|
||||
Return 0 if successful, 1 if errors occurred. */
|
||||
|
||||
static int
|
||||
change_file_owner (const char *file, uid_t user, gid_t group)
|
||||
change_file_owner (int cmdline_arg, const char *file, uid_t user, gid_t group)
|
||||
{
|
||||
struct stat file_stats;
|
||||
uid_t newuser;
|
||||
@@ -179,14 +183,31 @@ change_file_owner (const char *file, uid_t user, gid_t group)
|
||||
if (newuser != file_stats.st_uid || newgroup != file_stats.st_gid)
|
||||
{
|
||||
int fail;
|
||||
int symlink_changed = 1;
|
||||
|
||||
if (change_symlinks)
|
||||
fail = LCHOWN (file, newuser, newgroup);
|
||||
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);
|
||||
{
|
||||
fail = chown (file, newuser, newgroup);
|
||||
}
|
||||
|
||||
if (verbosity == V_high || (verbosity == V_changes_only && !fail))
|
||||
describe_change (file, (fail ? CH_FAILED : CH_SUCCEEDED));
|
||||
{
|
||||
enum Change_status ch_status = (! symlink_changed ? CH_NOT_APPLIED
|
||||
: (fail ? CH_FAILED : CH_SUCCEEDED));
|
||||
describe_change (file, ch_status);
|
||||
}
|
||||
|
||||
if (fail)
|
||||
{
|
||||
@@ -250,7 +271,7 @@ change_dir_owner (const char *dir, uid_t user, gid_t group, struct stat *statp)
|
||||
path = xrealloc (path, pathlength);
|
||||
}
|
||||
strcpy (path + dirlength, namep);
|
||||
errors |= change_file_owner (path, user, group);
|
||||
errors |= change_file_owner (0, path, user, group);
|
||||
}
|
||||
free (path);
|
||||
free (name_space);
|
||||
@@ -275,6 +296,8 @@ Usage: %s [OPTION]... OWNER[.[GROUP]] FILE...\n\
|
||||
Change the owner and/or group of each FILE to OWNER and/or GROUP.\n\
|
||||
\n\
|
||||
-c, --changes be verbose whenever change occurs\n\
|
||||
--dereference affect the referent of each symbolic link, rather\n\
|
||||
than the symbolic link itself\n\
|
||||
-h, --no-dereference affect symbolic links instead of any referenced file\n\
|
||||
(available only on systems that can change the\n\
|
||||
ownership of a symlink)\n\
|
||||
@@ -320,6 +343,9 @@ main (int argc, char **argv)
|
||||
case 12:
|
||||
reference_file = optarg;
|
||||
break;
|
||||
case 13:
|
||||
change_symlinks = 0;
|
||||
break;
|
||||
case 'R':
|
||||
recurse = 1;
|
||||
break;
|
||||
@@ -356,13 +382,6 @@ main (int argc, char **argv)
|
||||
usage (1);
|
||||
}
|
||||
|
||||
#ifndef HAVE_LCHOWN
|
||||
if (change_symlinks)
|
||||
{
|
||||
error (1, 0, _("--no-dereference (-h) is not supported on this system"));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (reference_file)
|
||||
{
|
||||
struct stat ref_stats;
|
||||
@@ -387,7 +406,7 @@ main (int argc, char **argv)
|
||||
for (; optind < argc; ++optind)
|
||||
{
|
||||
strip_trailing_slashes (argv[optind]);
|
||||
errors |= change_file_owner (argv[optind], user, group);
|
||||
errors |= change_file_owner (1, argv[optind], user, group);
|
||||
}
|
||||
|
||||
if (verbosity != V_off)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* cksum -- calculate and print POSIX.2 checksums and sizes of files
|
||||
Copyright (C) 92, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 92, 95, 96, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -202,7 +202,7 @@ cksum (char *file, int print_name)
|
||||
long bytes_read;
|
||||
register FILE *fp;
|
||||
|
||||
if (!strcmp (file, "-"))
|
||||
if (STREQ (file, "-"))
|
||||
{
|
||||
fp = stdin;
|
||||
have_read_stdin = 1;
|
||||
@@ -229,12 +229,12 @@ cksum (char *file, int print_name)
|
||||
if (ferror (fp))
|
||||
{
|
||||
error (0, errno, "%s", file);
|
||||
if (strcmp (file, "-"))
|
||||
if (!STREQ (file, "-"))
|
||||
fclose (fp);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (strcmp (file, "-") && fclose (fp) == EOF)
|
||||
if (!STREQ (file, "-") && fclose (fp) == EOF)
|
||||
{
|
||||
error (0, errno, "%s", file);
|
||||
return -1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* comm -- compare two sorted files line by line.
|
||||
Copyright (C) 86, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 86, 90, 91, 95, 96, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -148,8 +148,7 @@ compare_files (char **infiles)
|
||||
{
|
||||
initbuffer (&lb1[i]);
|
||||
thisline[i] = &lb1[i];
|
||||
streams[i] = strcmp (infiles[i], "-")
|
||||
? fopen (infiles[i], "r") : stdin;
|
||||
streams[i] = (STREQ (infiles[i], "-") ? stdin : fopen (infiles[i], "r"));
|
||||
if (!streams[i])
|
||||
{
|
||||
error (0, errno, "%s", infiles[i]);
|
||||
|
||||
187
src/copy.c
187
src/copy.c
@@ -1,3 +1,22 @@
|
||||
/* copy.c -- core functions for copying files and directories
|
||||
Copyright (C) 89, 90, 91, 95, 96, 97, 1998 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 cp.c and librarified by Jim Meyering. */
|
||||
|
||||
#ifdef _AIX
|
||||
#pragma alloca
|
||||
#endif
|
||||
@@ -25,8 +44,9 @@
|
||||
#define DO_CHOWN(Chown, File, New_uid, New_gid) \
|
||||
(Chown ((File), (x->myeuid == 0 ? (New_uid) : x->myeuid), (New_gid)) \
|
||||
/* If non-root uses -p, it's ok if we can't preserve ownership. \
|
||||
But root probably wants to know, e.g. if NFS disallows it. */ \
|
||||
&& (errno != EPERM || x->myeuid == 0))
|
||||
But root probably wants to know, e.g. if NFS disallows it, \
|
||||
or if the target system doesn't support file ownership. */ \
|
||||
&& ((errno != EPERM && errno != EINVAL) || x->myeuid == 0))
|
||||
|
||||
struct dir_list
|
||||
{
|
||||
@@ -42,11 +62,34 @@ int yesno ();
|
||||
static int copy_internal PARAMS ((const char *src_path, const char *dst_path,
|
||||
int new_dst, dev_t device,
|
||||
struct dir_list *ancestors,
|
||||
const struct cp_options *x));
|
||||
const struct cp_options *x,
|
||||
int move_mode,
|
||||
int *copy_into_self,
|
||||
int *rename_succeeded));
|
||||
|
||||
/* The invocation name of this program. */
|
||||
extern char *program_name;
|
||||
|
||||
/* Encapsulate selection of the file mode to be applied to
|
||||
new non-directories. */
|
||||
|
||||
static mode_t
|
||||
new_nondir_mode (const struct cp_options *option, mode_t mode)
|
||||
{
|
||||
/* In some applications (e.g., install), use precisely the
|
||||
specified mode. */
|
||||
if (option->set_mode)
|
||||
return option->mode;
|
||||
|
||||
/* In others (e.g., cp, mv), apply the user's umask. */
|
||||
return mode & option->umask_kill;
|
||||
}
|
||||
|
||||
/* FIXME: describe */
|
||||
/* FIXME: rewrite this to use a hash table so we avoid the quadratic
|
||||
performance hit that's probably noticeable only on trees deeper
|
||||
than a few hundred levels. See use of active_dir_map in remove.c */
|
||||
|
||||
static int
|
||||
is_ancestor (const struct stat *sb, const struct dir_list *ancestors)
|
||||
{
|
||||
@@ -63,17 +106,17 @@ is_ancestor (const struct stat *sb, const struct dir_list *ancestors)
|
||||
copy the contents to DST_PATH_IN. NEW_DST is nonzero if
|
||||
DST_PATH_IN is a directory that was created previously in the
|
||||
recursion. SRC_SB and ANCESTORS describe SRC_PATH_IN.
|
||||
Set *COPY_INTO_SELF to nonzero if SRC_PATH_IN is a parent of
|
||||
(or the same as) DST_PATH_IN; otherwise, set it to zero.
|
||||
Return 0 if successful, -1 if an error occurs. */
|
||||
|
||||
static int
|
||||
copy_dir (const char *src_path_in, const char *dst_path_in, int new_dst,
|
||||
const struct stat *src_sb, struct dir_list *ancestors,
|
||||
const struct cp_options *x)
|
||||
const struct cp_options *x, int *copy_into_self)
|
||||
{
|
||||
char *name_space;
|
||||
char *namep;
|
||||
char *src_path;
|
||||
char *dst_path;
|
||||
int ret = 0;
|
||||
|
||||
errno = 0;
|
||||
@@ -92,13 +135,16 @@ copy_dir (const char *src_path_in, const char *dst_path_in, int new_dst,
|
||||
namep = name_space;
|
||||
while (*namep != '\0')
|
||||
{
|
||||
src_path = path_concat (src_path_in, namep, NULL);
|
||||
dst_path = path_concat (dst_path_in, namep, NULL);
|
||||
int local_copy_into_self;
|
||||
char *src_path = path_concat (src_path_in, namep, NULL);
|
||||
char *dst_path = path_concat (dst_path_in, namep, NULL);
|
||||
|
||||
if (dst_path == NULL || src_path == NULL)
|
||||
error (1, 0, _("virtual memory exhausted"));
|
||||
|
||||
ret |= copy_internal (src_path, dst_path, new_dst, src_sb->st_dev,
|
||||
ancestors, x);
|
||||
ancestors, x, 0, &local_copy_into_self, NULL);
|
||||
*copy_into_self |= local_copy_into_self;
|
||||
|
||||
/* Free the memory for `src_path'. The memory for `dst_path'
|
||||
cannot be deallocated, since it is used to create multiple
|
||||
@@ -165,7 +211,7 @@ copy_reg (const char *src_path, const char *dst_path,
|
||||
|
||||
buf_size = ST_BLKSIZE (sb);
|
||||
|
||||
#ifdef HAVE_ST_BLOCKS
|
||||
#if HAVE_ST_BLOCKS
|
||||
if (sparse_mode == SPARSE_AUTO && S_ISREG (sb.st_mode))
|
||||
{
|
||||
/* Use a heuristic to determine whether SRC_PATH contains any
|
||||
@@ -262,7 +308,7 @@ copy_reg (const char *src_path, const char *dst_path,
|
||||
|
||||
if (last_write_made_hole)
|
||||
{
|
||||
#ifdef HAVE_FTRUNCATE
|
||||
#if HAVE_FTRUNCATE
|
||||
/* Write a null character and truncate it again. */
|
||||
if (full_write (dest_desc, "", 1) < 0
|
||||
|| ftruncate (dest_desc, n_read_total) < 0)
|
||||
@@ -300,12 +346,19 @@ ret2:
|
||||
number of the parent directory, or 0 if the parent of this file is
|
||||
not known. ANCESTORS points to a linked, null terminated list of
|
||||
devices and inodes of parent directories of SRC_PATH.
|
||||
Set *COPY_INTO_SELF to nonzero if SRC_PATH is a parent of (or the
|
||||
same as) DST_PATH; otherwise, set it to zero.
|
||||
Return 0 if successful, 1 if an error occurs. */
|
||||
|
||||
static int
|
||||
copy_internal (const char *src_path, const char *dst_path,
|
||||
int new_dst, dev_t device, struct dir_list *ancestors,
|
||||
const struct cp_options *x)
|
||||
int new_dst,
|
||||
dev_t device,
|
||||
struct dir_list *ancestors,
|
||||
const struct cp_options *x,
|
||||
int move_mode,
|
||||
int *copy_into_self,
|
||||
int *rename_succeeded)
|
||||
{
|
||||
struct stat src_sb;
|
||||
struct stat dst_sb;
|
||||
@@ -315,6 +368,10 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
char *dst_backup = NULL;
|
||||
int fix_mode = 0;
|
||||
|
||||
if (move_mode && rename_succeeded)
|
||||
*rename_succeeded = 0;
|
||||
|
||||
*copy_into_self = 0;
|
||||
if ((*(x->xstat)) (src_path, &src_sb))
|
||||
{
|
||||
error (0, errno, "%s", src_path);
|
||||
@@ -334,7 +391,10 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
/* Did we just create this file? */
|
||||
|
||||
if (earlier_file == &new_file)
|
||||
return 0;
|
||||
{
|
||||
*copy_into_self = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
src_mode = src_sb.st_mode;
|
||||
src_type = src_sb.st_mode;
|
||||
@@ -422,9 +482,17 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (backup_type != none && !S_ISDIR (dst_sb.st_mode))
|
||||
/* In move_mode, DEST may not be an existing directory. */
|
||||
if (move_mode && S_ISDIR (dst_sb.st_mode))
|
||||
{
|
||||
char *tmp_backup = find_backup_file_name (dst_path);
|
||||
error (0, 0, _("%s: cannot overwrite directory"), dst_path);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (x->backup_type != none && !S_ISDIR (dst_sb.st_mode))
|
||||
{
|
||||
char *tmp_backup = find_backup_file_name (dst_path,
|
||||
x->backup_type);
|
||||
if (tmp_backup == NULL)
|
||||
error (1, 0, _("virtual memory exhausted"));
|
||||
|
||||
@@ -434,12 +502,15 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
would leave two zero-length files: a and a~. */
|
||||
if (STREQ (tmp_backup, src_path))
|
||||
{
|
||||
error (0, 0,
|
||||
_("backing up `%s' would destroy source; `%s' not copied"),
|
||||
dst_path, src_path);
|
||||
const char *fmt;
|
||||
fmt = (move_mode
|
||||
? _("backing up `%s' would destroy source; `%s' not moved")
|
||||
: _("backing up `%s' would destroy source; `%s' not copied"));
|
||||
error (0, 0, fmt, dst_path, src_path);
|
||||
free (tmp_backup);
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
dst_backup = (char *) alloca (strlen (tmp_backup) + 1);
|
||||
strcpy (dst_backup, tmp_backup);
|
||||
free (tmp_backup);
|
||||
@@ -477,9 +548,13 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
{
|
||||
error (0, errno, _("cannot remove old link to `%s'"),
|
||||
dst_path);
|
||||
return 1;
|
||||
if (x->failed_unlink_is_fatal)
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_dst = 1;
|
||||
}
|
||||
new_dst = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -504,6 +579,15 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (move_mode && rename (src_path, dst_path) == 0)
|
||||
{
|
||||
if (x->verbose && S_ISDIR (src_type))
|
||||
printf ("%s -> %s\n", src_path, dst_path);
|
||||
if (rename_succeeded)
|
||||
*rename_succeeded = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (S_ISDIR (src_type))
|
||||
{
|
||||
struct dir_list *dir;
|
||||
@@ -550,7 +634,8 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
|
||||
/* Copy the contents of the directory. */
|
||||
|
||||
if (copy_dir (src_path, dst_path, new_dst, &src_sb, dir, x))
|
||||
if (copy_dir (src_path, dst_path, new_dst, &src_sb, dir, x,
|
||||
copy_into_self))
|
||||
return 1;
|
||||
}
|
||||
#ifdef S_ISLNK
|
||||
@@ -600,7 +685,7 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
#ifdef S_ISFIFO
|
||||
if (S_ISFIFO (src_type))
|
||||
{
|
||||
if (mkfifo (dst_path, src_mode & x->umask_kill))
|
||||
if (mkfifo (dst_path, new_nondir_mode (x, src_mode)))
|
||||
{
|
||||
error (0, errno, _("cannot create fifo `%s'"), dst_path);
|
||||
goto un_backup;
|
||||
@@ -614,7 +699,7 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if (mknod (dst_path, src_mode & x->umask_kill, src_sb.st_rdev))
|
||||
if (mknod (dst_path, new_nondir_mode (x, src_mode), src_sb.st_rdev))
|
||||
{
|
||||
error (0, errno, _("cannot create special file `%s'"), dst_path);
|
||||
goto un_backup;
|
||||
@@ -642,11 +727,11 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
goto un_backup;
|
||||
}
|
||||
|
||||
if (x->preserve)
|
||||
if (x->preserve_owner_and_group)
|
||||
{
|
||||
/* Preserve the owner and group of the just-`copied'
|
||||
symbolic link, if possible. */
|
||||
# ifdef HAVE_LCHOWN
|
||||
# if HAVE_LCHOWN
|
||||
if (DO_CHOWN (lchown, dst_path, src_sb.st_uid, src_sb.st_gid))
|
||||
{
|
||||
error (0, errno, _("preserving ownership for %s"), dst_path);
|
||||
@@ -697,7 +782,7 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
chown turns off set[ug]id bits for non-root,
|
||||
so do the chmod last. */
|
||||
|
||||
if (x->preserve)
|
||||
if (x->preserve_timestamps)
|
||||
{
|
||||
struct utimbuf utb;
|
||||
|
||||
@@ -710,7 +795,10 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
if (x->require_preserve)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (x->preserve_owner_and_group)
|
||||
{
|
||||
if (DO_CHOWN (chown, dst_path, src_sb.st_uid, src_sb.st_gid))
|
||||
{
|
||||
error (0, errno, _("preserving ownership for %s"), dst_path);
|
||||
@@ -719,8 +807,17 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
}
|
||||
}
|
||||
|
||||
if ((x->preserve || new_dst)
|
||||
&& (x->copy_as_regular || S_ISREG (src_type) || S_ISDIR (src_type)))
|
||||
if (x->set_mode)
|
||||
{
|
||||
/* This is so install's -m MODE option works. */
|
||||
if (chmod (dst_path, x->mode))
|
||||
{
|
||||
error (0, errno, _("setting permissions for %s"), dst_path);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else if ((x->preserve_chmod_bits || new_dst)
|
||||
&& (x->copy_as_regular || S_ISREG (src_type) || S_ISDIR (src_type)))
|
||||
{
|
||||
if (chmod (dst_path, src_mode & x->umask_kill))
|
||||
{
|
||||
@@ -755,10 +852,17 @@ valid_options (const struct cp_options *co)
|
||||
{
|
||||
assert (co != NULL);
|
||||
|
||||
/* FIXME: make sure xstat and dereference are consistent. */
|
||||
assert (co->xstat);
|
||||
assert (VALID_BACKUP_TYPE (co->backup_type));
|
||||
|
||||
/* FIXME: for some reason this assertion always fails,
|
||||
at least on Solaris2.5.1. Just disable it for now. */
|
||||
/* assert (co->xstat == lstat || co->xstat == stat); */
|
||||
|
||||
/* Make sure xstat and dereference are consistent. */
|
||||
/* FIXME */
|
||||
|
||||
assert (VALID_SPARSE_MODE (co->sparse_mode));
|
||||
|
||||
assert (co->sparse_mode != SPARSE_UNUSED);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -766,15 +870,22 @@ valid_options (const struct cp_options *co)
|
||||
any type. NONEXISTENT_DST should be nonzero if the file DST_PATH
|
||||
is known not to exist (e.g., because its parent directory was just
|
||||
created); NONEXISTENT_DST should be zero if DST_PATH might already
|
||||
exist. DEVICE is the device number of the parent directory of
|
||||
DST_PATH, or 0 if the parent of this file is not known.
|
||||
OPTIONS is ... FIXME-describe
|
||||
exist. OPTIONS is ... FIXME-describe
|
||||
Set *COPY_INTO_SELF to nonzero if SRC_PATH is a parent of (or the
|
||||
same as) DST_PATH; otherwise, set it to zero.
|
||||
Return 0 if successful, 1 if an error occurs. */
|
||||
|
||||
int
|
||||
copy (const char *src_path, const char *dst_path,
|
||||
int nonexistent_dst, const struct cp_options *options)
|
||||
int nonexistent_dst, const struct cp_options *options,
|
||||
int *copy_into_self, int *rename_succeeded)
|
||||
{
|
||||
/* move_mode is set to the value from the `options' parameter for the
|
||||
first copy_internal call. For all subsequent calls (if any), it must
|
||||
be zero. */
|
||||
int move_mode = options->move_mode;
|
||||
|
||||
assert (valid_options (options));
|
||||
return copy_internal (src_path, dst_path, nonexistent_dst, 0, NULL, options);
|
||||
return copy_internal (src_path, dst_path, nonexistent_dst, 0, NULL,
|
||||
options, move_mode, copy_into_self, rename_succeeded);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user