mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
Compare commits
523 Commits
FILEUTILS-
...
FILEUTILS-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
482aa7fc64 | ||
|
|
8985201718 | ||
|
|
7de6407b72 | ||
|
|
579105347d | ||
|
|
039c76fc63 | ||
|
|
8f8938e366 | ||
|
|
15ecc0f435 | ||
|
|
b34c9d22e4 | ||
|
|
97b943feb3 | ||
|
|
836e28186c | ||
|
|
91d525cd50 | ||
|
|
586b7bf510 | ||
|
|
d0cc040dd8 | ||
|
|
358c9c706a | ||
|
|
dd19256dcd | ||
|
|
8fad3eb9e0 | ||
|
|
1adc899668 | ||
|
|
de4a1fe053 | ||
|
|
5c34a06b45 | ||
|
|
f5fb72e12c | ||
|
|
8fd90d4b2b | ||
|
|
d402b210ea | ||
|
|
619ffb2bff | ||
|
|
abd2b295f2 | ||
|
|
396069fce5 | ||
|
|
a5c0da5365 | ||
|
|
bc009f5b5f | ||
|
|
5c136d939e | ||
|
|
b55a5cc86c | ||
|
|
4d453f5691 | ||
|
|
9d67112156 | ||
|
|
c880f6f9e0 | ||
|
|
8469888ca2 | ||
|
|
83616b114e | ||
|
|
f01f28a92a | ||
|
|
ba798c5998 | ||
|
|
aa78add2de | ||
|
|
3cf14979b7 | ||
|
|
1ca5f870b6 | ||
|
|
1cd58148cd | ||
|
|
a4f0b7b42e | ||
|
|
71f60a998c | ||
|
|
f13c5ee9ce | ||
|
|
6385fbd99a | ||
|
|
73417841eb | ||
|
|
dba50eec49 | ||
|
|
3400cc7f78 | ||
|
|
3c5405d298 | ||
|
|
be72ac078c | ||
|
|
6d38725e21 | ||
|
|
4e5d2ac6d2 | ||
|
|
cbd2839f1d | ||
|
|
a3ac01b48d | ||
|
|
00df9725bb | ||
|
|
81b16373ae | ||
|
|
47827e2ec2 | ||
|
|
68c6a5d828 | ||
|
|
30c412049f | ||
|
|
f2d53500ae | ||
|
|
fc64ba37d4 | ||
|
|
a5c02a198b | ||
|
|
12bf65f915 | ||
|
|
48ebc7d0b7 | ||
|
|
b0fd0aa567 | ||
|
|
a1eab797d0 | ||
|
|
7f0b022e0d | ||
|
|
1224b48d7f | ||
|
|
3b8a52ccbe | ||
|
|
605768d957 | ||
|
|
45dcf53e6e | ||
|
|
3f0c7988cf | ||
|
|
51dbb91fdd | ||
|
|
9590fbf43c | ||
|
|
5a3d9df9a1 | ||
|
|
70e5178bde | ||
|
|
c693c5940b | ||
|
|
8c8e4286b5 | ||
|
|
ce8cf50e0a | ||
|
|
4071f9dcd5 | ||
|
|
ebd41d46d8 | ||
|
|
a210d7d35c | ||
|
|
b9c210715c | ||
|
|
101160bdf9 | ||
|
|
5c4406f731 | ||
|
|
721557bb21 | ||
|
|
d7f56af947 | ||
|
|
17bd8fb7fa | ||
|
|
babf9bb7ac | ||
|
|
28ee33a9d8 | ||
|
|
e90fed0bf7 | ||
|
|
41a1348544 | ||
|
|
2f925e9403 | ||
|
|
1068a0005a | ||
|
|
cf197bb14a | ||
|
|
34b63c88da | ||
|
|
2fd73df635 | ||
|
|
31f5c39ace | ||
|
|
aa1ddd2e7d | ||
|
|
fca7b20092 | ||
|
|
a90650cd3a | ||
|
|
03faf39b22 | ||
|
|
acd3390874 | ||
|
|
c263f45884 | ||
|
|
a41b145094 | ||
|
|
661f74698e | ||
|
|
c6b0fefde1 | ||
|
|
2d4fd1ab6e | ||
|
|
c4d7de4d1c | ||
|
|
7942b60d47 | ||
|
|
c6bd79ad34 | ||
|
|
52150ef51d | ||
|
|
071e5e3b25 | ||
|
|
21f7f8fb60 | ||
|
|
1a898f0449 | ||
|
|
ab241ac3be | ||
|
|
d3683509b3 | ||
|
|
ddb8aa8b9f | ||
|
|
73ed5ed51e | ||
|
|
a3d40a9447 | ||
|
|
309c1c3e47 | ||
|
|
72bdac7271 | ||
|
|
f1013a1535 | ||
|
|
e1133c7a28 | ||
|
|
011b92f1c9 | ||
|
|
5aa90a9946 | ||
|
|
c610f47650 | ||
|
|
d9e1e1dbd2 | ||
|
|
b700e5cdfe | ||
|
|
a83332dcd2 | ||
|
|
20d55109b5 | ||
|
|
95fad10ba3 | ||
|
|
e580f2a576 | ||
|
|
0a63562cfa | ||
|
|
55b7281ec2 | ||
|
|
b00705596d | ||
|
|
6507fa63ce | ||
|
|
e074cde09b | ||
|
|
9b6eb98d41 | ||
|
|
72efca1195 | ||
|
|
884af44da8 | ||
|
|
c2a761780e | ||
|
|
2c1ae1f436 | ||
|
|
ed0f130ea1 | ||
|
|
a23b2bb948 | ||
|
|
669034433d | ||
|
|
97df7c4729 | ||
|
|
6206ee75ea | ||
|
|
6b54234726 | ||
|
|
c141f3a34e | ||
|
|
3140984fab | ||
|
|
19c397acdc | ||
|
|
80b5341cb8 | ||
|
|
f2fde491db | ||
|
|
e1c98ab3fb | ||
|
|
be9e62c6e0 | ||
|
|
df9a764cbd | ||
|
|
3684b16708 | ||
|
|
7dad7fd5c6 | ||
|
|
856071f1da | ||
|
|
ff1e216579 | ||
|
|
554b19b9d1 | ||
|
|
98e69d378e | ||
|
|
00c483746f | ||
|
|
7d4bd8f671 | ||
|
|
46b48d2e0e | ||
|
|
87a766e71a | ||
|
|
5d65fd5e99 | ||
|
|
6a4a7cfe00 | ||
|
|
2961a41dc3 | ||
|
|
a0f78c6a82 | ||
|
|
3e5e4aa3ac | ||
|
|
f4d3d21b14 | ||
|
|
6a0899b4b6 | ||
|
|
3d21ae4853 | ||
|
|
6405a85879 | ||
|
|
91aee8ad4d | ||
|
|
3c13ac6c36 | ||
|
|
0605601f99 | ||
|
|
c8fa96131e | ||
|
|
cea745beaa | ||
|
|
647d5e6a70 | ||
|
|
b53fe736bc | ||
|
|
f7fcc8c622 | ||
|
|
be579a52e7 | ||
|
|
c2262fcd90 | ||
|
|
93e3e3a5a8 | ||
|
|
92d235c21a | ||
|
|
900011c7de | ||
|
|
0cb358268d | ||
|
|
e6d69926e6 | ||
|
|
7e3bd1d897 | ||
|
|
cd8042a77c | ||
|
|
44bdb2f05a | ||
|
|
38a059bf64 | ||
|
|
950eba9ba0 | ||
|
|
5fdc4f4666 | ||
|
|
4c69db64f2 | ||
|
|
acd9c429c0 | ||
|
|
e0263e15f1 | ||
|
|
cb58624cef | ||
|
|
c488f85c66 | ||
|
|
aa435d9982 | ||
|
|
624dd54796 | ||
|
|
ef34c8704c | ||
|
|
b0d42f0a5c | ||
|
|
3491fe9797 | ||
|
|
951abbe274 | ||
|
|
392dd7af09 | ||
|
|
9561e02b6a | ||
|
|
e6bf5ecaf8 | ||
|
|
e511c84abe | ||
|
|
cc5b8b2e79 | ||
|
|
56b16d84df | ||
|
|
034fbbd8ac | ||
|
|
a65db32955 | ||
|
|
72d2131b0e | ||
|
|
2edc7371bc | ||
|
|
5e7a7d23f5 | ||
|
|
d0e30069c0 | ||
|
|
9a7f0b1542 | ||
|
|
9a909400ba | ||
|
|
9e60f6cc06 | ||
|
|
721b2cb881 | ||
|
|
b958bd6f2b | ||
|
|
8e3be9e25c | ||
|
|
d6254a86bf | ||
|
|
cf251ff75b | ||
|
|
f79c0f977e | ||
|
|
16d019fb86 | ||
|
|
8d8135769a | ||
|
|
8b37ad9c5b | ||
|
|
c249f854de | ||
|
|
4954d34c14 | ||
|
|
e9c9e0f9e5 | ||
|
|
01a1964a1c | ||
|
|
063bdf481b | ||
|
|
cc9a042dfd | ||
|
|
a105fb3c17 | ||
|
|
c0e74f9b48 | ||
|
|
f5e968f6cd | ||
|
|
fa3bb4033b | ||
|
|
455d9ad4ed | ||
|
|
375abb3590 | ||
|
|
a3e7716e04 | ||
|
|
c500f8c996 | ||
|
|
a3029aba6b | ||
|
|
56b185d9b3 | ||
|
|
5bb0a21123 | ||
|
|
8a6dd8bf13 | ||
|
|
758eab108f | ||
|
|
862b31c48a | ||
|
|
30eb4cf648 | ||
|
|
29f4f9a5ac | ||
|
|
d3057155d5 | ||
|
|
8735a6823f | ||
|
|
d89bb4e01a | ||
|
|
0cd61ad840 | ||
|
|
5aeb94aeb4 | ||
|
|
2f4177fa6b | ||
|
|
eddd846acb | ||
|
|
84013f9573 | ||
|
|
98f5206a61 | ||
|
|
58be6ceff4 | ||
|
|
97a6cf3999 | ||
|
|
40f30dc54b | ||
|
|
833f309376 | ||
|
|
72b3b743fe | ||
|
|
0952a8a7bc | ||
|
|
be7efadaf2 | ||
|
|
d2caf6a98c | ||
|
|
c2981f6507 | ||
|
|
14aece6661 | ||
|
|
eddd7f971f | ||
|
|
df85b33ee3 | ||
|
|
d37e7835f9 | ||
|
|
d6df2d8561 | ||
|
|
db01eaed39 | ||
|
|
a423a1374f | ||
|
|
56dc5651a4 | ||
|
|
c559eefb84 | ||
|
|
517e8a6bc2 | ||
|
|
88a6b99b8d | ||
|
|
125de05913 | ||
|
|
496e09185a | ||
|
|
757de7fe90 | ||
|
|
bb53ccc5e9 | ||
|
|
9fc7c63a5a | ||
|
|
10acebe2cb | ||
|
|
d02b8ea082 | ||
|
|
a71d7cdd14 | ||
|
|
2e469b088b | ||
|
|
d5066f22eb | ||
|
|
9ac210f6a7 | ||
|
|
a3c2775889 | ||
|
|
7ae95c0ff8 | ||
|
|
12ec89c0e3 | ||
|
|
6157486144 | ||
|
|
4add54834d | ||
|
|
f03b3e48ea | ||
|
|
50a68130a3 | ||
|
|
088ab165c7 | ||
|
|
b08487e513 | ||
|
|
29d6a0aa75 | ||
|
|
85846c1ba1 | ||
|
|
42b1404b54 | ||
|
|
9516237211 | ||
|
|
b518fdab61 | ||
|
|
290fd86565 | ||
|
|
b6d1fca450 | ||
|
|
844f0224f0 | ||
|
|
e3d82c6734 | ||
|
|
d219e87e72 | ||
|
|
545a2cbc66 | ||
|
|
e6701bae6d | ||
|
|
0145667581 | ||
|
|
a641eab06a | ||
|
|
7beb8ac8aa | ||
|
|
8debb843b6 | ||
|
|
c908124639 | ||
|
|
5c7059a33a | ||
|
|
6c60fb0a7a | ||
|
|
650ea2e0b4 | ||
|
|
ca59fb27c2 | ||
|
|
19aa1f8a25 | ||
|
|
4cfab8f932 | ||
|
|
edcc5eb997 | ||
|
|
437a783072 | ||
|
|
9a16820c87 | ||
|
|
6b0a7a91d4 | ||
|
|
4259b70042 | ||
|
|
5cb8c8c0a0 | ||
|
|
043d1c865c | ||
|
|
9394a8280f | ||
|
|
c846dbf402 | ||
|
|
826dcda9c4 | ||
|
|
31ecd03e51 | ||
|
|
0fcc2606dd | ||
|
|
bea19ce09c | ||
|
|
4208ee3490 | ||
|
|
f7cfce8952 | ||
|
|
ff9b9b202c | ||
|
|
594b06988b | ||
|
|
faf92299a0 | ||
|
|
98dd4a3867 | ||
|
|
8661f4d615 | ||
|
|
7354c6077f | ||
|
|
48c6dffe80 | ||
|
|
cc7186a919 | ||
|
|
5c1001fdc5 | ||
|
|
6803a71d89 | ||
|
|
534deab287 | ||
|
|
b9db9921b8 | ||
|
|
c36284c505 | ||
|
|
a1eb481256 | ||
|
|
26bcc7757c | ||
|
|
6dd8936868 | ||
|
|
32ff553652 | ||
|
|
7fc37fe5ec | ||
|
|
655b4e6409 | ||
|
|
0fe3b0fe41 | ||
|
|
92f6a5cd8e | ||
|
|
dfddef17ac | ||
|
|
d10be8f4db | ||
|
|
1461770971 | ||
|
|
1f665cff54 | ||
|
|
e287f40259 | ||
|
|
af404ff8ce | ||
|
|
1ce828da28 | ||
|
|
073977f69f | ||
|
|
5ca6863e97 | ||
|
|
afe1e8e126 | ||
|
|
5641f6257f | ||
|
|
ce3986e75a | ||
|
|
f4d87ce11c | ||
|
|
8ecf5893e6 | ||
|
|
321402c5a8 | ||
|
|
3ce4615d65 | ||
|
|
0d5a8f6bb7 | ||
|
|
dda6851673 | ||
|
|
3feb52cde7 | ||
|
|
096f314e1d | ||
|
|
f22bce320b | ||
|
|
527fd8d7d2 | ||
|
|
f016b20824 | ||
|
|
251caade33 | ||
|
|
7d06f9cd1e | ||
|
|
e23fcf2db0 | ||
|
|
b217f05541 | ||
|
|
8c0a8b888f | ||
|
|
b896219d87 | ||
|
|
eb42da51bb | ||
|
|
d808469d48 | ||
|
|
a0fc5566dd | ||
|
|
e0ca9372fc | ||
|
|
a8bc6aee1c | ||
|
|
355fad3e85 | ||
|
|
b1a90bfff4 | ||
|
|
100cfd502c | ||
|
|
fc6d3b5995 | ||
|
|
5cb40b6726 | ||
|
|
784f0940b8 | ||
|
|
3cb1bf80e0 | ||
|
|
137c01c9a8 | ||
|
|
4433751d7a | ||
|
|
a13954f7a6 | ||
|
|
98b6b3780b | ||
|
|
11f11947b5 | ||
|
|
01c42af175 | ||
|
|
00a6ef7e2e | ||
|
|
03bc0dd04d | ||
|
|
4587e728aa | ||
|
|
40847a559f | ||
|
|
4c1d48cbfc | ||
|
|
2b195e22bd | ||
|
|
eb31b32e80 | ||
|
|
83a446e62a | ||
|
|
fb190362cc | ||
|
|
d21d0a4c04 | ||
|
|
5e62fc320b | ||
|
|
7386ed8bd1 | ||
|
|
ff9b51c885 | ||
|
|
85f656db4c | ||
|
|
63229c0a0d | ||
|
|
10cec9669d | ||
|
|
9370e7d2a8 | ||
|
|
3b89449b19 | ||
|
|
010641f8b7 | ||
|
|
527dcb236a | ||
|
|
55746a425e | ||
|
|
41d063607c | ||
|
|
113a192da5 | ||
|
|
293d7ffa73 | ||
|
|
a63b8f03f4 | ||
|
|
ff1b77a70a | ||
|
|
7157c29ee8 | ||
|
|
45b3b0a96d | ||
|
|
b65f84bf94 | ||
|
|
9ebf9199a4 | ||
|
|
a688ad3b57 | ||
|
|
57bb2e656e | ||
|
|
12ad88f5c1 | ||
|
|
8f717f92aa | ||
|
|
fac78c4d0c | ||
|
|
0d672bf048 | ||
|
|
b7d59be6a4 | ||
|
|
7206cd3b01 | ||
|
|
aca3853e18 | ||
|
|
93be9a66d7 | ||
|
|
edaeb62db6 | ||
|
|
e89ea03496 | ||
|
|
cd740223b3 | ||
|
|
a82d3db454 | ||
|
|
cea52734ee | ||
|
|
b52c000d3b | ||
|
|
31d214cd3a | ||
|
|
54d12f7edd | ||
|
|
f600c4d144 | ||
|
|
049ca98c74 | ||
|
|
7b2d50e3af | ||
|
|
e099a4b5ed | ||
|
|
29d3ba4a7b | ||
|
|
28334dafe4 | ||
|
|
45758bf193 | ||
|
|
8cad33941c | ||
|
|
fd6c956d13 | ||
|
|
bb72a58753 | ||
|
|
be7c99efe2 | ||
|
|
1999eb9197 | ||
|
|
8221bfd7cc | ||
|
|
1a8f8ca40c | ||
|
|
634dad84ba | ||
|
|
871812bcec | ||
|
|
14b2e25723 | ||
|
|
2f8ecdbb34 | ||
|
|
26963dfc15 | ||
|
|
449de5e30c | ||
|
|
aa077d5438 | ||
|
|
1a371e5119 | ||
|
|
c1fcde2307 | ||
|
|
e219c94cdf | ||
|
|
fdd07a7508 | ||
|
|
2c43f8c612 | ||
|
|
8e1e6d357a | ||
|
|
8b8685ef31 | ||
|
|
326489aecd | ||
|
|
d2b51acd38 | ||
|
|
b9a2465910 | ||
|
|
c82129a317 | ||
|
|
68773fe3f1 | ||
|
|
b1307f5aff | ||
|
|
3af9591bb8 | ||
|
|
169f13cd05 | ||
|
|
18341ac6a9 | ||
|
|
b79b91615f | ||
|
|
cae99570f4 | ||
|
|
00ede118ac | ||
|
|
62bef312ad | ||
|
|
e1bf326a99 | ||
|
|
ddfcfb0da3 | ||
|
|
5624900715 | ||
|
|
de85b5f902 | ||
|
|
d38bf8ccf7 | ||
|
|
b451be06d5 | ||
|
|
8d1e103424 | ||
|
|
77ec117299 | ||
|
|
ce4a63537c | ||
|
|
578156186d | ||
|
|
e2915cc17d | ||
|
|
edd988b3cc | ||
|
|
296fe5d782 | ||
|
|
13b113c1f3 | ||
|
|
883cd6c62d | ||
|
|
172290c201 | ||
|
|
1679d72fee | ||
|
|
317732f3d9 | ||
|
|
fc1d2abff1 | ||
|
|
8078034c5b | ||
|
|
747c6d4b60 | ||
|
|
d29f838428 | ||
|
|
464232e6bb | ||
|
|
76d10c457c | ||
|
|
6631abaa8b | ||
|
|
4507236cbe |
@@ -49,7 +49,6 @@ null_AM_MAKEFLAGS = \
|
||||
|
||||
t=./=test
|
||||
my-distcheck: writable-files po-check
|
||||
|
||||
-rm -rf $(t)
|
||||
mkdir $(t)
|
||||
GZIP=$(GZIP) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
|
||||
@@ -61,8 +60,8 @@ my-distcheck: writable-files po-check
|
||||
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
|
||||
&& $(MAKE) dvi \
|
||||
&& $(MAKE) check \
|
||||
&& rm -rf $(DEPDIR) \
|
||||
&& $(MAKE) distclean
|
||||
&& $(MAKE) distclean \
|
||||
&& rm -rf $(DEPDIR)
|
||||
cd $(t) && mv $(distdir) $(distdir).old \
|
||||
&& $(AMTAR) -zxf ../$(distdir).tar.gz
|
||||
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
|
||||
|
||||
25
THANKS
25
THANKS
@@ -34,11 +34,12 @@ Bob McCracken kerouac@ravenet.com
|
||||
Bob Proulx rwp@fc.hp.com
|
||||
Brendan O'Dea bod@compusol.com.au
|
||||
Brian Kimball bfk@footbag.org
|
||||
Bruno Haible haible@ilog.fr
|
||||
Bruno Haible haible@clisp.cons.org
|
||||
Carl Johnson carlj@cjlinux.home.org
|
||||
Carl Lowenstein cdl@mpl.UCSD.EDU
|
||||
Carlos Canau Carlos.Canau@relay.puug.pt
|
||||
Charles Karney karney@pppl.gov
|
||||
Charles Randall crandall@matchlogic.com
|
||||
Chip Salzenberg chip@valinux.com
|
||||
Chris Yeo cyeo@biking.org
|
||||
Christi Alice Scarborough christi@chiark.greenend.org.uk
|
||||
@@ -60,6 +61,7 @@ Dirk-Jan Faber djfaber@snow.nl
|
||||
Don Parsons dparsons@synapse.kent.edu
|
||||
Donni Erpel donald@appc11.gsi.de
|
||||
Doug McLaren dougmc@comco.com
|
||||
Dragos Harabor dharabor@us.oracle.com
|
||||
Ed Avis epa98@doc.ic.ac.uk
|
||||
Edzer Pebesma Edzer.Pebesma@rivm.nl
|
||||
Eirik Fuller eirik@netcom.com
|
||||
@@ -82,35 +84,41 @@ Gary Anderson ganderson@clark.net
|
||||
Gaël Quéri gqueri@mail.dotcom.fr
|
||||
Geoff Odhner geoff@franklin.com
|
||||
Germano Leichsenring germano@jedi.cs.kobe-u.ac.jp
|
||||
GOTO Masanori gotom@debian.or.jp
|
||||
Greg McGary gkm@gnu.org
|
||||
Greg Troxel gdt@bbn.com
|
||||
Greg Wooledge gawooledge@sherwin.com
|
||||
Gregory Leblanc gleblanc@cu-portland.edu
|
||||
Göran Uddeborg goeran@uddeborg.pp.se
|
||||
H. J. Lu hjl@valinux.com
|
||||
Hans Verkuil hans@wyst.hobby.nl
|
||||
Holger Berger hberger@ess.nec.de
|
||||
Hugh Daniel hugh@xanadu.com
|
||||
Ian Jackson ijackson@chiark.greenend.org.uk
|
||||
Ian Lance Taylor ian@cygnus.com
|
||||
Ian Turner vectro@pipeline.com
|
||||
James james@albion.glarp.com
|
||||
James Antill jmanti%essex.ac.uk@seralph21.essex.ac.uk
|
||||
James Sneeringer jvs@ocslink.com
|
||||
James Tanis jtt@soscorp.com
|
||||
James Youngman james+usenet@free-lunch.demon.co.uk
|
||||
James james@albion.glarp.com
|
||||
Jamie Lokier jamie@imbolc.ucc.ie
|
||||
Janos Farkas chexum@shadow.banki.hu
|
||||
Jarkko Hietaniemi jhi@epsilon.hut.fi
|
||||
Jeff Moore jbm@mordor.com
|
||||
Jeff Sheinberg jeffsh@erols.com
|
||||
Jens Schmidt jms@jsds.hamburg.com
|
||||
Jerome Abela abela@hsc.fr
|
||||
Jesse Thilo jgt2@eecs.lehigh.edu
|
||||
Jie Xu xuj@iag.net
|
||||
Jim Blandy jimb@cyclic.com
|
||||
Jim Dennis jimd@starshine.org
|
||||
Joakim Rosqvist dvljrt@cs.umu.se
|
||||
Jochen Hein jochen.hein@delphi.central.de
|
||||
Jochen Hein jochen@jochen.org
|
||||
Joe Orton joe@orton.demon.co.uk
|
||||
Johan Danielsson joda@pdc.kth.se
|
||||
John Bley jbb6@acpub.duke.edu
|
||||
John David Anglin dave.anglin@nrc.ca
|
||||
John Gatewood Ham zappaman@alphabox.compsci.buu.ac.th
|
||||
John Gotts jgotts@umich.edu
|
||||
John Kendall kendall@capps.com
|
||||
@@ -119,6 +127,7 @@ John Murphy jam@philabs.research.philips.com
|
||||
John Roll john@panic.harvard.edu
|
||||
John Salmon johns@mullet.anu.edu.au
|
||||
John Summerfield summer@OS2.ami.com.au
|
||||
Joost van Baal joostvb@xs4all.nl
|
||||
Joseph S. Myers jsm28@cam.ac.uk
|
||||
jvogel jvogel@linkny.com
|
||||
Jürgen Fluk louis@dachau.marco.de
|
||||
@@ -140,6 +149,8 @@ Lorne Baker lbaker@nitro.avint.net
|
||||
Manas Garg manas@cygsoft.com
|
||||
Manfred Hollstein manfred@s-direktnet.de
|
||||
Marc Boucher marc@mbsi.ca
|
||||
Marc Olzheim marcolz@stack.nl
|
||||
Marco Franzen Marco.Franzen@Thyron.com
|
||||
Marcus Daniels marcus@ee.pdx.edu
|
||||
Mark A. Thomas thommark@access.digex.net
|
||||
Mark Harris mark@monitor.designacc.com
|
||||
@@ -147,18 +158,22 @@ Mark Hewitt mhewitt@armature.com
|
||||
Mark Kettenis kettenis@phys.uva.nl
|
||||
Mark W. Eichin eichin@cygnus.com
|
||||
Markus Demleitner msdemlei@auriga.ari.uni-heidelberg.de
|
||||
Martin martin@dresden.nacamar.de
|
||||
Martin Hippe martin.hippe@schlund.de
|
||||
Martin Mitchell martin@debian.org
|
||||
Martin P.J. Zinser zinser@decus.de
|
||||
Martin martin@dresden.nacamar.de
|
||||
Marty Leisner leisner@sdsp.mc.xerox.com
|
||||
Masami Takikawa takikawm@CS.ORST.EDU
|
||||
Mate Wierdl mw@moni.msci.memphis.edu
|
||||
Matej Vela mvela@public.srce.hr
|
||||
Matthew Braun matthew@ans.net
|
||||
Matthew Clarke Matthew_Clarke@mindlink.bc.ca
|
||||
Matthew S. Levine mslevine@theory.lcs.mit.edu
|
||||
Matthew Swift swift@alum.mit.edu
|
||||
Matthias Urlichs smurf@noris.de
|
||||
Meelis Roos mroos@tartu.cyber.ee
|
||||
Michael ??? michael@roka.net
|
||||
Michael Deutschmann michael@talamasca.ocis.net
|
||||
Michael Hasselberg mikelh@zonta.ping.de
|
||||
Michael Stone mstone@debian.org
|
||||
Michael Stutz stutz@dsl.org
|
||||
@@ -167,6 +182,7 @@ Michel Robitaille robitail@IRO.UMontreal.CA
|
||||
Michiel Bacchiani bacchian@raven.bu.edu
|
||||
Miles Bader miles@gnu.ai.mit.edu
|
||||
Minh Tran-Le tranle@intellicorp.com
|
||||
Morten Welinder terra@diku.dk
|
||||
Nelson H. F. Beebe beebe@math.utah.edu
|
||||
Niklas Edmundsson nikke@acc.umu.se
|
||||
Noah Friedman friedman@splode.com
|
||||
@@ -175,6 +191,7 @@ Olav Morkrid olav@funcom.com
|
||||
Paul Eggert eggert@twinsun.com
|
||||
Paul Nevai nevai@ops.mps.ohio-state.edu
|
||||
Paul Slootman paul@debian.org
|
||||
Per Cederqvist ceder@lysator.liu.se
|
||||
Per Kristian Hove perhov@math.ntnu.no
|
||||
Peter Eriksson peter@ifm.liu.se
|
||||
Peter Moulder reiter@netspace.net.au
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Makefile.in generated automatically by automake 1.4a from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
@@ -31,8 +31,6 @@ mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
@@ -57,6 +55,8 @@ POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
|
||||
@SET_MAKE@
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AMDEP = @AMDEP@
|
||||
@@ -86,8 +86,11 @@ INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
KMEM_GROUP = @KMEM_GROUP@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
|
||||
LIB_CRYPT = @LIB_CRYPT@
|
||||
LIB_NANOSLEEP = @LIB_NANOSLEEP@
|
||||
MAN = @MAN@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
@@ -145,7 +148,7 @@ all: all-redirect
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnits doc/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@@ -269,7 +272,6 @@ dist-info: $(INFO_DEPS)
|
||||
d=$(srcdir); \
|
||||
for file in `CDPATH=: && cd $$d && eval echo $$base*`; do \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done; \
|
||||
done
|
||||
@@ -303,11 +305,12 @@ distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pR $$d/$$file $(distdir); \
|
||||
cp -pR $$d/$$file $(distdir) \
|
||||
|| exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
$(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
|
||||
|
||||
@@ -113,13 +113,13 @@ specified differently, depending on whether the month is specified
|
||||
numerically or literally. All these strings specify the same calendar date:
|
||||
|
||||
@example
|
||||
1970-09-17 # ISO 8601.
|
||||
70-9-17 # Assume 19xx for 69 through 99, 20xx for 00 through 68.
|
||||
70-09-17 # Leading zeros are ignored.
|
||||
9/17/72 # Common U.S. writing.
|
||||
1972-09-24 # ISO 8601.
|
||||
72-9-24 # Assume 19xx for 69 through 99, 20xx for 00 through 68.
|
||||
72-09-24 # Leading zeros are ignored.
|
||||
9/24/72 # Common U.S. writing.
|
||||
24 September 1972
|
||||
24 Sept 72 # September has a special abbreviation.
|
||||
24 Sep 72 # Three-letter abbreviations always allowed.
|
||||
24 Sept 72 # September has a special abbreviation.
|
||||
24 Sep 72 # Three-letter abbreviations always allowed.
|
||||
Sep 24, 1972
|
||||
24-sep-72
|
||||
24sep72
|
||||
@@ -129,8 +129,8 @@ The year can also be omitted. In this case, the last specified year is
|
||||
used, or the current year if none. For example:
|
||||
|
||||
@example
|
||||
9/17
|
||||
sep 17
|
||||
9/24
|
||||
sep 24
|
||||
@end example
|
||||
|
||||
Here are the rules.
|
||||
|
||||
@@ -34,6 +34,7 @@ START-INFO-DIR-ENTRY
|
||||
* factor: (sh-utils)factor invocation. Print prime factors
|
||||
* false: (sh-utils)false invocation. Do nothing, unsuccessfully.
|
||||
* groups: (sh-utils)groups invocation. Print group names a user is in.
|
||||
* hostid: (sh-utils)hostid invocation. Print numeric host identifier.
|
||||
* hostname: (sh-utils)hostname invocation. Print or set system name.
|
||||
* id: (sh-utils)id invocation. Print real/effective uid/gid.
|
||||
* logname: (sh-utils)logname invocation. Print current login name.
|
||||
@@ -320,6 +321,21 @@ the @var{format} string.
|
||||
and @samp{\xhhh} as a hexadecimal number (if @var{hhh} is 1 to 3 hex
|
||||
digits) specifying a character to print.
|
||||
|
||||
@kindex \uhhhh
|
||||
@kindex \Uhhhhhhhh
|
||||
@code{printf} interprets two character syntaxes introduced in ISO C 99:
|
||||
@samp{\u} for 16-bit Unicode characters, specified as 4 hex digits
|
||||
@var{hhhh}, and @samp{\U} for 32-bit Unicode characters, specified as 8 hex
|
||||
digits @var{hhhhhhhh}. @code{printf} outputs the Unicode characters
|
||||
according to the LC_CTYPE part of the current locale, i.e. depending
|
||||
on the values of the environment variables @code{LC_ALL}, @code{LC_CTYPE},
|
||||
@code{LANG}.
|
||||
|
||||
The processing of @samp{\u} and @samp{\U} requires a full-featured
|
||||
@code{iconv} facility. It is activated on systems with glibc 2.2 (or newer),
|
||||
or when @code{libiconv} is installed prior to the sh-utils. Otherwise the
|
||||
use of @samp{\u} and @samp{\U} will give an error message.
|
||||
|
||||
@kindex \c
|
||||
An additional escape, @samp{\c}, causes @code{printf} to produce no
|
||||
further output.
|
||||
@@ -327,6 +343,40 @@ further output.
|
||||
The only options are a lone @samp{--help} or
|
||||
@samp{--version}. @xref{Common options}.
|
||||
|
||||
The Unicode character syntaxes are useful for writing strings in a locale
|
||||
independent way. For example, a string containing the Euro currency symbol
|
||||
|
||||
@example
|
||||
$ /usr/local/bin/printf '\u20AC 14.95'
|
||||
@end example
|
||||
|
||||
will be output correctly in all locales supporting the Euro symbol
|
||||
(ISO-8859-15, UTF-8, and others). Similarly, a Chinese string
|
||||
|
||||
@example
|
||||
$ /usr/local/bin/printf '\u4e2d\u6587'
|
||||
@end example
|
||||
|
||||
will be output correctly in all chinese locales (GB2312, BIG5, UTF-8, etc).
|
||||
|
||||
Note that in these examples, the full pathname of @code{printf} has been
|
||||
given, to distinguish it from the GNU bash builtin function @code{printf}.
|
||||
|
||||
For larger strings, you don't need to look up the hexadecimal code values of
|
||||
each character one by one. ASCII characters mixed with \u escape sequences
|
||||
is also known as the JAVA source file encoding. You can use GNU recode 3.5c
|
||||
(or newer) to convert strings to this encoding. Here is how to convert a
|
||||
piece of text into a shell script which will output this text in a locale
|
||||
independent way:
|
||||
|
||||
@smallexample
|
||||
$ LC_CTYPE=zh_CN.big5 /usr/local/bin/printf \
|
||||
'\u4e2d\u6587\n' > sample.txt
|
||||
$ recode BIG5..JAVA < sample.txt \
|
||||
| sed -e "s|^|/usr/local/bin/printf '|" -e "s|$|\\\\n'|" \
|
||||
> sample.sh
|
||||
@end smallexample
|
||||
|
||||
|
||||
@node yes invocation
|
||||
@section @code{yes}: Print a string until interrupted
|
||||
@@ -1571,8 +1621,8 @@ Same as:
|
||||
@example
|
||||
cread -ignbrk brkint -inlcr -igncr icrnl -ixoff -iuclc -ixany
|
||||
imaxbel opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel
|
||||
nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl
|
||||
-noflsh -xcase -tostop -echoprt echoctl echoke
|
||||
nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok
|
||||
-echonl -noflsh -xcase -tostop -echoprt echoctl echoke
|
||||
@end example
|
||||
@noindent and also sets all special characters to their default values.
|
||||
|
||||
@@ -1588,8 +1638,8 @@ May be negated. If negated, same as @code{raw}.
|
||||
Same as:
|
||||
@example
|
||||
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr
|
||||
-icrnl -ixon -ixoff -iuclc -ixany -imaxbel -opost -isig -icanon
|
||||
-xcase min 1 time 0
|
||||
-icrnl -ixon -ixoff -iuclc -ixany -imaxbel -opost -isig
|
||||
-icanon -xcase min 1 time 0
|
||||
@end example
|
||||
@noindent May be negated. If negated, same as @code{cooked}.
|
||||
|
||||
@@ -2131,6 +2181,7 @@ information.
|
||||
* date invocation:: Print or set system date and time.
|
||||
* uname invocation:: Print system information.
|
||||
* hostname invocation:: Print or set system name.
|
||||
* hostid invocation:: Print numeric host identifier.
|
||||
@end menu
|
||||
|
||||
|
||||
@@ -2665,7 +2716,6 @@ Print the operating system version.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@node hostname invocation
|
||||
@section @code{hostname}: Print or set system name
|
||||
|
||||
@@ -2688,6 +2738,29 @@ The only options are @samp{--help} and @samp{--version}. @xref{Common
|
||||
options}.
|
||||
|
||||
|
||||
@node hostid invocation
|
||||
@section @code{hostid}: Print numeric host identifier.
|
||||
|
||||
@pindex hostid
|
||||
@cindex printing the host identifier
|
||||
|
||||
@code{hostid} prints the numeric identifier of the current host
|
||||
in hexadecimal. This command accepts no arguments.
|
||||
The only options are @samp{--help} and @samp{--version}.
|
||||
@xref{Common options}.
|
||||
|
||||
For example, here's what it prints on one system I use:
|
||||
|
||||
@example
|
||||
$ hostid
|
||||
1bac013d
|
||||
@end example
|
||||
|
||||
On that system, the 32-bit quantity happens to be closely
|
||||
related to the system's Internet address, but that isn't always
|
||||
the case.
|
||||
|
||||
|
||||
@node Modified command invocation
|
||||
@chapter Modified command invocation
|
||||
|
||||
@@ -2734,6 +2807,34 @@ variable or @code{/bin/sh} if not set, invoked with the @samp{-i} option.
|
||||
The only options are @samp{--help} and @samp{--version}. @xref{Common
|
||||
options}.
|
||||
|
||||
Here are a few tips to help avoid common problems in using chroot.
|
||||
To start with a simple example, make @var{command} refer to a statically
|
||||
linked binary. If you were to use a dynamically linked executable, then
|
||||
you'd have to arrange to have the shared libraries in the right place under
|
||||
your new root directory.
|
||||
|
||||
For example, if you create a statically linked `ls' executable,
|
||||
and put it in /tmp/empty, you can run this command as root:
|
||||
|
||||
@example
|
||||
$ chroot /tmp/empty /ls -Rl /
|
||||
@end example
|
||||
|
||||
Then you'll see output like this:
|
||||
|
||||
@example
|
||||
/:
|
||||
total 1023
|
||||
-rwxr-xr-x 1 0 0 1041745 Aug 16 11:17 ls
|
||||
@end example
|
||||
|
||||
If you want to use a dynamically linked executable, say @code{bash},
|
||||
then first run @samp{ldd bash} to see what shared objects it needs.
|
||||
Then, in addition to copying the actual binary, also copy the listed
|
||||
files to the required positions under your intended new root directory.
|
||||
Finally, if the executable requires any other files (e.g., data, state,
|
||||
device files), copy them into place, too.
|
||||
|
||||
|
||||
@node env invocation
|
||||
@section @code{env}: Run a command in a modified environment
|
||||
@@ -3100,12 +3201,13 @@ options}.
|
||||
|
||||
The algorithm it uses is not very sophisticated, so for some inputs
|
||||
@code{factor} runs for a long time. The hardest numbers to factor are
|
||||
the products of large primes. Factoring the square of the largest 32-bit
|
||||
prime number takes over 10 minutes of CPU time on a 400MHz Pentium II.
|
||||
the products of large primes. Factoring the product of the two largest 32-bit
|
||||
prime numbers takes over 10 minutes of CPU time on a 400MHz Pentium II.
|
||||
|
||||
@example
|
||||
$ factor `echo '4294967291^2'|bc`
|
||||
18446744030759878681: 4294967291 4294967291
|
||||
$ p=`echo '4294967279 * 4294967291'|bc`
|
||||
$ factor $p
|
||||
18446743979220271189: 4294967279 4294967291
|
||||
@end example
|
||||
|
||||
In contrast, @code{factor} factors the largest 64-bit number in just
|
||||
@@ -3126,13 +3228,13 @@ $ factor `echo '2^64-1'|bc`
|
||||
@code{seq} prints a sequence of numbers to standard output. Synopses:
|
||||
|
||||
@example
|
||||
seq [@var{option}]@dots{} [@var{first} [@var{step}]] @var{last}@dots{}
|
||||
seq [@var{option}]@dots{} [@var{first} [@var{increment}]] @var{last}@dots{}
|
||||
@end example
|
||||
|
||||
@code{seq} prints the numbers from @var{first} to @var{last} by
|
||||
@var{step}. By default, @var{first} and @var{step} are both 1, and each
|
||||
number is printed on its own line. All numbers can be reals, not just
|
||||
integers.
|
||||
@var{increment}. By default, @var{first} and @var{increment} are both 1,
|
||||
and each number is printed on its own line. All numbers can be reals,
|
||||
not just integers.
|
||||
|
||||
The program accepts the following options. Also see @ref{Common options}.
|
||||
|
||||
@@ -3220,6 +3322,35 @@ FFFFFFFF
|
||||
100000000
|
||||
@end example
|
||||
|
||||
Be careful when using @code{seq} with a fractional @var{increment},
|
||||
otherwise you may see surprising results. Most people would expect to
|
||||
see @code{0.3} printed as the last number in this example:
|
||||
|
||||
@example
|
||||
$ seq -s' ' 0 .1 .3
|
||||
0 0.1 0.2
|
||||
@end example
|
||||
|
||||
But doesn't happen on most systems because @code{seq} is implemented using
|
||||
binary floating point arithmetic (via the C @code{double} type) -- which
|
||||
means some decimal numbers like @code{.1} cannot be represented exactly.
|
||||
That in turn means some nonintuitive conditions like @code{.1 * 3 > .3}
|
||||
will end up being true.
|
||||
|
||||
To work around that in the above example, use a slightly larger number as
|
||||
the @var{last} value:
|
||||
|
||||
@example
|
||||
$ seq -s' ' 0 .1 .31
|
||||
0 0.1 0.2 0.3
|
||||
@end example
|
||||
|
||||
In general, when using an @var{increment} with a fractional part, where
|
||||
(@var{last} - @var{first}) / @var{increment} is (mathematically) a whole
|
||||
number, specify a slightly larger (or smaller, if @var{increment} is negative)
|
||||
value for @var{last} to ensure that @var{last} is the final value printed
|
||||
by seq.
|
||||
|
||||
@node Index
|
||||
@unnumbered Index
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
@c %**end of header
|
||||
|
||||
@include version.texi
|
||||
@include constants.texi
|
||||
|
||||
@c Define new indices.
|
||||
@defcodeindex op
|
||||
@@ -248,14 +249,13 @@ overall process.
|
||||
|
||||
@cindex common options
|
||||
|
||||
Certain options are available in all these programs. Rather than
|
||||
Certain options are available in all of these programs. Rather than
|
||||
writing identical descriptions for each of the programs, they are
|
||||
described here. (In fact, every GNU program accepts (or should accept)
|
||||
these options.)
|
||||
|
||||
A few of these programs take arbitrary strings as arguments. In those
|
||||
cases, @samp{--help} and @samp{--version} are taken as these options
|
||||
only if there is one and exactly one command line argument.
|
||||
Some of these programs recognize the @samp{--help} and @samp{--version}
|
||||
options only when one of them is the sole command line argument.
|
||||
|
||||
@table @samp
|
||||
|
||||
@@ -1546,26 +1546,16 @@ terminate until long after the real writer has terminated.
|
||||
Note that @samp{--pid} cannot be supported on some systems; @code{tail}
|
||||
will print a warning if this is the case.
|
||||
|
||||
@itemx --max-consecutive-size-changes=@var{n}
|
||||
@opindex --max-consecutive-size-changes
|
||||
This option is meaningful only when following by name.
|
||||
Use it to control how long @code{tail} follows the descriptor of a file
|
||||
that continues growing at a rapid pace even after it is deleted or renamed.
|
||||
After detecting @var{n} consecutive size changes for a file,
|
||||
@code{open}/@code{fstat} the file to determine if that file name is
|
||||
still associated with the same device/inode-number pair as before.
|
||||
See the output of @code{tail --help} for the default value.
|
||||
|
||||
@itemx --max-unchanged-stats=@var{n}
|
||||
@opindex --max-unchanged-stats
|
||||
When tailing a file by name, if there have been this many consecutive
|
||||
When tailing a file by name, if there have been @var{n} (default
|
||||
N=@value{DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS}) consecutive
|
||||
iterations for which the size has remained the same, then
|
||||
@code{open}/@code{fstat} the file to determine if that file name is
|
||||
still associated with the same device/inode-number pair as before.
|
||||
When following a log file that is rotated, this is approximately the
|
||||
number of seconds between when tail prints the last pre-rotation lines
|
||||
and when it prints the lines that have accumulated in the new log file.
|
||||
See the output of @code{tail --help} for the default value.
|
||||
This option is meaningful only when following by name.
|
||||
|
||||
@itemx -n @var{n}
|
||||
|
||||
@@ -6,4 +6,5 @@ getopt1.c
|
||||
md5.h
|
||||
obstack.h
|
||||
regex.h
|
||||
regex.c
|
||||
getpagesize.h
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
.deps
|
||||
Makefile
|
||||
charset.alias
|
||||
getdate.c
|
||||
getdate.tab.c
|
||||
lstat.c
|
||||
ref-add.sed
|
||||
ref-del.sed
|
||||
safe-lstat.c
|
||||
safe-lstat.h
|
||||
safe-stat.c
|
||||
|
||||
@@ -195,3 +195,6 @@ p u
|
||||
n
|
||||
p u
|
||||
n
|
||||
r -r .aa > k
|
||||
pwd
|
||||
q
|
||||
|
||||
252
lib/ChangeLog
252
lib/ChangeLog
@@ -1,3 +1,255 @@
|
||||
2000-05-18 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
|
||||
back, too, since it may have been modified by allocate_entry.
|
||||
(hash_delete): Rewrite to use neither the assignment operator
|
||||
nor the comma operator in an if-expression.
|
||||
|
||||
2000-05-15 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* lib/closeout.c:
|
||||
<sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
|
||||
Remove; no longer needed.
|
||||
"quotearg.h": Add include.
|
||||
(file_name): Do not bother to explicitly initialize to NULL; it's less
|
||||
efficient on some hosts.
|
||||
(close_stdout_status): Remove test as to whether stdout was already
|
||||
closed; it breaks for the case "echo x | sort >&-".
|
||||
Quote file name colons.
|
||||
Do not assume that _("write error") lacks format strings.
|
||||
|
||||
2000-05-15 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* version-etc.c (version_etc_copyright): Update the copyright string
|
||||
used in all --version output.
|
||||
|
||||
2000-05-14 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* closeout.c (close_stdout_set_file_name): New function.
|
||||
(close_stdout_status): Use new file-scoped global.
|
||||
Return right away if fstat says the stdout file descriptor is invalid.
|
||||
* closeout.h (close_stdout_set_file_name): Declare.
|
||||
|
||||
2000-05-10 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* closeout.c [default_exit_status]: New file-scoped variable.
|
||||
(close_stdout_set_status): New function.
|
||||
* closeout.h (close_stdout_set_status): Declare.
|
||||
|
||||
2000-05-08 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* long-options.c: Don't include closeout.h.
|
||||
(parse_long_options): Don't call close_stdout for --version.
|
||||
|
||||
2000-05-06 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* strnlen.c: Undefine __strnlen and strnlen.
|
||||
[!weak_alias]: Define __strnlen to strnlen.
|
||||
|
||||
* atexit.c: New file, from libiberty.
|
||||
|
||||
2000-05-06 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* closeout.c (close_stdout_status): Also check for errors on the
|
||||
stderr stream.
|
||||
|
||||
2000-05-05 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
|
||||
instead of xmalloc, xrealloc, path_concat.
|
||||
(locale_charset): Treat empty environment variables as absent.
|
||||
(DIRECTORY_SEPARATOR, ISSLASH): New macros.
|
||||
|
||||
2000-05-04 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* getopt.c: Update from glibc.
|
||||
* obstack.c: Likewise.
|
||||
* obstack.h: Likewise.
|
||||
* regex.c: Likewise. NB: K&R compiler support is dropped for this file
|
||||
|
||||
* regex.h: Likewise.
|
||||
* strndup.c: Likewise.
|
||||
* strnlen.c: New file, from glibc.
|
||||
|
||||
2000-05-01 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* full-write.c (full_write): Remove `FIXME' part of comment.
|
||||
|
||||
2000-04-29 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* path-concat.c: Declare strdup only if it's not defined.
|
||||
* canon-host.c: Likewise.
|
||||
|
||||
2000-04-28 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
|
||||
redefinition warning on some systems (HPUX). Otherwise, regex.h is
|
||||
included first, then limits.h is included by locale.h by libintl.h.
|
||||
From John David Anglin.
|
||||
|
||||
2000-04-25 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* makepath.c (S_IRWXUGO): Define.
|
||||
(make_path): Always perform explicit chmod if MODE specifies any
|
||||
of the `special' permission bits. Prompted by a bug report against
|
||||
install from Mate Wierdl and Joost van Baal.
|
||||
|
||||
2000-04-18 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* README: New file.
|
||||
|
||||
* getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
|
||||
getpagesize. For BeOS. Based on a patch from Bruno Haible.
|
||||
|
||||
2000-04-17 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* strftime.c (my_strftime) [strftime]: Declare strftime here, since
|
||||
the definition of it to rpl_strftime also defined-away the system's
|
||||
declaration.
|
||||
|
||||
2000-04-15 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Use `C' to denote so-called `contiguous' files, the same way
|
||||
that tar does.
|
||||
* filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
|
||||
(ftypelet): Use S_ISCTG.
|
||||
From Michael Deutschmann.
|
||||
|
||||
2000-04-14 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
|
||||
|
||||
2000-04-08 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
|
||||
names don't conflict. Reported by Eli Zaretskii.
|
||||
|
||||
2000-03-28 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
|
||||
bug. Deal with the different error behavior of Irix iconv.
|
||||
|
||||
2000-04-07 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
|
||||
to work around system header problems on AIX 3.2.5. From Bruno Haible.
|
||||
|
||||
2000-04-05 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Portability tweaks required for ultrix4.3.
|
||||
* readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
|
||||
* readutmp.c: Include sys/types.h before sys/stat.h.
|
||||
* canon-host.c: Declare strdup.
|
||||
* path-concat.c: Likewise.
|
||||
From John David Anglin.
|
||||
|
||||
2000-04-04 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Be more DOS 8.3-friendly.
|
||||
* ref-add.sin: Renamed from ref-add.sed.in.
|
||||
* ref-del.sin: Renamed from ref-del.sed.in.
|
||||
* Makefile.am: Reflect renaming.
|
||||
Reported by Eli Zaretskii.
|
||||
|
||||
Use a temporary file name that won't clash with `charset.alias'
|
||||
in the DOS 8.3 name space.
|
||||
* Makefile.am (charset_tmp): Define.
|
||||
(install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
|
||||
(uninstall-local): Likewise.
|
||||
Reported by Eli Zaretskii.
|
||||
|
||||
2000-03-29 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* time/strftime.c (my_strftime): Make sure we call the system
|
||||
strftime, not ourselves, when invoking the underlying strftime.
|
||||
|
||||
2000-03-24 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
|
||||
(charset_alias): Define.
|
||||
(install-exec-local): Factor out common code.
|
||||
(uninstall-local): Split lines longer than 80.
|
||||
(ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
|
||||
(SUFFIXES): Define.
|
||||
(.sed.in.sed): New rule. Don't redirect directly to $@.
|
||||
(CLEANFILES): Add ref-add.sed and ref-del.sed.
|
||||
|
||||
2000-03-19 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* config.charset: Output a line containing "Packages using this file".
|
||||
* ref-add.sed.in, ref-del.sed.in: New files.
|
||||
* Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
|
||||
ref-del.sed): New rules.
|
||||
|
||||
2000-03-17 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
|
||||
Otherwise, include <strings.h>
|
||||
|
||||
2000-03-17 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* unicodeio.c (utf8_wctomb): New function.
|
||||
(print_unicode_char): Pass the Unicode character to iconv in UTF-8
|
||||
format instead of in UCS-4 with platform dependent endianness.
|
||||
|
||||
2000-03-07 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* lib/savedir.c (savedir): Work even if directory size is
|
||||
negative; this can happen with some screwy NFS configurations.
|
||||
|
||||
2000-03-06 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* localcharset.c (get_charset_aliases): Don't try to free file_name
|
||||
if it's NULL (because we ran out of memory). From Bruno Haible.
|
||||
|
||||
2000-03-05 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* localcharset.c ("path-concat.h"): Include.
|
||||
(get_charset_aliases): Use path_concat instead of ANSI string
|
||||
concatenation.
|
||||
|
||||
* unicodeio.h (PARAMS): Define.
|
||||
Use it to guard prototype.
|
||||
|
||||
2000-03-04 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Makefile.am (install-exec-local): Create $(libdir) before installing
|
||||
into it.
|
||||
(uninstall-local): Uncomment this rule so `make distcheck' works
|
||||
once again.
|
||||
|
||||
* unicodeio.c (<errno.h>): Include it.
|
||||
(errno): Declare if not defined.
|
||||
|
||||
* localcharset.c: Add Bruno's comment justifying use of volatile.
|
||||
|
||||
* config.charset: New version, incorporating remarks from a linux
|
||||
i18n mailing list. From Bruno Haible.
|
||||
|
||||
2000-03-02 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Add config.charset.
|
||||
|
||||
2000-03-01 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* localcharset.c: Guard some #includes with `#if HAVE_...'.
|
||||
* unicodeio.c: Likewise.
|
||||
|
||||
2000-02-02 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* config.charset: New file.
|
||||
* localcharset.c: New file.
|
||||
* unicodeio.h, unicodeio.c: New files.
|
||||
* Makefile.am (DEFS): Add -DLIBDIR=...
|
||||
(libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
|
||||
(noinst_HEADERS): Add unicodeio.h.
|
||||
(all-local, install-exec-local, charset.alias): New targets.
|
||||
|
||||
2000-02-28 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* lib/quotearg.c (ALERT_CHAR): New macro.
|
||||
(quotearg_buffer_restyled): Use it.
|
||||
|
||||
2000-02-27 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
|
||||
|
||||
@@ -5,16 +5,18 @@ AUTOMAKE_OPTIONS = ../src/ansi2knr
|
||||
noinst_LIBRARIES = libfetish.a
|
||||
|
||||
INCLUDES = -I.. -I$(srcdir) -I../intl
|
||||
DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@
|
||||
|
||||
libfetish_a_SOURCES = \
|
||||
getdate.y posixtm.c addext.c argmatch.c backupfile.c basename.c \
|
||||
canon-host.c closeout.c dirname.c exclude.c filemode.c diacrit.c \
|
||||
canon-host.c closeout.c diacrit.c dirname.c exclude.c filemode.c \
|
||||
full-write.c getopt.c getopt1.c getugroups.c hard-locale.c hash.c \
|
||||
human.c idcache.c isdir.c linebuffer.c long-options.c makepath.c \
|
||||
md5.c memcasecmp.c memcoll.c modechange.c path-concat.c \
|
||||
human.c idcache.c isdir.c linebuffer.c localcharset.c long-options.c \
|
||||
makepath.c md5.c memcasecmp.c memcoll.c modechange.c path-concat.c \
|
||||
quotearg.c readtokens.c readutmp.c safe-read.c same.c save-cwd.c \
|
||||
savedir.c stripslash.c userspec.c version-etc.c xgetcwd.c xgethostname.c \
|
||||
xmalloc.c xstrdup.c xstrtod.c xstrtol.c xstrtoul.c xstrtoumax.c yesno.c
|
||||
savedir.c stripslash.c unicodeio.c userspec.c version-etc.c xgetcwd.c \
|
||||
xgethostname.c xmalloc.c xstrdup.c xstrtod.c xstrtol.c xstrtoul.c \
|
||||
xstrtoumax.c yesno.c
|
||||
|
||||
libfetish_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
|
||||
@@ -27,13 +29,13 @@ noinst_HEADERS = \
|
||||
makepath.h modechange.h mountlist.h nanosleep.h obstack.h \
|
||||
path-concat.h pathmax.h posixtm.h quotearg.h readtokens.h \
|
||||
readutmp.h regex.h safe-read.h same.h save-cwd.h savedir.h \
|
||||
strverscmp.h version-etc.h xalloc.h xstrtod.h xstrtol.h
|
||||
strverscmp.h unicodeio.h version-etc.h xalloc.h xstrtod.h xstrtol.h
|
||||
|
||||
BUILT_SOURCES = getdate.c lstat.c stat.c
|
||||
MAINTAINERCLEANFILES = $(BUILT_SOURCES)
|
||||
DISTCLEANFILES = lstat.c stat.c
|
||||
|
||||
EXTRA_DIST = xstat.in
|
||||
EXTRA_DIST = xstat.in config.charset ref-add.sin ref-del.sin
|
||||
lstat.c: xstat.in
|
||||
sed \
|
||||
-e '/@IGNORE@/d' \
|
||||
@@ -51,3 +53,45 @@ stat.c: xstat.in
|
||||
-e '/@BEGIN_LSTAT_ONLY@/,/@END_LSTAT_ONLY@/d' \
|
||||
$(srcdir)/xstat.in > $@-t
|
||||
mv $@-t $@
|
||||
|
||||
|
||||
# The following is needed in order to install a simple file in $(libdir)
|
||||
# which is shared with other installed packages. We use a list of referencing
|
||||
# packages so that "make uninstall" will remove the file if and only if it
|
||||
# is not used by another installed package.
|
||||
|
||||
all-local: charset.alias ref-add.sed ref-del.sed
|
||||
|
||||
charset_alias = $(DESTDIR)$(libdir)/charset.alias
|
||||
charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
|
||||
install-exec-local: all-local
|
||||
$(mkinstalldirs) $(DESTDIR)$(libdir)
|
||||
test -f $(charset_alias) \
|
||||
&& orig=$(charset_alias) \
|
||||
|| orig=charset.alias; \
|
||||
sed -f ref-add.sed $$orig > $(charset_tmp)
|
||||
$(INSTALL_DATA) $(charset_tmp) $(charset_alias)
|
||||
rm -f $(charset_tmp)
|
||||
|
||||
uninstall-local: all-local
|
||||
if test -f $(charset_alias); then \
|
||||
sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
|
||||
if grep '^# Packages using this file: $$' $(charset_tmp) \
|
||||
> /dev/null; then \
|
||||
rm -f $(charset_alias); \
|
||||
else \
|
||||
$(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
|
||||
fi; \
|
||||
rm -f $(charset_tmp); \
|
||||
fi
|
||||
|
||||
charset.alias: config.charset
|
||||
$(SHELL) $(srcdir)/config.charset '@host@' > t-$@
|
||||
mv t-$@ $@
|
||||
|
||||
SUFFIXES = .sed .sin
|
||||
.sin.sed:
|
||||
sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > $@-t
|
||||
mv $@-t $@
|
||||
|
||||
CLEANFILES = charset.alias ref-add.sed ref-del.sed
|
||||
|
||||
262
lib/Makefile.in
262
lib/Makefile.in
@@ -1,6 +1,6 @@
|
||||
# Makefile.in generated automatically by automake 1.4a from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
@@ -31,8 +31,6 @@ mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
@@ -57,6 +55,8 @@ POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
|
||||
@SET_MAKE@
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AMDEP = @AMDEP@
|
||||
@@ -86,8 +86,11 @@ INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
KMEM_GROUP = @KMEM_GROUP@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
|
||||
LIB_CRYPT = @LIB_CRYPT@
|
||||
LIB_NANOSLEEP = @LIB_NANOSLEEP@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MAN = @MAN@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
@@ -116,16 +119,18 @@ AUTOMAKE_OPTIONS = ../src/ansi2knr
|
||||
noinst_LIBRARIES = libfetish.a
|
||||
|
||||
INCLUDES = -I.. -I$(srcdir) -I../intl
|
||||
DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@
|
||||
|
||||
libfetish_a_SOURCES = \
|
||||
getdate.y posixtm.c addext.c argmatch.c backupfile.c basename.c \
|
||||
canon-host.c closeout.c dirname.c exclude.c filemode.c diacrit.c \
|
||||
canon-host.c closeout.c diacrit.c dirname.c exclude.c filemode.c \
|
||||
full-write.c getopt.c getopt1.c getugroups.c hard-locale.c hash.c \
|
||||
human.c idcache.c isdir.c linebuffer.c long-options.c makepath.c \
|
||||
md5.c memcasecmp.c memcoll.c modechange.c path-concat.c \
|
||||
human.c idcache.c isdir.c linebuffer.c localcharset.c long-options.c \
|
||||
makepath.c md5.c memcasecmp.c memcoll.c modechange.c path-concat.c \
|
||||
quotearg.c readtokens.c readutmp.c safe-read.c same.c save-cwd.c \
|
||||
savedir.c stripslash.c userspec.c version-etc.c xgetcwd.c xgethostname.c \
|
||||
xmalloc.c xstrdup.c xstrtod.c xstrtol.c xstrtoul.c xstrtoumax.c yesno.c
|
||||
savedir.c stripslash.c unicodeio.c userspec.c version-etc.c xgetcwd.c \
|
||||
xgethostname.c xmalloc.c xstrdup.c xstrtod.c xstrtol.c xstrtoul.c \
|
||||
xstrtoumax.c yesno.c
|
||||
|
||||
|
||||
libfetish_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
@@ -139,22 +144,27 @@ noinst_HEADERS = \
|
||||
makepath.h modechange.h mountlist.h nanosleep.h obstack.h \
|
||||
path-concat.h pathmax.h posixtm.h quotearg.h readtokens.h \
|
||||
readutmp.h regex.h safe-read.h same.h save-cwd.h savedir.h \
|
||||
strverscmp.h version-etc.h xalloc.h xstrtod.h xstrtol.h
|
||||
strverscmp.h unicodeio.h version-etc.h xalloc.h xstrtod.h xstrtol.h
|
||||
|
||||
|
||||
BUILT_SOURCES = getdate.c lstat.c stat.c
|
||||
MAINTAINERCLEANFILES = $(BUILT_SOURCES)
|
||||
DISTCLEANFILES = lstat.c stat.c
|
||||
|
||||
EXTRA_DIST = xstat.in
|
||||
EXTRA_DIST = xstat.in config.charset ref-add.sin ref-del.sin
|
||||
|
||||
charset_alias = $(DESTDIR)$(libdir)/charset.alias
|
||||
charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
|
||||
|
||||
SUFFIXES = .sed .sin
|
||||
|
||||
CLEANFILES = charset.alias ref-add.sed ref-del.sed
|
||||
subdir = lib
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
|
||||
|
||||
DEFS = @DEFS@ -I. -I$(srcdir) -I..
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
@@ -162,14 +172,15 @@ ANSI2KNR = ../src/ansi2knr
|
||||
libfetish_a_AR = $(AR) cru
|
||||
am_libfetish_a_OBJECTS = getdate$U.o posixtm$U.o addext$U.o \
|
||||
argmatch$U.o backupfile$U.o basename$U.o canon-host$U.o closeout$U.o \
|
||||
dirname$U.o exclude$U.o filemode$U.o diacrit$U.o full-write$U.o \
|
||||
diacrit$U.o dirname$U.o exclude$U.o filemode$U.o full-write$U.o \
|
||||
getopt$U.o getopt1$U.o getugroups$U.o hard-locale$U.o hash$U.o \
|
||||
human$U.o idcache$U.o isdir$U.o linebuffer$U.o long-options$U.o \
|
||||
makepath$U.o md5$U.o memcasecmp$U.o memcoll$U.o modechange$U.o \
|
||||
path-concat$U.o quotearg$U.o readtokens$U.o readutmp$U.o safe-read$U.o \
|
||||
same$U.o save-cwd$U.o savedir$U.o stripslash$U.o userspec$U.o \
|
||||
version-etc$U.o xgetcwd$U.o xgethostname$U.o xmalloc$U.o xstrdup$U.o \
|
||||
xstrtod$U.o xstrtol$U.o xstrtoul$U.o xstrtoumax$U.o yesno$U.o
|
||||
human$U.o idcache$U.o isdir$U.o linebuffer$U.o localcharset$U.o \
|
||||
long-options$U.o makepath$U.o md5$U.o memcasecmp$U.o memcoll$U.o \
|
||||
modechange$U.o path-concat$U.o quotearg$U.o readtokens$U.o readutmp$U.o \
|
||||
safe-read$U.o same$U.o save-cwd$U.o savedir$U.o stripslash$U.o \
|
||||
unicodeio$U.o userspec$U.o version-etc$U.o xgetcwd$U.o xgethostname$U.o \
|
||||
xmalloc$U.o xstrdup$U.o xstrtod$U.o xstrtol$U.o xstrtoul$U.o \
|
||||
xstrtoumax$U.o yesno$U.o
|
||||
libfetish_a_OBJECTS = $(am_libfetish_a_OBJECTS)
|
||||
AR = ar
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
@@ -179,23 +190,9 @@ LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_SOURCES = $(libfetish_a_SOURCES)
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
|
||||
DIST_COMMON = $(noinst_HEADERS) ChangeLog Makefile.am Makefile.in TODO \
|
||||
alloca.c chown.c dup2.c error.c error.h euidaccess.c fileblocks.c \
|
||||
fnmatch.c fsusage.c ftruncate.c getdate.c getgroups.c gethostname.c \
|
||||
getline.c getloadavg.c getusershell.c group-member.c lchown.c malloc.c \
|
||||
memchr.c memcmp.c memcpy.c memmove.c memset.c mkdir.c mktime.c \
|
||||
mountlist.c nanosleep.c obstack.c obstack.h putenv.c realloc.c regex.c \
|
||||
rmdir.c rpmatch.c stime.c stpcpy.c strcasecmp.c strcspn.c strdup.c \
|
||||
strftime.c strncasecmp.c strndup.c strpbrk.c strstr.c strtod.c strtol.c \
|
||||
strtoul.c strtoull.c strtoumax.c strverscmp.c utime.c
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
GZIP_ENV = --best
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
DEP_FILES = @AMDEP@ $(DEPDIR)/addext$U.Po $(DEPDIR)/alloca.Po \
|
||||
$(DEPDIR)/argmatch$U.Po $(DEPDIR)/backupfile$U.Po \
|
||||
$(DEPDIR)/argmatch$U.Po $(DEPDIR)/atexit.Po $(DEPDIR)/backupfile$U.Po \
|
||||
$(DEPDIR)/basename$U.Po $(DEPDIR)/canon-host$U.Po $(DEPDIR)/chown.Po \
|
||||
$(DEPDIR)/closeout$U.Po $(DEPDIR)/diacrit$U.Po $(DEPDIR)/dirname$U.Po \
|
||||
$(DEPDIR)/dup2.Po $(DEPDIR)/error.Po $(DEPDIR)/euidaccess.Po \
|
||||
@@ -207,38 +204,55 @@ $(DEPDIR)/getopt$U.Po $(DEPDIR)/getopt1$U.Po $(DEPDIR)/getugroups$U.Po \
|
||||
$(DEPDIR)/getusershell.Po $(DEPDIR)/group-member.Po \
|
||||
$(DEPDIR)/hard-locale$U.Po $(DEPDIR)/hash$U.Po $(DEPDIR)/human$U.Po \
|
||||
$(DEPDIR)/idcache$U.Po $(DEPDIR)/isdir$U.Po $(DEPDIR)/lchown.Po \
|
||||
$(DEPDIR)/linebuffer$U.Po $(DEPDIR)/long-options$U.Po \
|
||||
$(DEPDIR)/lstat.Po $(DEPDIR)/makepath$U.Po $(DEPDIR)/malloc.Po \
|
||||
$(DEPDIR)/md5$U.Po $(DEPDIR)/memcasecmp$U.Po $(DEPDIR)/memchr.Po \
|
||||
$(DEPDIR)/memcmp.Po $(DEPDIR)/memcoll$U.Po $(DEPDIR)/memcpy.Po \
|
||||
$(DEPDIR)/memmove.Po $(DEPDIR)/memset.Po $(DEPDIR)/mkdir.Po \
|
||||
$(DEPDIR)/mktime.Po $(DEPDIR)/modechange$U.Po $(DEPDIR)/mountlist.Po \
|
||||
$(DEPDIR)/nanosleep.Po $(DEPDIR)/obstack.Po $(DEPDIR)/path-concat$U.Po \
|
||||
$(DEPDIR)/posixtm$U.Po $(DEPDIR)/putenv.Po $(DEPDIR)/quotearg$U.Po \
|
||||
$(DEPDIR)/readtokens$U.Po $(DEPDIR)/readutmp$U.Po $(DEPDIR)/realloc.Po \
|
||||
$(DEPDIR)/regex.Po $(DEPDIR)/rmdir.Po $(DEPDIR)/rpmatch.Po \
|
||||
$(DEPDIR)/safe-read$U.Po $(DEPDIR)/same$U.Po $(DEPDIR)/save-cwd$U.Po \
|
||||
$(DEPDIR)/savedir$U.Po $(DEPDIR)/stat.Po $(DEPDIR)/stime.Po \
|
||||
$(DEPDIR)/stpcpy.Po $(DEPDIR)/strcasecmp.Po $(DEPDIR)/strcspn.Po \
|
||||
$(DEPDIR)/strdup.Po $(DEPDIR)/strftime.Po $(DEPDIR)/stripslash$U.Po \
|
||||
$(DEPDIR)/strncasecmp.Po $(DEPDIR)/strndup.Po $(DEPDIR)/strpbrk.Po \
|
||||
$(DEPDIR)/strstr.Po $(DEPDIR)/strtod.Po $(DEPDIR)/strtol.Po \
|
||||
$(DEPDIR)/strtoul.Po $(DEPDIR)/strtoull.Po $(DEPDIR)/strtoumax.Po \
|
||||
$(DEPDIR)/strverscmp.Po $(DEPDIR)/userspec$U.Po $(DEPDIR)/utime.Po \
|
||||
$(DEPDIR)/version-etc$U.Po $(DEPDIR)/xgetcwd$U.Po \
|
||||
$(DEPDIR)/xgethostname$U.Po $(DEPDIR)/xmalloc$U.Po \
|
||||
$(DEPDIR)/xstrdup$U.Po $(DEPDIR)/xstrtod$U.Po $(DEPDIR)/xstrtol$U.Po \
|
||||
$(DEPDIR)/xstrtoul$U.Po $(DEPDIR)/xstrtoumax$U.Po $(DEPDIR)/yesno$U.Po
|
||||
$(DEPDIR)/linebuffer$U.Po $(DEPDIR)/localcharset$U.Po \
|
||||
$(DEPDIR)/long-options$U.Po $(DEPDIR)/lstat.Po $(DEPDIR)/makepath$U.Po \
|
||||
$(DEPDIR)/malloc.Po $(DEPDIR)/md5$U.Po $(DEPDIR)/memcasecmp$U.Po \
|
||||
$(DEPDIR)/memchr.Po $(DEPDIR)/memcmp.Po $(DEPDIR)/memcoll$U.Po \
|
||||
$(DEPDIR)/memcpy.Po $(DEPDIR)/memmove.Po $(DEPDIR)/memset.Po \
|
||||
$(DEPDIR)/mkdir.Po $(DEPDIR)/mktime.Po $(DEPDIR)/modechange$U.Po \
|
||||
$(DEPDIR)/mountlist.Po $(DEPDIR)/nanosleep.Po $(DEPDIR)/obstack.Po \
|
||||
$(DEPDIR)/path-concat$U.Po $(DEPDIR)/posixtm$U.Po $(DEPDIR)/putenv.Po \
|
||||
$(DEPDIR)/quotearg$U.Po $(DEPDIR)/readtokens$U.Po \
|
||||
$(DEPDIR)/readutmp$U.Po $(DEPDIR)/realloc.Po $(DEPDIR)/regex.Po \
|
||||
$(DEPDIR)/rmdir.Po $(DEPDIR)/rpmatch.Po $(DEPDIR)/safe-read$U.Po \
|
||||
$(DEPDIR)/same$U.Po $(DEPDIR)/save-cwd$U.Po $(DEPDIR)/savedir$U.Po \
|
||||
$(DEPDIR)/stat.Po $(DEPDIR)/stime.Po $(DEPDIR)/stpcpy.Po \
|
||||
$(DEPDIR)/strcasecmp.Po $(DEPDIR)/strcspn.Po $(DEPDIR)/strdup.Po \
|
||||
$(DEPDIR)/strftime.Po $(DEPDIR)/stripslash$U.Po \
|
||||
$(DEPDIR)/strncasecmp.Po $(DEPDIR)/strndup.Po $(DEPDIR)/strnlen.Po \
|
||||
$(DEPDIR)/strpbrk.Po $(DEPDIR)/strstr.Po $(DEPDIR)/strtod.Po \
|
||||
$(DEPDIR)/strtol.Po $(DEPDIR)/strtoul.Po $(DEPDIR)/strtoull.Po \
|
||||
$(DEPDIR)/strtoumax.Po $(DEPDIR)/strverscmp.Po $(DEPDIR)/unicodeio$U.Po \
|
||||
$(DEPDIR)/userspec$U.Po $(DEPDIR)/utime.Po $(DEPDIR)/version-etc$U.Po \
|
||||
$(DEPDIR)/xgetcwd$U.Po $(DEPDIR)/xgethostname$U.Po \
|
||||
$(DEPDIR)/xmalloc$U.Po $(DEPDIR)/xstrdup$U.Po $(DEPDIR)/xstrtod$U.Po \
|
||||
$(DEPDIR)/xstrtol$U.Po $(DEPDIR)/xstrtoul$U.Po \
|
||||
$(DEPDIR)/xstrtoumax$U.Po $(DEPDIR)/yesno$U.Po
|
||||
DIST_COMMON = README $(noinst_HEADERS) ChangeLog Makefile.am \
|
||||
Makefile.in TODO alloca.c atexit.c chown.c dup2.c error.c error.h \
|
||||
euidaccess.c fileblocks.c fnmatch.c fsusage.c ftruncate.c getdate.c \
|
||||
getgroups.c gethostname.c getline.c getloadavg.c getusershell.c \
|
||||
group-member.c lchown.c malloc.c memchr.c memcmp.c memcpy.c memmove.c \
|
||||
memset.c mkdir.c mktime.c mountlist.c nanosleep.c obstack.c obstack.h \
|
||||
putenv.c realloc.c regex.c rmdir.c rpmatch.c stime.c stpcpy.c \
|
||||
strcasecmp.c strcspn.c strdup.c strftime.c strncasecmp.c strndup.c \
|
||||
strnlen.c strpbrk.c strstr.c strtod.c strtol.c strtoul.c strtoull.c \
|
||||
strtoumax.c strverscmp.c utime.c
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
GZIP_ENV = --best
|
||||
SOURCES = $(libfetish_a_SOURCES)
|
||||
OBJECTS = $(am_libfetish_a_OBJECTS)
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .y
|
||||
.SUFFIXES: .c .o .sed .sin .y
|
||||
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnits lib/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@@ -287,6 +301,8 @@ alloca_.c: alloca.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > alloca_.c
|
||||
argmatch_.c: argmatch.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/argmatch.c; then echo $(srcdir)/argmatch.c; else echo argmatch.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > argmatch_.c
|
||||
atexit_.c: atexit.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/atexit.c; then echo $(srcdir)/atexit.c; else echo atexit.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > atexit_.c
|
||||
backupfile_.c: backupfile.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/backupfile.c; then echo $(srcdir)/backupfile.c; else echo backupfile.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > backupfile_.c
|
||||
basename_.c: basename.c $(ANSI2KNR)
|
||||
@@ -355,6 +371,8 @@ lchown_.c: lchown.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lchown.c; then echo $(srcdir)/lchown.c; else echo lchown.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > lchown_.c
|
||||
linebuffer_.c: linebuffer.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/linebuffer.c; then echo $(srcdir)/linebuffer.c; else echo linebuffer.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > linebuffer_.c
|
||||
localcharset_.c: localcharset.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/localcharset.c; then echo $(srcdir)/localcharset.c; else echo localcharset.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > localcharset_.c
|
||||
long-options_.c: long-options.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/long-options.c; then echo $(srcdir)/long-options.c; else echo long-options.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > long-options_.c
|
||||
lstat_.c: lstat.c $(ANSI2KNR)
|
||||
@@ -439,6 +457,8 @@ strncasecmp_.c: strncasecmp.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strncasecmp.c; then echo $(srcdir)/strncasecmp.c; else echo strncasecmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strncasecmp_.c
|
||||
strndup_.c: strndup.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strndup.c; then echo $(srcdir)/strndup.c; else echo strndup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strndup_.c
|
||||
strnlen_.c: strnlen.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strnlen.c; then echo $(srcdir)/strnlen.c; else echo strnlen.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strnlen_.c
|
||||
strpbrk_.c: strpbrk.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strpbrk.c; then echo $(srcdir)/strpbrk.c; else echo strpbrk.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strpbrk_.c
|
||||
strstr_.c: strstr.c $(ANSI2KNR)
|
||||
@@ -455,6 +475,8 @@ strtoumax_.c: strtoumax.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtoumax.c; then echo $(srcdir)/strtoumax.c; else echo strtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtoumax_.c
|
||||
strverscmp_.c: strverscmp.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strverscmp.c; then echo $(srcdir)/strverscmp.c; else echo strverscmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strverscmp_.c
|
||||
unicodeio_.c: unicodeio.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/unicodeio.c; then echo $(srcdir)/unicodeio.c; else echo unicodeio.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > unicodeio_.c
|
||||
userspec_.c: userspec.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/userspec.c; then echo $(srcdir)/userspec.c; else echo userspec.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > userspec_.c
|
||||
utime_.c: utime.c $(ANSI2KNR)
|
||||
@@ -479,24 +501,25 @@ xstrtoumax_.c: xstrtoumax.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtoumax.c; then echo $(srcdir)/xstrtoumax.c; else echo xstrtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtoumax_.c
|
||||
yesno_.c: yesno.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/yesno.c; then echo $(srcdir)/yesno.c; else echo yesno.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > yesno_.c
|
||||
addext_.o alloca_.o argmatch_.o backupfile_.o basename_.o canon-host_.o \
|
||||
chown_.o closeout_.o diacrit_.o dirname_.o dup2_.o error_.o \
|
||||
euidaccess_.o exclude_.o fileblocks_.o filemode_.o fnmatch_.o \
|
||||
addext_.o alloca_.o argmatch_.o atexit_.o backupfile_.o basename_.o \
|
||||
canon-host_.o chown_.o closeout_.o diacrit_.o dirname_.o dup2_.o \
|
||||
error_.o euidaccess_.o exclude_.o fileblocks_.o filemode_.o fnmatch_.o \
|
||||
fsusage_.o ftruncate_.o full-write_.o getdate_.o getgroups_.o \
|
||||
gethostname_.o getline_.o getloadavg_.o getopt_.o getopt1_.o \
|
||||
getugroups_.o getusershell_.o group-member_.o hard-locale_.o hash_.o \
|
||||
human_.o idcache_.o isdir_.o lchown_.o linebuffer_.o long-options_.o \
|
||||
lstat_.o makepath_.o malloc_.o md5_.o memcasecmp_.o memchr_.o memcmp_.o \
|
||||
memcoll_.o memcpy_.o memmove_.o memset_.o mkdir_.o mktime_.o \
|
||||
modechange_.o mountlist_.o nanosleep_.o obstack_.o path-concat_.o \
|
||||
posixtm_.o putenv_.o quotearg_.o readtokens_.o readutmp_.o realloc_.o \
|
||||
regex_.o rmdir_.o rpmatch_.o safe-read_.o same_.o save-cwd_.o \
|
||||
savedir_.o stat_.o stime_.o stpcpy_.o strcasecmp_.o strcspn_.o \
|
||||
strdup_.o strftime_.o stripslash_.o strncasecmp_.o strndup_.o \
|
||||
strpbrk_.o strstr_.o strtod_.o strtol_.o strtoul_.o strtoull_.o \
|
||||
strtoumax_.o strverscmp_.o userspec_.o utime_.o version-etc_.o \
|
||||
xgetcwd_.o xgethostname_.o xmalloc_.o xstrdup_.o xstrtod_.o xstrtol_.o \
|
||||
xstrtoul_.o xstrtoumax_.o yesno_.o : $(ANSI2KNR)
|
||||
human_.o idcache_.o isdir_.o lchown_.o linebuffer_.o localcharset_.o \
|
||||
long-options_.o lstat_.o makepath_.o malloc_.o md5_.o memcasecmp_.o \
|
||||
memchr_.o memcmp_.o memcoll_.o memcpy_.o memmove_.o memset_.o mkdir_.o \
|
||||
mktime_.o modechange_.o mountlist_.o nanosleep_.o obstack_.o \
|
||||
path-concat_.o posixtm_.o putenv_.o quotearg_.o readtokens_.o \
|
||||
readutmp_.o realloc_.o regex_.o rmdir_.o rpmatch_.o safe-read_.o \
|
||||
same_.o save-cwd_.o savedir_.o stat_.o stime_.o stpcpy_.o strcasecmp_.o \
|
||||
strcspn_.o strdup_.o strftime_.o stripslash_.o strncasecmp_.o \
|
||||
strndup_.o strnlen_.o strpbrk_.o strstr_.o strtod_.o strtol_.o \
|
||||
strtoul_.o strtoull_.o strtoumax_.o strverscmp_.o unicodeio_.o \
|
||||
userspec_.o utime_.o version-etc_.o xgetcwd_.o xgethostname_.o \
|
||||
xmalloc_.o xstrdup_.o xstrtod_.o xstrtol_.o xstrtoul_.o xstrtoumax_.o \
|
||||
yesno_.o : $(ANSI2KNR)
|
||||
.y.c:
|
||||
$(YACC) $(AM_YFLAGS) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
if test -f y.tab.h; then \
|
||||
@@ -513,7 +536,7 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -f$$here/ID $$unique $(LISP)
|
||||
mkid -fID $$unique $(LISP)
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
@@ -537,23 +560,10 @@ distclean-tags:
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pR $$d/$$file $(distdir); \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
@AMDEP@include $(DEPDIR)/addext$U.Po
|
||||
@AMDEP@include $(DEPDIR)/alloca.Po
|
||||
@AMDEP@include $(DEPDIR)/argmatch$U.Po
|
||||
@AMDEP@include $(DEPDIR)/atexit.Po
|
||||
@AMDEP@include $(DEPDIR)/backupfile$U.Po
|
||||
@AMDEP@include $(DEPDIR)/basename$U.Po
|
||||
@AMDEP@include $(DEPDIR)/canon-host$U.Po
|
||||
@@ -588,6 +598,7 @@ distdir: $(DISTFILES)
|
||||
@AMDEP@include $(DEPDIR)/isdir$U.Po
|
||||
@AMDEP@include $(DEPDIR)/lchown.Po
|
||||
@AMDEP@include $(DEPDIR)/linebuffer$U.Po
|
||||
@AMDEP@include $(DEPDIR)/localcharset$U.Po
|
||||
@AMDEP@include $(DEPDIR)/long-options$U.Po
|
||||
@AMDEP@include $(DEPDIR)/lstat.Po
|
||||
@AMDEP@include $(DEPDIR)/makepath$U.Po
|
||||
@@ -630,6 +641,7 @@ distdir: $(DISTFILES)
|
||||
@AMDEP@include $(DEPDIR)/stripslash$U.Po
|
||||
@AMDEP@include $(DEPDIR)/strncasecmp.Po
|
||||
@AMDEP@include $(DEPDIR)/strndup.Po
|
||||
@AMDEP@include $(DEPDIR)/strnlen.Po
|
||||
@AMDEP@include $(DEPDIR)/strpbrk.Po
|
||||
@AMDEP@include $(DEPDIR)/strstr.Po
|
||||
@AMDEP@include $(DEPDIR)/strtod.Po
|
||||
@@ -638,6 +650,7 @@ distdir: $(DISTFILES)
|
||||
@AMDEP@include $(DEPDIR)/strtoull.Po
|
||||
@AMDEP@include $(DEPDIR)/strtoumax.Po
|
||||
@AMDEP@include $(DEPDIR)/strverscmp.Po
|
||||
@AMDEP@include $(DEPDIR)/unicodeio$U.Po
|
||||
@AMDEP@include $(DEPDIR)/userspec$U.Po
|
||||
@AMDEP@include $(DEPDIR)/utime.Po
|
||||
@AMDEP@include $(DEPDIR)/version-etc$U.Po
|
||||
@@ -666,8 +679,23 @@ maintainer-clean-depend:
|
||||
@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(COMPILE) -c -o $@ $<
|
||||
$(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pR $$d/$$file $(distdir) \
|
||||
|| exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
@@ -676,7 +704,7 @@ check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-exec-am:
|
||||
install-exec-am: install-exec-local
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am:
|
||||
@@ -685,9 +713,9 @@ install-data: install-data-am
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am:
|
||||
uninstall-am: uninstall-local
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(LIBRARIES) $(HEADERS)
|
||||
all-am: Makefile $(LIBRARIES) $(HEADERS) all-local
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
|
||||
@@ -697,6 +725,7 @@ installdirs:
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
@@ -737,13 +766,14 @@ clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
|
||||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile mostlyclean-kr distclean-kr clean-kr \
|
||||
maintainer-clean-kr tags mostlyclean-tags distclean-tags clean-tags \
|
||||
maintainer-clean-tags distdir mostlyclean-depend distclean-depend \
|
||||
clean-depend maintainer-clean-depend info-am info dvi-am dvi check \
|
||||
check-am installcheck-am installcheck install-exec-am install-exec \
|
||||
install-data-am install-data install-am install uninstall-am uninstall \
|
||||
all-redirect all-am all install-strip installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
maintainer-clean-tags mostlyclean-depend distclean-depend clean-depend \
|
||||
maintainer-clean-depend distdir info-am info dvi-am dvi check check-am \
|
||||
installcheck-am installcheck install-exec-local install-exec-am \
|
||||
install-exec install-data-am install-data install-am install \
|
||||
uninstall-local uninstall-am uninstall all-local all-redirect all-am \
|
||||
all install-strip installdirs mostlyclean-generic distclean-generic \
|
||||
clean-generic maintainer-clean-generic clean mostlyclean distclean \
|
||||
maintainer-clean
|
||||
|
||||
lstat.c: xstat.in
|
||||
sed \
|
||||
@@ -763,6 +793,40 @@ stat.c: xstat.in
|
||||
$(srcdir)/xstat.in > $@-t
|
||||
mv $@-t $@
|
||||
|
||||
# The following is needed in order to install a simple file in $(libdir)
|
||||
# which is shared with other installed packages. We use a list of referencing
|
||||
# packages so that "make uninstall" will remove the file if and only if it
|
||||
# is not used by another installed package.
|
||||
|
||||
all-local: charset.alias ref-add.sed ref-del.sed
|
||||
install-exec-local: all-local
|
||||
$(mkinstalldirs) $(DESTDIR)$(libdir)
|
||||
test -f $(charset_alias) \
|
||||
&& orig=$(charset_alias) \
|
||||
|| orig=charset.alias; \
|
||||
sed -f ref-add.sed $$orig > $(charset_tmp)
|
||||
$(INSTALL_DATA) $(charset_tmp) $(charset_alias)
|
||||
rm -f $(charset_tmp)
|
||||
|
||||
uninstall-local: all-local
|
||||
if test -f $(charset_alias); then \
|
||||
sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
|
||||
if grep '^# Packages using this file: $$' $(charset_tmp) \
|
||||
> /dev/null; then \
|
||||
rm -f $(charset_alias); \
|
||||
else \
|
||||
$(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
|
||||
fi; \
|
||||
rm -f $(charset_tmp); \
|
||||
fi
|
||||
|
||||
charset.alias: config.charset
|
||||
$(SHELL) $(srcdir)/config.charset '@host@' > t-$@
|
||||
mv t-$@ $@
|
||||
.sin.sed:
|
||||
sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > $@-t
|
||||
mv $@-t $@
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
|
||||
6
lib/README
Normal file
6
lib/README
Normal file
@@ -0,0 +1,6 @@
|
||||
The files in this directory are shared between the fileutils, sh-utils,
|
||||
and textutils packages. Not all files are used by each package.
|
||||
The autoconf tests required for these files are in ../m4.
|
||||
|
||||
The library name, fetish, is a permutation of the first two
|
||||
letters of each of the package names: FIleutils, TExtutils, SH-utils.
|
||||
14
lib/atexit.c
Normal file
14
lib/atexit.c
Normal file
@@ -0,0 +1,14 @@
|
||||
/* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */
|
||||
/* This function is in the public domain. --Mike Stump. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
int
|
||||
atexit(f)
|
||||
void (*f)();
|
||||
{
|
||||
/* If the system doesn't provide a definition for atexit, use on_exit
|
||||
if the system provides that. */
|
||||
on_exit (f, 0);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Host name canonicalization
|
||||
|
||||
Copyright (C) 1995, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>
|
||||
|
||||
@@ -43,6 +43,9 @@
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#ifndef strdup
|
||||
char *strdup ();
|
||||
#endif
|
||||
void free ();
|
||||
|
||||
/* Returns the canonical hostname associated with HOST (allocated in a static
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* closeout.c - close standard output
|
||||
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -33,14 +33,36 @@
|
||||
# define EXIT_FAILURE 1
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <errno.h>
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include "closeout.h"
|
||||
#include "error.h"
|
||||
#include "quotearg.h"
|
||||
|
||||
static int default_exit_status = EXIT_FAILURE;
|
||||
static const char *file_name;
|
||||
|
||||
/* Set the value to be used for the exit status when close_stdout is called.
|
||||
This is useful when it is not convenient to call close_stdout_status,
|
||||
e.g., when close_stdout is called via atexit. */
|
||||
void
|
||||
close_stdout_set_status (int status)
|
||||
{
|
||||
default_exit_status = status;
|
||||
}
|
||||
|
||||
/* Set the file name to be reported in the event an error is detected
|
||||
by close_stdout_status. */
|
||||
void
|
||||
close_stdout_set_file_name (const char *file)
|
||||
{
|
||||
file_name = file;
|
||||
}
|
||||
|
||||
/* Close standard output, exiting with status STATUS on failure.
|
||||
If a program writes *anything* to stdout, that program should `fflush'
|
||||
@@ -67,15 +89,24 @@ extern int errno;
|
||||
void
|
||||
close_stdout_status (int status)
|
||||
{
|
||||
if (ferror (stdout))
|
||||
error (status, 0, _("write error"));
|
||||
int e = ferror (stdout) ? 0 : -1;
|
||||
|
||||
if (fclose (stdout) != 0)
|
||||
error (status, errno, _("write error"));
|
||||
e = errno;
|
||||
|
||||
if (0 <= e)
|
||||
{
|
||||
char const *write_error = _("write error");
|
||||
if (file_name)
|
||||
error (status, e, "%s: %s", quotearg_colon (file_name), write_error);
|
||||
else
|
||||
error (status, e, "%s", write_error);
|
||||
}
|
||||
}
|
||||
|
||||
/* Close standard output, exiting with status EXIT_FAILURE on failure. */
|
||||
void
|
||||
close_stdout (void)
|
||||
{
|
||||
close_stdout_status (EXIT_FAILURE);
|
||||
close_stdout_status (default_exit_status);
|
||||
}
|
||||
|
||||
@@ -6,5 +6,7 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
void close_stdout_set_status PARAMS ((int status));
|
||||
void close_stdout_set_file_name PARAMS ((const char *file));
|
||||
void close_stdout PARAMS ((void));
|
||||
void close_stdout_status PARAMS ((int status));
|
||||
|
||||
182
lib/config.charset
Executable file
182
lib/config.charset
Executable file
@@ -0,0 +1,182 @@
|
||||
#! /bin/sh
|
||||
# Output a system dependent table of character encoding aliases.
|
||||
#
|
||||
# Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Library General Public License as published
|
||||
# by the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
# USA.
|
||||
#
|
||||
# The table consists of lines of the form
|
||||
# ALIAS CANONICAL
|
||||
#
|
||||
# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)".
|
||||
# ALIAS is compared in a case sensitive way.
|
||||
#
|
||||
# CANONICAL is the GNU canonical name for this character encoding.
|
||||
# It must be an encoding supported by libiconv. Support by GNU libc is
|
||||
# also desirable. CANONICAL is case insensitive. Usually an upper case
|
||||
# MIME charset name is preferred.
|
||||
# The current list of GNU canonical charset names is as follows.
|
||||
#
|
||||
# name used by which systems a MIME name?
|
||||
# ASCII glibc solaris
|
||||
# ISO-8859-1 glibc aix hpux irix osf solaris yes
|
||||
# ISO-8859-2 glibc aix hpux irix solaris yes
|
||||
# ISO-8859-4 solaris yes
|
||||
# ISO-8859-5 glibc aix hpux irix solaris yes
|
||||
# ISO-8859-6 aix hpux solaris yes
|
||||
# ISO-8859-7 glibc aix hpux irix osf solaris yes
|
||||
# ISO-8859-8 glibc aix hpux solaris yes
|
||||
# ISO-8859-9 glibc aix hpux irix osf solaris yes
|
||||
# ISO-8859-13 glibc
|
||||
# ISO-8859-15 aix solaris
|
||||
# KOI8-R glibc solaris yes
|
||||
# KOI8-U glibc yes
|
||||
# CP850 aix osf
|
||||
# CP856 aix
|
||||
# CP922 aix
|
||||
# CP932 aix
|
||||
# CP943 aix
|
||||
# CP1046 aix
|
||||
# CP1124 aix
|
||||
# CP1129 aix
|
||||
# CP1252 aix
|
||||
# EUC-CN aix hpux solaris
|
||||
# EUC-JP aix hpux solaris yes
|
||||
# EUC-KR aix hpux solaris yes
|
||||
# EUC-TW aix hpux solaris
|
||||
# BIG5 aix hpux solaris yes
|
||||
# GBK aix
|
||||
# SJIS hpux solaris
|
||||
# TIS-620 aix hpux solaris
|
||||
# HP-ROMAN8 hpux
|
||||
# HP-ARABIC8 hpux
|
||||
# HP-GREEK8 hpux
|
||||
# HP-HEBREW8 hpux
|
||||
# HP-TURKISH8 hpux
|
||||
# HP-KANA8 hpux
|
||||
# UTF-8 glibc aix hpux solaris yes
|
||||
#
|
||||
# Note: Names which are not marked as being a MIME name should not be used in
|
||||
# Internet protocols for information interchange (mail, news, etc.).
|
||||
#
|
||||
# The first argument passed to this file is the canonical host specification,
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
|
||||
host="$1"
|
||||
os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
|
||||
echo "# This file contains a table of character encoding aliases,"
|
||||
echo "# suitable for operating system '${os}'."
|
||||
echo "# It was automatically generated from config.charset."
|
||||
# List of references, updated during installation:
|
||||
echo "# Packages using this file: "
|
||||
case "$os" in
|
||||
linux* | *-gnu*)
|
||||
# With glibc we don't need any canonicalization, because glibc
|
||||
# supports all GNU canonical names directly.
|
||||
echo "ANSI_X3.4-1968 ASCII" # this is a nop
|
||||
echo "ISO_646.IRV:1983 ASCII" # this is a nop
|
||||
echo "BALTIC ISO-8859-13" # in glibc-2.2 or newer, this is a nop
|
||||
;;
|
||||
aix*)
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-6 ISO-8859-6"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-8 ISO-8859-8"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "IBM-850 CP850"
|
||||
echo "IBM-856 CP856"
|
||||
echo "IBM-921 ISO-8859-13"
|
||||
echo "IBM-922 CP922"
|
||||
echo "IBM-932 CP932"
|
||||
echo "IBM-943 CP943"
|
||||
echo "IBM-1046 CP1046"
|
||||
echo "IBM-1124 CP1124"
|
||||
echo "IBM-1129 CP1129"
|
||||
echo "IBM-1252 CP1252"
|
||||
echo "IBM-eucCN EUC-CN"
|
||||
echo "IBM-eucJP EUC-JP"
|
||||
echo "IBM-eucKR EUC-KR"
|
||||
echo "IBM-eucTW EUC-TW"
|
||||
echo "big5 BIG5"
|
||||
echo "GBK GBK"
|
||||
echo "TIS-620 TIS-620"
|
||||
echo "UTF-8 UTF-8"
|
||||
;;
|
||||
hpux*)
|
||||
echo "iso88591 ISO-8859-1"
|
||||
echo "iso88592 ISO-8859-2"
|
||||
echo "iso88595 ISO-8859-5"
|
||||
echo "iso88596 ISO-8859-6"
|
||||
echo "iso88597 ISO-8859-7"
|
||||
echo "iso88598 ISO-8859-8"
|
||||
echo "iso88599 ISO-8859-9"
|
||||
echo "roman8 HP-ROMAN8"
|
||||
echo "arabic8 HP-ARABIC8"
|
||||
echo "greek8 HP-GREEK8"
|
||||
echo "hebrew8 HP-HEBREW8"
|
||||
echo "turkish8 HP-TURKISH8"
|
||||
echo "kana8 HP-KANA8"
|
||||
echo "tis620 TIS-620"
|
||||
echo "big5 BIG5"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "eucTW EUC-TW"
|
||||
echo "hp15CN EUC-CN"
|
||||
#echo "ccdc ?" # what is this?
|
||||
echo "SJIS SJIS"
|
||||
echo "utf8 UTF-8"
|
||||
;;
|
||||
irix*)
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
;;
|
||||
osf*)
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "cp850 CP850"
|
||||
;;
|
||||
solaris*)
|
||||
echo "646 ASCII"
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-4 ISO-8859-4"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-6 ISO-8859-6"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-8 ISO-8859-8"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "koi8-r KOI8-R"
|
||||
echo "BIG5 BIG5"
|
||||
echo "gb2312 EUC-CN"
|
||||
echo "cns11643 EUC-TW"
|
||||
echo "5601 EUC-KR"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "PCK SJIS"
|
||||
echo "TIS620.2533 TIS-620"
|
||||
#echo "sun_eu_greek ?" # what is this?
|
||||
echo "UTF-8 UTF-8"
|
||||
;;
|
||||
esac
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Declaration for error-reporting function
|
||||
Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
|
||||
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
|
||||
70
lib/fatal.c
Normal file
70
lib/fatal.c
Normal file
@@ -0,0 +1,70 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* FIXME: define EXIT_FAILURE */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
|
||||
# if __STDC__
|
||||
# include <stdarg.h>
|
||||
# define VA_START(args, lastarg) va_start(args, lastarg)
|
||||
# else
|
||||
# include <varargs.h>
|
||||
# define VA_START(args, lastarg) va_start(args)
|
||||
# endif
|
||||
#else
|
||||
# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
|
||||
# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
|
||||
#endif
|
||||
|
||||
#if STDC_HEADERS || _LIBC
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
#else
|
||||
void exit ();
|
||||
#endif
|
||||
|
||||
#ifdef _LIBC
|
||||
# define program_name program_invocation_name
|
||||
#else /* not _LIBC */
|
||||
/* The calling program should define program_name and set it to the
|
||||
name of the executing program. */
|
||||
extern char *program_name;
|
||||
#endif
|
||||
|
||||
#include "fatal.h"
|
||||
|
||||
/* Like error, but always exit with EXIT_FAILURE. */
|
||||
|
||||
void
|
||||
#if defined VA_START && __STDC__
|
||||
fatal (int errnum, const char *message, ...)
|
||||
#else
|
||||
fatal (errnum, message, va_alist)
|
||||
int errnum;
|
||||
char *message;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
#ifdef VA_START
|
||||
va_list args;
|
||||
#endif
|
||||
|
||||
if (error_print_progname)
|
||||
(*error_print_progname) ();
|
||||
else
|
||||
{
|
||||
fflush (stdout);
|
||||
fprintf (stderr, "%s: ", program_name);
|
||||
}
|
||||
|
||||
#ifdef VA_START
|
||||
VA_START (args, message);
|
||||
error (EXIT_FAILURE, errnum, message, args);
|
||||
va_end (args);
|
||||
#else
|
||||
error (EXIT_FAILURE, errnum, message, a1, a2, a3, a4, a5, a6, a7, a8);
|
||||
#endif
|
||||
}
|
||||
68
lib/fatal.h
Normal file
68
lib/fatal.h
Normal file
@@ -0,0 +1,68 @@
|
||||
#include "error.h"
|
||||
|
||||
/* FIXME: this is all from ansidecl. better to simply swipe
|
||||
that file from egcs/include and include it from here. */
|
||||
|
||||
/* Using MACRO(x,y) in cpp #if conditionals does not work with some
|
||||
older preprocessors. Thus we can't define something like this:
|
||||
|
||||
#define HAVE_GCC_VERSION(MAJOR, MINOR) \
|
||||
(__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))
|
||||
|
||||
and then test "#if HAVE_GCC_VERSION(2,7)".
|
||||
|
||||
So instead we use the macro below and test it against specific values. */
|
||||
|
||||
/* This macro simplifies testing whether we are using gcc, and if it
|
||||
is of a particular minimum version. (Both major & minor numbers are
|
||||
significant.) This macro will evaluate to 0 if we are not using
|
||||
gcc at all. */
|
||||
#ifndef GCC_VERSION
|
||||
# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
|
||||
#endif /* GCC_VERSION */
|
||||
|
||||
/* Define macros for some gcc attributes. This permits us to use the
|
||||
macros freely, and know that they will come into play for the
|
||||
version of gcc in which they are supported. */
|
||||
|
||||
#if (GCC_VERSION < 2007)
|
||||
# define __attribute__(x)
|
||||
#endif
|
||||
|
||||
/* Attribute __malloc__ on functions was valid as of gcc 2.96. */
|
||||
#ifndef ATTRIBUTE_MALLOC
|
||||
# if (GCC_VERSION >= 2096)
|
||||
# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
|
||||
# else
|
||||
# define ATTRIBUTE_MALLOC
|
||||
# endif /* GNUC >= 2.96 */
|
||||
#endif /* ATTRIBUTE_MALLOC */
|
||||
|
||||
/* Attributes on labels were valid as of gcc 2.93. */
|
||||
#ifndef ATTRIBUTE_UNUSED_LABEL
|
||||
# if (GCC_VERSION >= 2093)
|
||||
# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
|
||||
# else
|
||||
# define ATTRIBUTE_UNUSED_LABEL
|
||||
# endif /* GNUC >= 2.93 */
|
||||
#endif /* ATTRIBUTE_UNUSED_LABEL */
|
||||
|
||||
#ifndef ATTRIBUTE_UNUSED
|
||||
# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
|
||||
#endif /* ATTRIBUTE_UNUSED */
|
||||
|
||||
#ifndef ATTRIBUTE_NORETURN
|
||||
# define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
|
||||
#endif /* ATTRIBUTE_NORETURN */
|
||||
|
||||
#ifndef ATTRIBUTE_PRINTF
|
||||
# define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
|
||||
# define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
|
||||
# define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
|
||||
# define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
|
||||
# define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
|
||||
# define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
|
||||
#endif /* ATTRIBUTE_PRINTF */
|
||||
|
||||
extern void fatal (int errnum, const char *format, ...)
|
||||
ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_2;
|
||||
@@ -1,5 +1,5 @@
|
||||
/* filemode.c -- make a string describing file modes
|
||||
Copyright (C) 1985, 1990, 1993, 1998, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1985, 1990, 1993, 1998-2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -14,7 +14,7 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
@@ -80,37 +80,42 @@
|
||||
# undef S_ISSOCK
|
||||
#endif /* STAT_MACROS_BROKEN. */
|
||||
|
||||
#if !defined(S_ISBLK) && defined(S_IFBLK)
|
||||
#if !defined S_ISBLK && defined S_IFBLK
|
||||
# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
|
||||
#endif
|
||||
#if !defined(S_ISCHR) && defined(S_IFCHR)
|
||||
#if !defined S_ISCHR && defined S_IFCHR
|
||||
# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
|
||||
#endif
|
||||
#if !defined(S_ISDIR) && defined(S_IFDIR)
|
||||
#if !defined S_ISDIR && defined S_IFDIR
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
#if !defined(S_ISREG) && defined(S_IFREG)
|
||||
#if !defined S_ISREG && defined S_IFREG
|
||||
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
|
||||
#endif
|
||||
#if !defined(S_ISFIFO) && defined(S_IFIFO)
|
||||
#if !defined S_ISFIFO && defined S_IFIFO
|
||||
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
|
||||
#endif
|
||||
#if !defined(S_ISLNK) && defined(S_IFLNK)
|
||||
#if !defined S_ISLNK && defined S_IFLNK
|
||||
# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
||||
#endif
|
||||
#if !defined(S_ISSOCK) && defined(S_IFSOCK)
|
||||
#if !defined S_ISSOCK && defined S_IFSOCK
|
||||
# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
|
||||
#endif
|
||||
#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
|
||||
#if !defined S_ISMPB && defined S_IFMPB /* V7 */
|
||||
# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
|
||||
# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
|
||||
#endif
|
||||
#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
|
||||
#if !defined S_ISNWK && defined S_IFNWK /* HP/UX */
|
||||
# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
|
||||
#endif
|
||||
#if !defined(S_ISDOOR) && defined(S_IFDOOR) /* Solaris 2.5 and up */
|
||||
#if !defined S_ISDOOR && defined S_IFDOOR /* Solaris 2.5 and up */
|
||||
# define S_ISDOOR(m) (((m) & S_IFMT) == S_IFDOOR)
|
||||
#endif
|
||||
#if !defined S_ISCTG && defined S_IFCTG /* MassComp */
|
||||
# define S_ISCTG(m) (((m) & S_IFMT) == S_IFCTG)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Set the 's' and 't' flags in file attributes string CHARS,
|
||||
according to the file mode BITS. */
|
||||
@@ -156,11 +161,13 @@ setst (mode_t bits, char *chars)
|
||||
'D' for doors
|
||||
'b' for block special files
|
||||
'c' for character special files
|
||||
'n' for network special files
|
||||
'm' for multiplexor files
|
||||
'M' for an off-line (regular) file
|
||||
'l' for symbolic links
|
||||
's' for sockets
|
||||
'p' for fifos
|
||||
'C' for contigous data files
|
||||
'-' for regular files
|
||||
'?' for any other file type. */
|
||||
|
||||
@@ -201,6 +208,10 @@ ftypelet (mode_t bits)
|
||||
if (S_ISDOOR (bits))
|
||||
return 'D';
|
||||
#endif
|
||||
#ifdef S_ISCTG
|
||||
if (S_ISCTG (bits))
|
||||
return 'C';
|
||||
#endif
|
||||
|
||||
/* The following two tests are for Cray DMF (Data Migration
|
||||
Facility), which is a HSM file system. A migrated file has a
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* full-write.c -- an interface to write that retries after interrupts
|
||||
Copyright (C) 1993, 1994, 1997, 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 1994, 1997, 1998, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -45,10 +45,11 @@ full_write (int desc, const char *ptr, size_t len)
|
||||
while (len > 0)
|
||||
{
|
||||
int written = write (desc, ptr, len);
|
||||
/* FIXME: write on my slackware Linux 1.2.13 returns zero when
|
||||
/* write on an old Slackware Linux 1.2.13 returns zero when
|
||||
I try to write more data than there is room on a floppy disk.
|
||||
This puts dd into an infinite loop. Reproduce with
|
||||
dd if=/dev/zero of=/dev/fd0. */
|
||||
dd if=/dev/zero of=/dev/fd0. If you have this problem,
|
||||
consider upgrading to a newer kernel. */
|
||||
if (written < 0)
|
||||
{
|
||||
#ifdef EINTR
|
||||
|
||||
33
lib/getopt.c
33
lib/getopt.c
@@ -2,7 +2,7 @@
|
||||
NOTE: The canonical source of this file is maintained with the GNU
|
||||
C Library. Bugs can be reported to bug-glibc@gnu.org.
|
||||
|
||||
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
|
||||
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
@@ -515,6 +515,13 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
int *longind;
|
||||
int long_only;
|
||||
{
|
||||
int print_errors = opterr;
|
||||
if (optstring[0] == ':')
|
||||
print_errors = 0;
|
||||
|
||||
if (argc < 1)
|
||||
return -1;
|
||||
|
||||
optarg = NULL;
|
||||
|
||||
if (optind == 0 || !__getopt_initialized)
|
||||
@@ -671,7 +678,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
|
||||
if (ambig && !exact)
|
||||
{
|
||||
if (opterr)
|
||||
if (print_errors)
|
||||
fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
|
||||
argv[0], argv[optind]);
|
||||
nextchar += strlen (nextchar);
|
||||
@@ -692,7 +699,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
optarg = nameend + 1;
|
||||
else
|
||||
{
|
||||
if (opterr)
|
||||
if (print_errors)
|
||||
{
|
||||
if (argv[optind - 1][1] == '-')
|
||||
/* --option */
|
||||
@@ -718,7 +725,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
optarg = argv[optind++];
|
||||
else
|
||||
{
|
||||
if (opterr)
|
||||
if (print_errors)
|
||||
fprintf (stderr,
|
||||
_("%s: option `%s' requires an argument\n"),
|
||||
argv[0], argv[optind - 1]);
|
||||
@@ -745,7 +752,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
if (!long_only || argv[optind][1] == '-'
|
||||
|| my_index (optstring, *nextchar) == NULL)
|
||||
{
|
||||
if (opterr)
|
||||
if (print_errors)
|
||||
{
|
||||
if (argv[optind][1] == '-')
|
||||
/* --option */
|
||||
@@ -775,7 +782,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
|
||||
if (temp == NULL || c == ':')
|
||||
{
|
||||
if (opterr)
|
||||
if (print_errors)
|
||||
{
|
||||
if (posixly_correct)
|
||||
/* 1003.2 specifies the format of this message. */
|
||||
@@ -809,7 +816,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
}
|
||||
else if (optind == argc)
|
||||
{
|
||||
if (opterr)
|
||||
if (print_errors)
|
||||
{
|
||||
/* 1003.2 specifies the format of this message. */
|
||||
fprintf (stderr, _("%s: option requires an argument -- %c\n"),
|
||||
@@ -858,7 +865,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
}
|
||||
if (ambig && !exact)
|
||||
{
|
||||
if (opterr)
|
||||
if (print_errors)
|
||||
fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
|
||||
argv[0], argv[optind]);
|
||||
nextchar += strlen (nextchar);
|
||||
@@ -876,7 +883,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
optarg = nameend + 1;
|
||||
else
|
||||
{
|
||||
if (opterr)
|
||||
if (print_errors)
|
||||
fprintf (stderr, _("\
|
||||
%s: option `-W %s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
@@ -891,7 +898,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
optarg = argv[optind++];
|
||||
else
|
||||
{
|
||||
if (opterr)
|
||||
if (print_errors)
|
||||
fprintf (stderr,
|
||||
_("%s: option `%s' requires an argument\n"),
|
||||
argv[0], argv[optind - 1]);
|
||||
@@ -938,12 +945,12 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
}
|
||||
else if (optind == argc)
|
||||
{
|
||||
if (opterr)
|
||||
if (print_errors)
|
||||
{
|
||||
/* 1003.2 specifies the format of this message. */
|
||||
fprintf (stderr,
|
||||
_("%s: option requires an argument -- %c\n"),
|
||||
argv[0], c);
|
||||
_("%s: option requires an argument -- %c\n"),
|
||||
argv[0], c);
|
||||
}
|
||||
optopt = c;
|
||||
if (optstring[0] == ':')
|
||||
|
||||
@@ -20,6 +20,14 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* This is for BeOS. */
|
||||
#if !defined getpagesize && HAVE_OS_H
|
||||
# include <OS.h>
|
||||
# if defined B_PAGE_SIZE
|
||||
# define getpagesize() B_PAGE_SIZE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef getpagesize
|
||||
# include <sys/param.h>
|
||||
# ifdef EXEC_PAGESIZE
|
||||
|
||||
@@ -723,7 +723,7 @@ hash_find_entry (Hash_table *table, const void *entry,
|
||||
if (bucket->data == NULL)
|
||||
return NULL;
|
||||
|
||||
/* Check if then entry is found as the bucket head. */
|
||||
/* See if the entry is the first in the bucket. */
|
||||
if ((*table->comparator) (entry, bucket->data))
|
||||
{
|
||||
void *data = bucket->data;
|
||||
@@ -854,6 +854,7 @@ hash_rehash (Hash_table *table, unsigned candidate)
|
||||
table->bucket_limit = new_table->bucket_limit;
|
||||
table->n_buckets = new_table->n_buckets;
|
||||
table->n_buckets_used = new_table->n_buckets_used;
|
||||
table->free_entry_list = new_table->free_entry_list;
|
||||
/* table->n_entries already holds its value. */
|
||||
#if USE_OBSTACK
|
||||
table->entry_stack = new_table->entry_stack;
|
||||
@@ -943,7 +944,8 @@ hash_delete (Hash_table *table, const void *entry)
|
||||
void *data;
|
||||
struct hash_entry *bucket;
|
||||
|
||||
if (data = hash_find_entry (table, entry, &bucket, true), !data)
|
||||
data = hash_find_entry (table, entry, &bucket, true);
|
||||
if (!data)
|
||||
return NULL;
|
||||
|
||||
table->n_entries--;
|
||||
|
||||
228
lib/localcharset.c
Normal file
228
lib/localcharset.c
Normal file
@@ -0,0 +1,228 @@
|
||||
/* Determine a canonical name for the current locale's character encoding.
|
||||
|
||||
Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published
|
||||
by the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
/* Written by Bruno Haible <haible@clisp.cons.org>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_STDDEF_H
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#if HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
#endif
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LANGINFO_CODESET
|
||||
# include <langinfo.h>
|
||||
#else
|
||||
# if HAVE_SETLOCALE
|
||||
# include <locale.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef DIRECTORY_SEPARATOR
|
||||
# define DIRECTORY_SEPARATOR '/'
|
||||
#endif
|
||||
|
||||
#ifndef ISSLASH
|
||||
# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
|
||||
#endif
|
||||
|
||||
/* The following static variable is declared 'volatile' to avoid a
|
||||
possible multithread problem in the function get_charset_aliases. If we
|
||||
are running in a threaded environment, and if two threads initialize
|
||||
'charset_aliases' simultaneously, both will produce the same value,
|
||||
and everything will be ok if the two assignments to 'charset_aliases'
|
||||
are atomic. But I don't know what will happen if the two assignments mix. */
|
||||
/* Pointer to the contents of the charset.alias file, if it has already been
|
||||
read, else NULL. Its format is:
|
||||
ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */
|
||||
static char * volatile charset_aliases;
|
||||
|
||||
/* Return a pointer to the contents of the charset.alias file. */
|
||||
static const char *
|
||||
get_charset_aliases ()
|
||||
{
|
||||
char *cp;
|
||||
|
||||
cp = charset_aliases;
|
||||
if (cp == NULL)
|
||||
{
|
||||
FILE *fp;
|
||||
const char *dir = LIBDIR;
|
||||
const char *base = "charset.alias";
|
||||
char *file_name;
|
||||
|
||||
/* Concatenate dir and base into freshly allocated file_name. */
|
||||
{
|
||||
size_t dir_len = strlen (dir);
|
||||
size_t base_len = strlen (base);
|
||||
int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
|
||||
file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
|
||||
if (file_name != NULL)
|
||||
{
|
||||
memcpy (file_name, dir, dir_len);
|
||||
if (add_slash)
|
||||
file_name[dir_len] = DIRECTORY_SEPARATOR;
|
||||
memcpy (file_name + dir_len + add_slash, base, base_len + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL)
|
||||
/* Out of memory or file not found, treat it as empty. */
|
||||
cp = "";
|
||||
else
|
||||
{
|
||||
/* Parse the file's contents. */
|
||||
int c;
|
||||
char buf1[50+1];
|
||||
char buf2[50+1];
|
||||
char *res_ptr = NULL;
|
||||
size_t res_size = 0;
|
||||
size_t l1, l2;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
c = getc (fp);
|
||||
if (c == EOF)
|
||||
break;
|
||||
if (c == '\n' || c == ' ' || c == '\t')
|
||||
continue;
|
||||
if (c == '#')
|
||||
{
|
||||
/* Skip comment, to end of line. */
|
||||
do
|
||||
c = getc (fp);
|
||||
while (!(c == EOF || c == '\n'));
|
||||
if (c == EOF)
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
ungetc (c, fp);
|
||||
if (fscanf(fp, "%50s %50s", buf1, buf2) < 2)
|
||||
break;
|
||||
l1 = strlen (buf1);
|
||||
l2 = strlen (buf2);
|
||||
if (res_size == 0)
|
||||
{
|
||||
res_size = l1 + 1 + l2 + 1;
|
||||
res_ptr = malloc (res_size + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
res_size += l1 + 1 + l2 + 1;
|
||||
res_ptr = realloc (res_ptr, res_size + 1);
|
||||
}
|
||||
if (res_ptr == NULL)
|
||||
{
|
||||
/* Out of memory. */
|
||||
res_size = 0;
|
||||
break;
|
||||
}
|
||||
strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
|
||||
strcpy (res_ptr + res_size - (l2 + 1), buf2);
|
||||
}
|
||||
fclose (fp);
|
||||
if (res_size == 0)
|
||||
cp = "";
|
||||
else
|
||||
{
|
||||
*(res_ptr + res_size) = '\0';
|
||||
cp = res_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
charset_aliases = cp;
|
||||
if (file_name != NULL)
|
||||
free (file_name);
|
||||
}
|
||||
|
||||
return cp;
|
||||
}
|
||||
|
||||
/* Determine the current locale's character encoding, and canonicalize it
|
||||
into one of the canonical names listed in config.charset.
|
||||
The result must not be freed; it is statically allocated.
|
||||
If the canonical name cannot be determined, the result is a non-canonical
|
||||
name or NULL. */
|
||||
|
||||
#ifdef STATIC
|
||||
STATIC
|
||||
#endif
|
||||
const char *
|
||||
locale_charset ()
|
||||
{
|
||||
const char *codeset;
|
||||
const char *aliases;
|
||||
|
||||
#if HAVE_LANGINFO_CODESET
|
||||
|
||||
/* Most systems support nl_langinfo (CODESET) nowadays. */
|
||||
codeset = nl_langinfo (CODESET);
|
||||
|
||||
#else
|
||||
|
||||
/* On old systems which lack it, use setlocale and getenv. */
|
||||
const char *locale = NULL;
|
||||
|
||||
# if HAVE_SETLOCALE
|
||||
locale = setlocale (LC_CTYPE, NULL);
|
||||
# endif
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
{
|
||||
locale = getenv ("LC_ALL");
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
{
|
||||
locale = getenv ("LC_CTYPE");
|
||||
if (locale == NULL || locale[0] == '\0')
|
||||
locale = getenv ("LANG");
|
||||
}
|
||||
}
|
||||
|
||||
/* On some old systems, one used to set locale = "iso8859_1". On others,
|
||||
you set it to "language_COUNTRY.charset". In any case, we resolve it
|
||||
through the charset.alias file. */
|
||||
codeset = locale;
|
||||
|
||||
#endif
|
||||
|
||||
if (codeset != NULL && codeset[0] != '\0')
|
||||
{
|
||||
/* Resolve alias. */
|
||||
for (aliases = get_charset_aliases ();
|
||||
*aliases != '\0';
|
||||
aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
|
||||
if (!strcmp (codeset, aliases))
|
||||
{
|
||||
codeset = aliases + strlen (aliases) + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return codeset;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Utility to accept --help and --version options as unobtrusively as possible.
|
||||
Copyright (C) 1993, 1994, 1998, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 1994, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <getopt.h>
|
||||
#include "closeout.h"
|
||||
#include "long-options.h"
|
||||
#include "version-etc.h"
|
||||
|
||||
@@ -71,8 +70,6 @@ parse_long_options (int argc,
|
||||
|
||||
case 'v':
|
||||
version_etc (stdout, command_name, package, version, authors);
|
||||
close_stdout (); /* FIXME: output failure exit status
|
||||
should be settable via an arg. */
|
||||
exit (0);
|
||||
|
||||
default:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* makepath.c -- Ensure that a directory path exists.
|
||||
Copyright (C) 1990, 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -50,6 +50,10 @@ char *alloca ();
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
|
||||
#ifndef S_IRWXUGO
|
||||
# define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
|
||||
#endif
|
||||
|
||||
#if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
@@ -380,13 +384,18 @@ make_path (const char *argpath,
|
||||
error (0, errno, _("cannot chown %s"), dirpath);
|
||||
retval = 1;
|
||||
}
|
||||
/* chown may have turned off some permission bits we wanted. */
|
||||
if ((mode & (S_ISUID | S_ISGID | S_ISVTX))
|
||||
&& chmod (basename_dir, mode))
|
||||
{
|
||||
error (0, errno, _("cannot chmod %s"), dirpath);
|
||||
retval = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* The above chown may have turned off some permission bits in MODE.
|
||||
Another reason we may have to use chmod here is that mkdir(2) is
|
||||
required to honor only the file permission bits. In particular,
|
||||
it need not honor the `special' bits, so if MODE includes any
|
||||
special bits, set them here. */
|
||||
if ((mode & ~S_IRWXUGO)
|
||||
&& chmod (basename_dir, mode))
|
||||
{
|
||||
error (0, errno, _("cannot chmod %s"), dirpath);
|
||||
retval = 1;
|
||||
}
|
||||
|
||||
CLEANUP_CWD;
|
||||
|
||||
112
lib/mountlist.c
112
lib/mountlist.c
@@ -1,5 +1,5 @@
|
||||
/* mountlist.c -- return a list of mounted filesystems
|
||||
Copyright (C) 1991, 1992, 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1991, 1992, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -85,6 +85,11 @@ extern int errno;
|
||||
# include <sys/fs_types.h>
|
||||
#endif
|
||||
|
||||
#ifdef MOUNTED_NEXT_DEV /* BeOS. */
|
||||
# include <fs_info.h>
|
||||
# include <dirent.h>
|
||||
#endif
|
||||
|
||||
#ifdef MOUNTED_FREAD /* SVR2. */
|
||||
# include <mnttab.h>
|
||||
#endif
|
||||
@@ -413,6 +418,111 @@ read_filesystem_list (int need_fs_type)
|
||||
}
|
||||
#endif /* MOUNTED_GETMNT. */
|
||||
|
||||
#if defined (MOUNTED_NEXT_DEV) /* BeOS */
|
||||
{
|
||||
/* The next_dev() and fs_stat_dev() system calls give the list of
|
||||
all filesystems, including the information returned by statvfs()
|
||||
(fs type, total blocks, free blocks etc.), but without the mount
|
||||
point. But on BeOS all filesystems except / are mounted in the
|
||||
rootfs, directly under /.
|
||||
The directory name of the mount point is often, but not always,
|
||||
identical to the volume name of the device.
|
||||
We therefore get the list of subdirectories of /, and the list
|
||||
of all filesystems, and match the two lists. */
|
||||
|
||||
DIR *dirp;
|
||||
struct rootdir_entry
|
||||
{
|
||||
char *name;
|
||||
dev_t dev;
|
||||
ino_t ino;
|
||||
struct rootdir_entry *next;
|
||||
};
|
||||
struct rootdir_entry *rootdir_list;
|
||||
struct rootdir_entry **rootdir_tail;
|
||||
int32 pos;
|
||||
dev_t dev;
|
||||
fs_info fi;
|
||||
|
||||
/* All volumes are mounted in the rootfs, directly under /. */
|
||||
rootdir_list = NULL;
|
||||
rootdir_tail = &rootdir_list;
|
||||
dirp = opendir ("/");
|
||||
if (dirp)
|
||||
{
|
||||
struct dirent *d;
|
||||
|
||||
while ((d = readdir (dirp)) != NULL)
|
||||
{
|
||||
char *name;
|
||||
struct stat statbuf;
|
||||
|
||||
if (strcmp (d->d_name, "..") == 0)
|
||||
continue;
|
||||
|
||||
if (strcmp (d->d_name, ".") == 0)
|
||||
name = xstrdup ("/");
|
||||
else
|
||||
{
|
||||
name = xmalloc (1 + strlen (d->d_name) + 1);
|
||||
name[0] = '/';
|
||||
strcpy (name + 1, d->d_name);
|
||||
}
|
||||
|
||||
if (stat (name, &statbuf) >= 0 && S_ISDIR (statbuf.st_mode))
|
||||
{
|
||||
struct rootdir_entry *re;
|
||||
|
||||
re = (struct rootdir_entry *) xmalloc (sizeof (struct rootdir_entry));
|
||||
re->name = name;
|
||||
re->dev = statbuf.st_dev;
|
||||
re->ino = statbuf.st_ino;
|
||||
|
||||
/* Add to the linked list. */
|
||||
*rootdir_tail = re;
|
||||
rootdir_tail = &re->next;
|
||||
}
|
||||
else
|
||||
free (name);
|
||||
}
|
||||
closedir (dirp);
|
||||
}
|
||||
*rootdir_tail = NULL;
|
||||
|
||||
for (pos = 0; (dev = next_dev (&pos)) >= 0; )
|
||||
if (fs_stat_dev (dev, &fi) >= 0)
|
||||
{
|
||||
/* Note: fi.dev == dev. */
|
||||
struct rootdir_entry *re;
|
||||
|
||||
for (re = rootdir_list; re; re = re->next)
|
||||
if (re->dev == fi.dev && re->ino == fi.root)
|
||||
break;
|
||||
|
||||
me = (struct mount_entry *) xmalloc (sizeof (struct mount_entry));
|
||||
me->me_devname = xstrdup (fi.device_name[0] != '\0' ? fi.device_name : fi.fsh_name);
|
||||
me->me_mountdir = xstrdup (re != NULL ? re->name : fi.fsh_name);
|
||||
me->me_type = xstrdup (fi.fsh_name);
|
||||
me->me_dev = fi.dev;
|
||||
me->me_dummy = 0;
|
||||
me->me_remote = (fi.flags & B_FS_IS_SHARED) != 0;
|
||||
|
||||
/* Add to the linked list. */
|
||||
*mtail = me;
|
||||
mtail = &me->me_next;
|
||||
}
|
||||
*mtail = NULL;
|
||||
|
||||
while (rootdir_list != NULL)
|
||||
{
|
||||
struct rootdir_entry *re = rootdir_list;
|
||||
rootdir_list = re->next;
|
||||
free (re->name);
|
||||
free (re);
|
||||
}
|
||||
}
|
||||
#endif /* MOUNTED_NEXT_DEV */
|
||||
|
||||
#if defined (MOUNTED_GETFSSTAT) /* __alpha running OSF_1 */
|
||||
{
|
||||
int numsys, counter, bufsize;
|
||||
|
||||
@@ -64,7 +64,7 @@ my_usleep (const struct timespec *ts_delay)
|
||||
|
||||
int
|
||||
rpl_nanosleep (const struct timespec *requested_delay,
|
||||
struct timespec *remaining_delay)
|
||||
struct timespec *remaining_delay)
|
||||
{
|
||||
#ifdef SA_NOCLDSTOP
|
||||
struct sigaction oldact, newact;
|
||||
|
||||
146
lib/obstack.c
146
lib/obstack.c
@@ -1,5 +1,5 @@
|
||||
/* obstack.c - subroutines used implicitly by object stack macros
|
||||
Copyright (C) 1988,89,90,91,92,93,94,96 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-1994,96,97,98,99 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
@@ -19,6 +19,10 @@
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "obstack.h"
|
||||
|
||||
/* NOTE BEFORE MODIFYING THIS FILE: This version number must be
|
||||
@@ -37,60 +41,62 @@
|
||||
|
||||
#include <stdio.h> /* Random thing to get __GNU_LIBRARY__. */
|
||||
#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
|
||||
#include <gnu-versions.h>
|
||||
#if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
|
||||
#define ELIDE_CODE
|
||||
#endif
|
||||
# include <gnu-versions.h>
|
||||
# if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
|
||||
# define ELIDE_CODE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef ELIDE_CODE
|
||||
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#define POINTER void *
|
||||
#else
|
||||
#define POINTER char *
|
||||
#endif
|
||||
# if defined (__STDC__) && __STDC__
|
||||
# define POINTER void *
|
||||
# else
|
||||
# define POINTER char *
|
||||
# endif
|
||||
|
||||
/* Determine default alignment. */
|
||||
struct fooalign {char x; double d;};
|
||||
#define DEFAULT_ALIGNMENT \
|
||||
# define DEFAULT_ALIGNMENT \
|
||||
((PTR_INT_TYPE) ((char *) &((struct fooalign *) 0)->d - (char *) 0))
|
||||
/* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT.
|
||||
But in fact it might be less smart and round addresses to as much as
|
||||
DEFAULT_ROUNDING. So we prepare for it to do that. */
|
||||
union fooround {long x; double d;};
|
||||
#define DEFAULT_ROUNDING (sizeof (union fooround))
|
||||
# define DEFAULT_ROUNDING (sizeof (union fooround))
|
||||
|
||||
/* When we copy a long block of data, this is the unit to do it with.
|
||||
On some machines, copying successive ints does not work;
|
||||
in such a case, redefine COPYING_UNIT to `long' (if that works)
|
||||
or `char' as a last resort. */
|
||||
#ifndef COPYING_UNIT
|
||||
#define COPYING_UNIT int
|
||||
#endif
|
||||
# ifndef COPYING_UNIT
|
||||
# define COPYING_UNIT int
|
||||
# endif
|
||||
|
||||
|
||||
/* The functions allocating more room by calling `obstack_chunk_alloc'
|
||||
jump to the handler pointed to by `obstack_alloc_failed_handler'.
|
||||
This variable by default points to the internal function
|
||||
This can be set to a user defined function which should either
|
||||
abort gracefully or use longjump - but shouldn't return. This
|
||||
variable by default points to the internal function
|
||||
`print_and_abort'. */
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# if defined (__STDC__) && __STDC__
|
||||
static void print_and_abort (void);
|
||||
void (*obstack_alloc_failed_handler) (void) = print_and_abort;
|
||||
#else
|
||||
# else
|
||||
static void print_and_abort ();
|
||||
void (*obstack_alloc_failed_handler) () = print_and_abort;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
/* Exit value used when `print_and_abort' is used. */
|
||||
#if defined __GNU_LIBRARY__ || defined HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifndef EXIT_FAILURE
|
||||
#define EXIT_FAILURE 1
|
||||
#endif
|
||||
# if defined __GNU_LIBRARY__ || defined HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
# endif
|
||||
# ifndef EXIT_FAILURE
|
||||
# define EXIT_FAILURE 1
|
||||
# endif
|
||||
int obstack_exit_failure = EXIT_FAILURE;
|
||||
|
||||
/* The non-GNU-C macros copy the obstack into this global variable
|
||||
@@ -104,33 +110,33 @@ struct obstack *_obstack;
|
||||
For free, do not use ?:, since some compilers, like the MIPS compilers,
|
||||
do not allow (expr) ? void : void. */
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#define CALL_CHUNKFUN(h, size) \
|
||||
# if defined (__STDC__) && __STDC__
|
||||
# define CALL_CHUNKFUN(h, size) \
|
||||
(((h) -> use_extra_arg) \
|
||||
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
|
||||
: (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size)))
|
||||
|
||||
#define CALL_FREEFUN(h, old_chunk) \
|
||||
# define CALL_FREEFUN(h, old_chunk) \
|
||||
do { \
|
||||
if ((h) -> use_extra_arg) \
|
||||
(*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
|
||||
else \
|
||||
(*(void (*) (void *)) (h)->freefun) ((old_chunk)); \
|
||||
} while (0)
|
||||
#else
|
||||
#define CALL_CHUNKFUN(h, size) \
|
||||
# else
|
||||
# define CALL_CHUNKFUN(h, size) \
|
||||
(((h) -> use_extra_arg) \
|
||||
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
|
||||
: (*(struct _obstack_chunk *(*) ()) (h)->chunkfun) ((size)))
|
||||
|
||||
#define CALL_FREEFUN(h, old_chunk) \
|
||||
# define CALL_FREEFUN(h, old_chunk) \
|
||||
do { \
|
||||
if ((h) -> use_extra_arg) \
|
||||
(*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
|
||||
else \
|
||||
(*(void (*) ()) (h)->freefun) ((old_chunk)); \
|
||||
} while (0)
|
||||
#endif
|
||||
# endif
|
||||
|
||||
|
||||
/* Initialize an obstack H for use. Specify chunk size SIZE (0 means default).
|
||||
@@ -138,27 +144,26 @@ struct obstack *_obstack;
|
||||
CHUNKFUN is the function to use to allocate chunks,
|
||||
and FREEFUN the function to free them.
|
||||
|
||||
Return nonzero if successful, zero if out of memory.
|
||||
To recover from an out of memory error,
|
||||
free up some memory, then call this again. */
|
||||
Return nonzero if successful, calls obstack_alloc_failed_handler if
|
||||
allocation fails. */
|
||||
|
||||
int
|
||||
_obstack_begin (h, size, alignment, chunkfun, freefun)
|
||||
struct obstack *h;
|
||||
int size;
|
||||
int alignment;
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# if defined (__STDC__) && __STDC__
|
||||
POINTER (*chunkfun) (long);
|
||||
void (*freefun) (void *);
|
||||
#else
|
||||
# else
|
||||
POINTER (*chunkfun) ();
|
||||
void (*freefun) ();
|
||||
#endif
|
||||
# endif
|
||||
{
|
||||
register struct _obstack_chunk *chunk; /* points to new chunk */
|
||||
|
||||
if (alignment == 0)
|
||||
alignment = DEFAULT_ALIGNMENT;
|
||||
alignment = (int) DEFAULT_ALIGNMENT;
|
||||
if (size == 0)
|
||||
/* Default size is what GNU malloc can fit in a 4096-byte block. */
|
||||
{
|
||||
@@ -176,13 +181,13 @@ _obstack_begin (h, size, alignment, chunkfun, freefun)
|
||||
size = 4096 - extra;
|
||||
}
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# if defined (__STDC__) && __STDC__
|
||||
h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun;
|
||||
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
|
||||
#else
|
||||
# else
|
||||
h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
|
||||
h->freefun = freefun;
|
||||
#endif
|
||||
# endif
|
||||
h->chunk_size = size;
|
||||
h->alignment_mask = alignment - 1;
|
||||
h->use_extra_arg = 0;
|
||||
@@ -205,19 +210,19 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
|
||||
struct obstack *h;
|
||||
int size;
|
||||
int alignment;
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# if defined (__STDC__) && __STDC__
|
||||
POINTER (*chunkfun) (POINTER, long);
|
||||
void (*freefun) (POINTER, POINTER);
|
||||
#else
|
||||
# else
|
||||
POINTER (*chunkfun) ();
|
||||
void (*freefun) ();
|
||||
#endif
|
||||
# endif
|
||||
POINTER arg;
|
||||
{
|
||||
register struct _obstack_chunk *chunk; /* points to new chunk */
|
||||
|
||||
if (alignment == 0)
|
||||
alignment = DEFAULT_ALIGNMENT;
|
||||
alignment = (int) DEFAULT_ALIGNMENT;
|
||||
if (size == 0)
|
||||
/* Default size is what GNU malloc can fit in a 4096-byte block. */
|
||||
{
|
||||
@@ -235,13 +240,13 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
|
||||
size = 4096 - extra;
|
||||
}
|
||||
|
||||
#if defined(__STDC__) && __STDC__
|
||||
# if defined(__STDC__) && __STDC__
|
||||
h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun;
|
||||
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
|
||||
#else
|
||||
# else
|
||||
h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
|
||||
h->freefun = freefun;
|
||||
#endif
|
||||
# endif
|
||||
h->chunk_size = size;
|
||||
h->alignment_mask = alignment - 1;
|
||||
h->extra_arg = arg;
|
||||
@@ -274,9 +279,9 @@ _obstack_newchunk (h, length)
|
||||
register struct _obstack_chunk *old_chunk = h->chunk;
|
||||
register struct _obstack_chunk *new_chunk;
|
||||
register long new_size;
|
||||
register int obj_size = h->next_free - h->object_base;
|
||||
register int i;
|
||||
int already;
|
||||
register long obj_size = h->next_free - h->object_base;
|
||||
register long i;
|
||||
long already;
|
||||
|
||||
/* Compute size for new chunk. */
|
||||
new_size = (obj_size + length) + (obj_size >> 3) + 100;
|
||||
@@ -330,11 +335,11 @@ _obstack_newchunk (h, length)
|
||||
This is here for debugging.
|
||||
If you use it in a program, you are probably losing. */
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# if defined (__STDC__) && __STDC__
|
||||
/* Suppress -Wmissing-prototypes warning. We don't want to declare this in
|
||||
obstack.h because it is just for debugging. */
|
||||
int _obstack_allocated_p (struct obstack *h, POINTER obj);
|
||||
#endif
|
||||
# endif
|
||||
|
||||
int
|
||||
_obstack_allocated_p (h, obj)
|
||||
@@ -359,7 +364,7 @@ _obstack_allocated_p (h, obj)
|
||||
/* Free objects in obstack H, including OBJ and everything allocate
|
||||
more recently than OBJ. If OBJ is zero, free everything in H. */
|
||||
|
||||
#undef obstack_free
|
||||
# undef obstack_free
|
||||
|
||||
/* This function has two names with identical definitions.
|
||||
This is the first one, called from non-ANSI code. */
|
||||
@@ -445,32 +450,37 @@ _obstack_memory_used (h)
|
||||
}
|
||||
|
||||
/* Define the error handler. */
|
||||
#ifndef _
|
||||
# ifdef HAVE_LIBINTL_H
|
||||
# include <libintl.h>
|
||||
# ifndef _
|
||||
# define _(Str) gettext (Str)
|
||||
# ifndef _
|
||||
# ifdef HAVE_LIBINTL_H
|
||||
# include <libintl.h>
|
||||
# ifndef _
|
||||
# define _(Str) gettext (Str)
|
||||
# endif
|
||||
# else
|
||||
# define _(Str) (Str)
|
||||
# endif
|
||||
# else
|
||||
# define _(Str) (Str)
|
||||
# endif
|
||||
#endif
|
||||
# if defined _LIBC && defined USE_IN_LIBIO
|
||||
# include <libio/iolibio.h>
|
||||
# define fputs(s, f) _IO_fputs (s, f)
|
||||
# endif
|
||||
|
||||
static void
|
||||
print_and_abort ()
|
||||
{
|
||||
fputs (_("memory exhausted\n"), stderr);
|
||||
fputs (_("memory exhausted"), stderr);
|
||||
fputc ('\n', stderr);
|
||||
exit (obstack_exit_failure);
|
||||
}
|
||||
|
||||
#if 0
|
||||
# if 0
|
||||
/* These are now turned off because the applications do not use it
|
||||
and it uses bcopy via obstack_grow, which causes trouble on sysV. */
|
||||
|
||||
/* Now define the functional versions of the obstack macros.
|
||||
Define them to simply use the corresponding macros to do the job. */
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# if defined (__STDC__) && __STDC__
|
||||
/* These function definitions do not work with non-ANSI preprocessors;
|
||||
they won't pass through the macro names in parentheses. */
|
||||
|
||||
@@ -581,8 +591,8 @@ POINTER (obstack_copy0) (obstack, pointer, length)
|
||||
return obstack_copy0 (obstack, pointer, length);
|
||||
}
|
||||
|
||||
#endif /* __STDC__ */
|
||||
# endif /* __STDC__ */
|
||||
|
||||
#endif /* 0 */
|
||||
# endif /* 0 */
|
||||
|
||||
#endif /* !ELIDE_CODE */
|
||||
|
||||
179
lib/obstack.h
179
lib/obstack.h
@@ -1,5 +1,5 @@
|
||||
/* obstack.h - object stack macros
|
||||
Copyright (C) 1988,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988,89,90,91,92,93,94,96,97,98,99 Free Software Foundation, Inc.
|
||||
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
|
||||
@@ -118,45 +118,39 @@ extern "C" {
|
||||
may ignore the byte-within-word field of the pointer. */
|
||||
|
||||
#ifndef __PTR_TO_INT
|
||||
#define __PTR_TO_INT(P) ((P) - (char *) 0)
|
||||
# define __PTR_TO_INT(P) ((P) - (char *) 0)
|
||||
#endif
|
||||
|
||||
#ifndef __INT_TO_PTR
|
||||
#define __INT_TO_PTR(P) ((P) + (char *) 0)
|
||||
# define __INT_TO_PTR(P) ((P) + (char *) 0)
|
||||
#endif
|
||||
|
||||
/* We need the type of the resulting object. In ANSI C it is ptrdiff_t
|
||||
but in traditional C it is usually long. If we are in ANSI C and
|
||||
don't already have ptrdiff_t get it. */
|
||||
/* We need the type of the resulting object. If __PTRDIFF_TYPE__ is
|
||||
defined, as with GNU C, use that; that way we don't pollute the
|
||||
namespace with <stddef.h>'s symbols. Otherwise, if <stddef.h> is
|
||||
available, include it and use ptrdiff_t. In traditional C, long is
|
||||
the best that we can do. */
|
||||
|
||||
#if defined (__STDC__) && __STDC__ && ! defined (offsetof)
|
||||
#if defined (__GNUC__) && defined (IN_GCC)
|
||||
/* On Next machine, the system's stddef.h screws up if included
|
||||
after we have defined just ptrdiff_t, so include all of stddef.h.
|
||||
Otherwise, define just ptrdiff_t, which is all we need. */
|
||||
#ifndef __NeXT__
|
||||
#define __need_ptrdiff_t
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#define PTR_INT_TYPE ptrdiff_t
|
||||
#ifdef __PTRDIFF_TYPE__
|
||||
# define PTR_INT_TYPE __PTRDIFF_TYPE__
|
||||
#else
|
||||
#define PTR_INT_TYPE long
|
||||
# ifdef HAVE_STDDEF_H
|
||||
# include <stddef.h>
|
||||
# define PTR_INT_TYPE ptrdiff_t
|
||||
# else
|
||||
# define PTR_INT_TYPE long
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined (_LIBC) || defined (HAVE_STRING_H)
|
||||
#include <string.h>
|
||||
#define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
|
||||
#if defined _LIBC || defined HAVE_STRING_H
|
||||
# include <string.h>
|
||||
# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
|
||||
#else
|
||||
#ifdef memcpy
|
||||
#define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
|
||||
#else
|
||||
#define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N))
|
||||
#endif
|
||||
# ifdef memcpy
|
||||
# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
|
||||
# else
|
||||
# define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
struct _obstack_chunk /* Lives at front of each chunk. */
|
||||
@@ -175,7 +169,7 @@ struct obstack /* control current object in current chunk */
|
||||
char *chunk_limit; /* address of char after current chunk */
|
||||
PTR_INT_TYPE temp; /* Temporary for some macros. */
|
||||
int alignment_mask; /* Mask of alignment for each object. */
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#if defined __STDC__ && __STDC__
|
||||
/* These prototypes vary based on `use_extra_arg', and we use
|
||||
casts to the prototypeless function type in all assignments,
|
||||
but having prototypes here quiets -Wstrict-prototypes. */
|
||||
@@ -199,7 +193,7 @@ struct obstack /* control current object in current chunk */
|
||||
|
||||
/* Declare the external functions we use; they are in obstack.c. */
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#if defined __STDC__ && __STDC__
|
||||
extern void _obstack_newchunk (struct obstack *, int);
|
||||
extern void _obstack_free (struct obstack *, void *);
|
||||
extern int _obstack_begin (struct obstack *, int, int,
|
||||
@@ -216,7 +210,7 @@ extern int _obstack_begin_1 ();
|
||||
extern int _obstack_memory_used ();
|
||||
#endif
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#if defined __STDC__ && __STDC__
|
||||
|
||||
/* Do the function-declarations after the structs
|
||||
but before defining the macros. */
|
||||
@@ -262,9 +256,10 @@ int obstack_memory_used (struct obstack *obstack);
|
||||
so we do not declare them. */
|
||||
|
||||
/* Error handler called when `obstack_chunk_alloc' failed to allocate
|
||||
more memory. This can be set to a user defined function. The
|
||||
default action is to print a message and abort. */
|
||||
#if defined (__STDC__) && __STDC__
|
||||
more memory. This can be set to a user defined function which
|
||||
should either abort gracefully or use longjump - but shouldn't
|
||||
return. The default action is to print a message and abort. */
|
||||
#if defined __STDC__ && __STDC__
|
||||
extern void (*obstack_alloc_failed_handler) (void);
|
||||
#else
|
||||
extern void (*obstack_alloc_failed_handler) ();
|
||||
@@ -293,53 +288,53 @@ extern int obstack_exit_failure;
|
||||
|
||||
/* To prevent prototype warnings provide complete argument list in
|
||||
standard C version. */
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#if defined __STDC__ && __STDC__
|
||||
|
||||
#define obstack_init(h) \
|
||||
# define obstack_init(h) \
|
||||
_obstack_begin ((h), 0, 0, \
|
||||
(void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
|
||||
|
||||
#define obstack_begin(h, size) \
|
||||
# define obstack_begin(h, size) \
|
||||
_obstack_begin ((h), (size), 0, \
|
||||
(void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
|
||||
|
||||
#define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
|
||||
# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
|
||||
_obstack_begin ((h), (size), (alignment), \
|
||||
(void *(*) (long)) (chunkfun), (void (*) (void *)) (freefun))
|
||||
|
||||
#define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
|
||||
# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
|
||||
_obstack_begin_1 ((h), (size), (alignment), \
|
||||
(void *(*) (void *, long)) (chunkfun), \
|
||||
(void (*) (void *, void *)) (freefun), (arg))
|
||||
|
||||
#define obstack_chunkfun(h, newchunkfun) \
|
||||
# define obstack_chunkfun(h, newchunkfun) \
|
||||
((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun))
|
||||
|
||||
#define obstack_freefun(h, newfreefun) \
|
||||
# define obstack_freefun(h, newfreefun) \
|
||||
((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun))
|
||||
|
||||
#else
|
||||
|
||||
#define obstack_init(h) \
|
||||
# define obstack_init(h) \
|
||||
_obstack_begin ((h), 0, 0, \
|
||||
(void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
|
||||
|
||||
#define obstack_begin(h, size) \
|
||||
# define obstack_begin(h, size) \
|
||||
_obstack_begin ((h), (size), 0, \
|
||||
(void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
|
||||
|
||||
#define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
|
||||
# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
|
||||
_obstack_begin ((h), (size), (alignment), \
|
||||
(void *(*) ()) (chunkfun), (void (*) ()) (freefun))
|
||||
|
||||
#define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
|
||||
# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
|
||||
_obstack_begin_1 ((h), (size), (alignment), \
|
||||
(void *(*) ()) (chunkfun), (void (*) ()) (freefun), (arg))
|
||||
|
||||
#define obstack_chunkfun(h, newchunkfun) \
|
||||
# define obstack_chunkfun(h, newchunkfun) \
|
||||
((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun))
|
||||
|
||||
#define obstack_freefun(h, newfreefun) \
|
||||
# define obstack_freefun(h, newfreefun) \
|
||||
((h) -> freefun = (void (*)()) (newfreefun))
|
||||
|
||||
#endif
|
||||
@@ -350,30 +345,30 @@ extern int obstack_exit_failure;
|
||||
|
||||
#define obstack_memory_used(h) _obstack_memory_used (h)
|
||||
|
||||
#if defined (__GNUC__) && defined (__STDC__) && __STDC__
|
||||
#if defined __GNUC__ && defined __STDC__ && __STDC__
|
||||
/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
|
||||
does not implement __extension__. But that compiler doesn't define
|
||||
__GNUC_MINOR__. */
|
||||
#if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
|
||||
#define __extension__
|
||||
#endif
|
||||
# if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
|
||||
# define __extension__
|
||||
# endif
|
||||
|
||||
/* For GNU C, if not -traditional,
|
||||
we can define these macros to compute all args only once
|
||||
without using a global variable.
|
||||
Also, we can avoid using the `temp' slot, to make faster code. */
|
||||
|
||||
#define obstack_object_size(OBSTACK) \
|
||||
# define obstack_object_size(OBSTACK) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
(unsigned) (__o->next_free - __o->object_base); })
|
||||
|
||||
#define obstack_room(OBSTACK) \
|
||||
# define obstack_room(OBSTACK) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
(unsigned) (__o->chunk_limit - __o->next_free); })
|
||||
|
||||
#define obstack_make_room(OBSTACK,length) \
|
||||
# define obstack_make_room(OBSTACK,length) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
int __len = (length); \
|
||||
@@ -381,12 +376,12 @@ __extension__ \
|
||||
_obstack_newchunk (__o, __len); \
|
||||
(void) 0; })
|
||||
|
||||
#define obstack_empty_p(OBSTACK) \
|
||||
# define obstack_empty_p(OBSTACK) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
(__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); })
|
||||
|
||||
#define obstack_grow(OBSTACK,where,length) \
|
||||
# define obstack_grow(OBSTACK,where,length) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
int __len = (length); \
|
||||
@@ -396,7 +391,7 @@ __extension__ \
|
||||
__o->next_free += __len; \
|
||||
(void) 0; })
|
||||
|
||||
#define obstack_grow0(OBSTACK,where,length) \
|
||||
# define obstack_grow0(OBSTACK,where,length) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
int __len = (length); \
|
||||
@@ -407,7 +402,7 @@ __extension__ \
|
||||
*(__o->next_free)++ = 0; \
|
||||
(void) 0; })
|
||||
|
||||
#define obstack_1grow(OBSTACK,datum) \
|
||||
# define obstack_1grow(OBSTACK,datum) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
if (__o->next_free + 1 > __o->chunk_limit) \
|
||||
@@ -419,7 +414,7 @@ __extension__ \
|
||||
and that the data added so far to the current object
|
||||
shares that much alignment. */
|
||||
|
||||
#define obstack_ptr_grow(OBSTACK,datum) \
|
||||
# define obstack_ptr_grow(OBSTACK,datum) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
|
||||
@@ -427,7 +422,7 @@ __extension__ \
|
||||
*((void **)__o->next_free)++ = ((void *)datum); \
|
||||
(void) 0; })
|
||||
|
||||
#define obstack_int_grow(OBSTACK,datum) \
|
||||
# define obstack_int_grow(OBSTACK,datum) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
if (__o->next_free + sizeof (int) > __o->chunk_limit) \
|
||||
@@ -435,10 +430,10 @@ __extension__ \
|
||||
*((int *)__o->next_free)++ = ((int)datum); \
|
||||
(void) 0; })
|
||||
|
||||
#define obstack_ptr_grow_fast(h,aptr) (*((void **) (h)->next_free)++ = (void *)aptr)
|
||||
#define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
|
||||
# define obstack_ptr_grow_fast(h,aptr) (*((void **) (h)->next_free)++ = (void *)aptr)
|
||||
# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
|
||||
|
||||
#define obstack_blank(OBSTACK,length) \
|
||||
# define obstack_blank(OBSTACK,length) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
int __len = (length); \
|
||||
@@ -447,19 +442,19 @@ __extension__ \
|
||||
__o->next_free += __len; \
|
||||
(void) 0; })
|
||||
|
||||
#define obstack_alloc(OBSTACK,length) \
|
||||
# define obstack_alloc(OBSTACK,length) \
|
||||
__extension__ \
|
||||
({ struct obstack *__h = (OBSTACK); \
|
||||
obstack_blank (__h, (length)); \
|
||||
obstack_finish (__h); })
|
||||
|
||||
#define obstack_copy(OBSTACK,where,length) \
|
||||
# define obstack_copy(OBSTACK,where,length) \
|
||||
__extension__ \
|
||||
({ struct obstack *__h = (OBSTACK); \
|
||||
obstack_grow (__h, (where), (length)); \
|
||||
obstack_finish (__h); })
|
||||
|
||||
#define obstack_copy0(OBSTACK,where,length) \
|
||||
# define obstack_copy0(OBSTACK,where,length) \
|
||||
__extension__ \
|
||||
({ struct obstack *__h = (OBSTACK); \
|
||||
obstack_grow0 (__h, (where), (length)); \
|
||||
@@ -467,7 +462,7 @@ __extension__ \
|
||||
|
||||
/* The local variable is named __o1 to avoid a name conflict
|
||||
when obstack_blank is called. */
|
||||
#define obstack_finish(OBSTACK) \
|
||||
# define obstack_finish(OBSTACK) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o1 = (OBSTACK); \
|
||||
void *value; \
|
||||
@@ -483,23 +478,23 @@ __extension__ \
|
||||
__o1->object_base = __o1->next_free; \
|
||||
value; })
|
||||
|
||||
#define obstack_free(OBSTACK, OBJ) \
|
||||
# define obstack_free(OBSTACK, OBJ) \
|
||||
__extension__ \
|
||||
({ struct obstack *__o = (OBSTACK); \
|
||||
void *__obj = (OBJ); \
|
||||
if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \
|
||||
__o->next_free = __o->object_base = __obj; \
|
||||
__o->next_free = __o->object_base = (char *)__obj; \
|
||||
else (obstack_free) (__o, __obj); })
|
||||
|
||||
#else /* not __GNUC__ or not __STDC__ */
|
||||
|
||||
#define obstack_object_size(h) \
|
||||
# define obstack_object_size(h) \
|
||||
(unsigned) ((h)->next_free - (h)->object_base)
|
||||
|
||||
#define obstack_room(h) \
|
||||
# define obstack_room(h) \
|
||||
(unsigned) ((h)->chunk_limit - (h)->next_free)
|
||||
|
||||
#define obstack_empty_p(h) \
|
||||
# define obstack_empty_p(h) \
|
||||
((h)->chunk->prev == 0 && (h)->next_free - (h)->chunk->contents == 0)
|
||||
|
||||
/* Note that the call to _obstack_newchunk is enclosed in (..., 0)
|
||||
@@ -508,19 +503,19 @@ __extension__ \
|
||||
Casting the third operand to void was tried before,
|
||||
but some compilers won't accept it. */
|
||||
|
||||
#define obstack_make_room(h,length) \
|
||||
# define obstack_make_room(h,length) \
|
||||
( (h)->temp = (length), \
|
||||
(((h)->next_free + (h)->temp > (h)->chunk_limit) \
|
||||
? (_obstack_newchunk ((h), (h)->temp), 0) : 0))
|
||||
|
||||
#define obstack_grow(h,where,length) \
|
||||
# define obstack_grow(h,where,length) \
|
||||
( (h)->temp = (length), \
|
||||
(((h)->next_free + (h)->temp > (h)->chunk_limit) \
|
||||
? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
|
||||
_obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
|
||||
(h)->next_free += (h)->temp)
|
||||
|
||||
#define obstack_grow0(h,where,length) \
|
||||
# define obstack_grow0(h,where,length) \
|
||||
( (h)->temp = (length), \
|
||||
(((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \
|
||||
? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \
|
||||
@@ -528,40 +523,40 @@ __extension__ \
|
||||
(h)->next_free += (h)->temp, \
|
||||
*((h)->next_free)++ = 0)
|
||||
|
||||
#define obstack_1grow(h,datum) \
|
||||
# define obstack_1grow(h,datum) \
|
||||
( (((h)->next_free + 1 > (h)->chunk_limit) \
|
||||
? (_obstack_newchunk ((h), 1), 0) : 0), \
|
||||
(*((h)->next_free)++ = (datum)))
|
||||
|
||||
#define obstack_ptr_grow(h,datum) \
|
||||
# define obstack_ptr_grow(h,datum) \
|
||||
( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \
|
||||
? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \
|
||||
(*((char **) (((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *) datum)))
|
||||
|
||||
#define obstack_int_grow(h,datum) \
|
||||
# define obstack_int_grow(h,datum) \
|
||||
( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \
|
||||
? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \
|
||||
(*((int *) (((h)->next_free+=sizeof(int))-sizeof(int))) = ((int) datum)))
|
||||
|
||||
#define obstack_ptr_grow_fast(h,aptr) (*((char **) (h)->next_free)++ = (char *) aptr)
|
||||
#define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
|
||||
# define obstack_ptr_grow_fast(h,aptr) (*((char **) (h)->next_free)++ = (char *) aptr)
|
||||
# define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
|
||||
|
||||
#define obstack_blank(h,length) \
|
||||
# define obstack_blank(h,length) \
|
||||
( (h)->temp = (length), \
|
||||
(((h)->chunk_limit - (h)->next_free < (h)->temp) \
|
||||
? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
|
||||
((h)->next_free += (h)->temp))
|
||||
|
||||
#define obstack_alloc(h,length) \
|
||||
# define obstack_alloc(h,length) \
|
||||
(obstack_blank ((h), (length)), obstack_finish ((h)))
|
||||
|
||||
#define obstack_copy(h,where,length) \
|
||||
# define obstack_copy(h,where,length) \
|
||||
(obstack_grow ((h), (where), (length)), obstack_finish ((h)))
|
||||
|
||||
#define obstack_copy0(h,where,length) \
|
||||
# define obstack_copy0(h,where,length) \
|
||||
(obstack_grow0 ((h), (where), (length)), obstack_finish ((h)))
|
||||
|
||||
#define obstack_finish(h) \
|
||||
# define obstack_finish(h) \
|
||||
( ((h)->next_free == (h)->object_base \
|
||||
? (((h)->maybe_empty_object = 1), 0) \
|
||||
: 0), \
|
||||
@@ -575,21 +570,21 @@ __extension__ \
|
||||
(h)->object_base = (h)->next_free, \
|
||||
__INT_TO_PTR ((h)->temp))
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#define obstack_free(h,obj) \
|
||||
# if defined __STDC__ && __STDC__
|
||||
# define obstack_free(h,obj) \
|
||||
( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
|
||||
(((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
|
||||
? (int) ((h)->next_free = (h)->object_base \
|
||||
= (h)->temp + (char *) (h)->chunk) \
|
||||
: (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0)))
|
||||
#else
|
||||
#define obstack_free(h,obj) \
|
||||
# else
|
||||
# define obstack_free(h,obj) \
|
||||
( (h)->temp = (char *) (obj) - (char *) (h)->chunk, \
|
||||
(((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
|
||||
? (int) ((h)->next_free = (h)->object_base \
|
||||
= (h)->temp + (char *) (h)->chunk) \
|
||||
: (_obstack_free ((h), (h)->temp + (char *) (h)->chunk), 0)))
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#endif /* not __GNUC__ or not __STDC__ */
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* path-concat.c -- concatenate two arbitrary pathnames
|
||||
Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -32,6 +32,9 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
char *malloc ();
|
||||
#ifndef strdup
|
||||
char *strdup ();
|
||||
#endif
|
||||
|
||||
#ifndef DIRECTORY_SEPARATOR
|
||||
# define DIRECTORY_SEPARATOR '/'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1994, 1997, 1998 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1994, 1997, 1998, 2000 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C
|
||||
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
@@ -17,14 +17,16 @@
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Include errno.h *after* sys/types.h to work around header problems
|
||||
on AIX 3.2.5. */
|
||||
#include <errno.h>
|
||||
|
||||
/* Don't include stdlib.h because some (e.g., Solaris 2.7) declare putenv
|
||||
with a non-const argument. That would conflict with the declaration of
|
||||
rpl_putenv below (due to the #define putenv rpl_putenv from config.h). */
|
||||
|
||||
@@ -44,6 +44,12 @@
|
||||
# define UCHAR_MAX ((unsigned char) -1)
|
||||
#endif
|
||||
|
||||
#if HAVE_C_BACKSLASH_A
|
||||
# define ALERT_CHAR '\a'
|
||||
#else
|
||||
# define ALERT_CHAR '\7'
|
||||
#endif
|
||||
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
@@ -266,9 +272,7 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
|
||||
}
|
||||
break;
|
||||
|
||||
#if HAVE_C_BACKSLASH_A
|
||||
case '\a': esc = 'a'; goto c_escape;
|
||||
#endif
|
||||
case ALERT_CHAR: esc = 'a'; goto c_escape;
|
||||
case '\b': esc = 'b'; goto c_escape;
|
||||
case '\f': esc = 'f'; goto c_escape;
|
||||
case '\n': esc = 'n'; goto c_and_shell_escape;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
|
||||
# include <string.h>
|
||||
@@ -129,4 +130,4 @@ read_utmp (const char *filename, int *n_entries, STRUCT_UTMP **utmp_buf)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* HAVE_UTMPNAME */
|
||||
#endif
|
||||
|
||||
@@ -42,6 +42,9 @@
|
||||
# endif
|
||||
# else
|
||||
# include <utmp.h>
|
||||
# if !HAVE_DECL_GETUTENT
|
||||
struct utmp *getutent();
|
||||
# endif
|
||||
# define UTMP_STRUCT_NAME utmp
|
||||
# define UT_TIME_MEMBER(UT_PTR) ((UT_PTR)->ut_time)
|
||||
# define SET_UTMP_ENT setutent
|
||||
|
||||
31
lib/ref-add.sin
Normal file
31
lib/ref-add.sin
Normal file
@@ -0,0 +1,31 @@
|
||||
# Add this package to a list of references stored in a text file.
|
||||
#
|
||||
# Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Library General Public License as published
|
||||
# by the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
# USA.
|
||||
#
|
||||
# Written by Bruno Haible <haible@clisp.cons.org>.
|
||||
#
|
||||
/^# Packages using this file: / {
|
||||
s/# Packages using this file://
|
||||
ta
|
||||
:a
|
||||
s/ @PACKAGE@ / @PACKAGE@ /
|
||||
tb
|
||||
s/ $/ @PACKAGE@ /
|
||||
:b
|
||||
s/^/# Packages using this file:/
|
||||
}
|
||||
26
lib/ref-del.sin
Normal file
26
lib/ref-del.sin
Normal file
@@ -0,0 +1,26 @@
|
||||
# Remove this package from a list of references stored in a text file.
|
||||
#
|
||||
# Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Library General Public License as published
|
||||
# by the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Library General Public
|
||||
# License along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
# USA.
|
||||
#
|
||||
# Written by Bruno Haible <haible@clisp.cons.org>.
|
||||
#
|
||||
/^# Packages using this file: / {
|
||||
s/# Packages using this file://
|
||||
s/ @PACKAGE@ / /
|
||||
s/^/# Packages using this file:/
|
||||
}
|
||||
666
lib/regex.c
666
lib/regex.c
@@ -2,7 +2,7 @@
|
||||
version 0.12.
|
||||
(Implements POSIX draft P1003.2/D11.2, except for some of the
|
||||
internationalization features.)
|
||||
Copyright (C) 1993, 94, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993-1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
@@ -78,7 +78,12 @@
|
||||
__re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
|
||||
# define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
|
||||
|
||||
#define btowc __btowc
|
||||
# define btowc __btowc
|
||||
|
||||
/* We are also using some library internals. */
|
||||
# include <locale/localeinfo.h>
|
||||
# include <locale/elem-hash.h>
|
||||
# include <langinfo.h>
|
||||
#endif
|
||||
|
||||
/* This is for other GNU distributions with internationalized messages. */
|
||||
@@ -164,47 +169,15 @@ char *realloc ();
|
||||
# define SWITCH_ENUM_CAST(x) (x)
|
||||
# endif
|
||||
|
||||
/* How many characters in the character set. */
|
||||
# define CHAR_SET_SIZE 256
|
||||
|
||||
# ifdef SYNTAX_TABLE
|
||||
|
||||
extern char *re_syntax_table;
|
||||
|
||||
# else /* not SYNTAX_TABLE */
|
||||
|
||||
static char re_syntax_table[CHAR_SET_SIZE];
|
||||
|
||||
static void
|
||||
init_syntax_once ()
|
||||
{
|
||||
register int c;
|
||||
static int done = 0;
|
||||
|
||||
if (done)
|
||||
return;
|
||||
|
||||
bzero (re_syntax_table, sizeof re_syntax_table);
|
||||
|
||||
for (c = 'a'; c <= 'z'; c++)
|
||||
re_syntax_table[c] = Sword;
|
||||
|
||||
for (c = 'A'; c <= 'Z'; c++)
|
||||
re_syntax_table[c] = Sword;
|
||||
|
||||
for (c = '0'; c <= '9'; c++)
|
||||
re_syntax_table[c] = Sword;
|
||||
|
||||
re_syntax_table['_'] = Sword;
|
||||
|
||||
done = 1;
|
||||
}
|
||||
|
||||
# endif /* not SYNTAX_TABLE */
|
||||
|
||||
# define SYNTAX(c) re_syntax_table[c]
|
||||
|
||||
#endif /* not emacs */
|
||||
|
||||
#if defined _LIBC || HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
#ifndef MB_LEN_MAX
|
||||
# define MB_LEN_MAX 1
|
||||
#endif
|
||||
|
||||
/* Get the interface, including the syntax bits. */
|
||||
#include <regex.h>
|
||||
@@ -276,6 +249,43 @@ init_syntax_once ()
|
||||
# define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
|
||||
#endif
|
||||
|
||||
#ifndef emacs
|
||||
/* How many characters in the character set. */
|
||||
# define CHAR_SET_SIZE 256
|
||||
|
||||
# ifdef SYNTAX_TABLE
|
||||
|
||||
extern char *re_syntax_table;
|
||||
|
||||
# else /* not SYNTAX_TABLE */
|
||||
|
||||
static char re_syntax_table[CHAR_SET_SIZE];
|
||||
|
||||
static void
|
||||
init_syntax_once ()
|
||||
{
|
||||
register int c;
|
||||
static int done = 0;
|
||||
|
||||
if (done)
|
||||
return;
|
||||
bzero (re_syntax_table, sizeof re_syntax_table);
|
||||
|
||||
for (c = 0; c < CHAR_SET_SIZE; ++c)
|
||||
if (ISALNUM (c))
|
||||
re_syntax_table[c] = Sword;
|
||||
|
||||
re_syntax_table['_'] = Sword;
|
||||
|
||||
done = 1;
|
||||
}
|
||||
|
||||
# endif /* not SYNTAX_TABLE */
|
||||
|
||||
# define SYNTAX(c) re_syntax_table[(unsigned char) (c)]
|
||||
|
||||
#endif /* emacs */
|
||||
|
||||
/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
|
||||
use `alloca' instead of `malloc'. This is because using malloc in
|
||||
re_search* or re_match* could cause memory leaks when C-g is used in
|
||||
@@ -615,7 +625,7 @@ extract_number_and_incr (destination, source)
|
||||
/* It is useful to test things that ``must'' be true when debugging. */
|
||||
# include <assert.h>
|
||||
|
||||
static int debug = 0;
|
||||
static int debug;
|
||||
|
||||
# define DEBUG_STATEMENT(e) e
|
||||
# define DEBUG_PRINT1(x) if (debug) printf (x)
|
||||
@@ -681,7 +691,11 @@ print_partial_compiled_pattern (start, end)
|
||||
/* Loop over pattern commands. */
|
||||
while (p < pend)
|
||||
{
|
||||
printf ("%d:\t", p - start);
|
||||
#ifdef _LIBC
|
||||
printf ("%t:\t", p - start);
|
||||
#else
|
||||
printf ("%ld:\t", (long int) (p - start));
|
||||
#endif
|
||||
|
||||
switch ((re_opcode_t) *p++)
|
||||
{
|
||||
@@ -771,17 +785,30 @@ print_partial_compiled_pattern (start, end)
|
||||
|
||||
case on_failure_jump:
|
||||
extract_number_and_incr (&mcnt, &p);
|
||||
printf ("/on_failure_jump to %d", p + mcnt - start);
|
||||
#ifdef _LIBC
|
||||
printf ("/on_failure_jump to %t", p + mcnt - start);
|
||||
#else
|
||||
printf ("/on_failure_jump to %ld", (long int) (p + mcnt - start));
|
||||
#endif
|
||||
break;
|
||||
|
||||
case on_failure_keep_string_jump:
|
||||
extract_number_and_incr (&mcnt, &p);
|
||||
printf ("/on_failure_keep_string_jump to %d", p + mcnt - start);
|
||||
#ifdef _LIBC
|
||||
printf ("/on_failure_keep_string_jump to %t", p + mcnt - start);
|
||||
#else
|
||||
printf ("/on_failure_keep_string_jump to %ld",
|
||||
(long int) (p + mcnt - start));
|
||||
#endif
|
||||
break;
|
||||
|
||||
case dummy_failure_jump:
|
||||
extract_number_and_incr (&mcnt, &p);
|
||||
printf ("/dummy_failure_jump to %d", p + mcnt - start);
|
||||
#ifdef _LIBC
|
||||
printf ("/dummy_failure_jump to %t", p + mcnt - start);
|
||||
#else
|
||||
printf ("/dummy_failure_jump to %ld", (long int) (p + mcnt - start));
|
||||
#endif
|
||||
break;
|
||||
|
||||
case push_dummy_failure:
|
||||
@@ -790,29 +817,50 @@ print_partial_compiled_pattern (start, end)
|
||||
|
||||
case maybe_pop_jump:
|
||||
extract_number_and_incr (&mcnt, &p);
|
||||
printf ("/maybe_pop_jump to %d", p + mcnt - start);
|
||||
#ifdef _LIBC
|
||||
printf ("/maybe_pop_jump to %t", p + mcnt - start);
|
||||
#else
|
||||
printf ("/maybe_pop_jump to %ld", (long int) (p + mcnt - start));
|
||||
#endif
|
||||
break;
|
||||
|
||||
case pop_failure_jump:
|
||||
extract_number_and_incr (&mcnt, &p);
|
||||
printf ("/pop_failure_jump to %d", p + mcnt - start);
|
||||
#ifdef _LIBC
|
||||
printf ("/pop_failure_jump to %t", p + mcnt - start);
|
||||
#else
|
||||
printf ("/pop_failure_jump to %ld", (long int) (p + mcnt - start));
|
||||
#endif
|
||||
break;
|
||||
|
||||
case jump_past_alt:
|
||||
extract_number_and_incr (&mcnt, &p);
|
||||
printf ("/jump_past_alt to %d", p + mcnt - start);
|
||||
#ifdef _LIBC
|
||||
printf ("/jump_past_alt to %t", p + mcnt - start);
|
||||
#else
|
||||
printf ("/jump_past_alt to %ld", (long int) (p + mcnt - start));
|
||||
#endif
|
||||
break;
|
||||
|
||||
case jump:
|
||||
extract_number_and_incr (&mcnt, &p);
|
||||
printf ("/jump to %d", p + mcnt - start);
|
||||
#ifdef _LIBC
|
||||
printf ("/jump to %t", p + mcnt - start);
|
||||
#else
|
||||
printf ("/jump to %ld", (long int) (p + mcnt - start));
|
||||
#endif
|
||||
break;
|
||||
|
||||
case succeed_n:
|
||||
extract_number_and_incr (&mcnt, &p);
|
||||
p1 = p + mcnt;
|
||||
extract_number_and_incr (&mcnt2, &p);
|
||||
printf ("/succeed_n to %d, %d times", p1 - start, mcnt2);
|
||||
#ifdef _LIBC
|
||||
printf ("/succeed_n to %t, %d times", p1 - start, mcnt2);
|
||||
#else
|
||||
printf ("/succeed_n to %ld, %d times",
|
||||
(long int) (p1 - start), mcnt2);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case jump_n:
|
||||
@@ -826,7 +874,12 @@ print_partial_compiled_pattern (start, end)
|
||||
extract_number_and_incr (&mcnt, &p);
|
||||
p1 = p + mcnt;
|
||||
extract_number_and_incr (&mcnt2, &p);
|
||||
printf ("/set_number_at location %d to %d", p1 - start, mcnt2);
|
||||
#ifdef _LIBC
|
||||
printf ("/set_number_at location %t to %d", p1 - start, mcnt2);
|
||||
#else
|
||||
printf ("/set_number_at location %ld to %d",
|
||||
(long int) (p1 - start), mcnt2);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case wordbound:
|
||||
@@ -893,7 +946,11 @@ print_partial_compiled_pattern (start, end)
|
||||
putchar ('\n');
|
||||
}
|
||||
|
||||
printf ("%d:\tend of pattern.\n", p - start);
|
||||
#ifdef _LIBC
|
||||
printf ("%t:\tend of pattern.\n", p - start);
|
||||
#else
|
||||
printf ("%ld:\tend of pattern.\n", (long int) (p - start));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -913,7 +970,11 @@ print_compiled_pattern (bufp)
|
||||
print_fastmap (bufp->fastmap);
|
||||
}
|
||||
|
||||
printf ("re_nsub: %d\t", bufp->re_nsub);
|
||||
#ifdef _LIBC
|
||||
printf ("re_nsub: %Zd\t", bufp->re_nsub);
|
||||
#else
|
||||
printf ("re_nsub: %ld\t", (long int) bufp->re_nsub);
|
||||
#endif
|
||||
printf ("regs_alloc: %d\t", bufp->regs_allocated);
|
||||
printf ("can_be_null: %d\t", bufp->can_be_null);
|
||||
printf ("newline_anchor: %d\n", bufp->newline_anchor);
|
||||
@@ -1013,25 +1074,79 @@ weak_alias (__re_set_syntax, re_set_syntax)
|
||||
POSIX doesn't require that we do anything for REG_NOERROR,
|
||||
but why not be nice? */
|
||||
|
||||
static const char *re_error_msgid[] =
|
||||
static const char re_error_msgid[] =
|
||||
{
|
||||
gettext_noop ("Success"), /* REG_NOERROR */
|
||||
gettext_noop ("No match"), /* REG_NOMATCH */
|
||||
gettext_noop ("Invalid regular expression"), /* REG_BADPAT */
|
||||
gettext_noop ("Invalid collation character"), /* REG_ECOLLATE */
|
||||
gettext_noop ("Invalid character class name"), /* REG_ECTYPE */
|
||||
gettext_noop ("Trailing backslash"), /* REG_EESCAPE */
|
||||
gettext_noop ("Invalid back reference"), /* REG_ESUBREG */
|
||||
gettext_noop ("Unmatched [ or [^"), /* REG_EBRACK */
|
||||
gettext_noop ("Unmatched ( or \\("), /* REG_EPAREN */
|
||||
gettext_noop ("Unmatched \\{"), /* REG_EBRACE */
|
||||
gettext_noop ("Invalid content of \\{\\}"), /* REG_BADBR */
|
||||
gettext_noop ("Invalid range end"), /* REG_ERANGE */
|
||||
gettext_noop ("Memory exhausted"), /* REG_ESPACE */
|
||||
gettext_noop ("Invalid preceding regular expression"), /* REG_BADRPT */
|
||||
gettext_noop ("Premature end of regular expression"), /* REG_EEND */
|
||||
gettext_noop ("Regular expression too big"), /* REG_ESIZE */
|
||||
gettext_noop ("Unmatched ) or \\)"), /* REG_ERPAREN */
|
||||
#define REG_NOERROR_IDX 0
|
||||
gettext_noop ("Success") /* REG_NOERROR */
|
||||
"\0"
|
||||
#define REG_NOMATCH_IDX (REG_NOERROR_IDX + sizeof "Success")
|
||||
gettext_noop ("No match") /* REG_NOMATCH */
|
||||
"\0"
|
||||
#define REG_BADPAT_IDX (REG_NOMATCH_IDX + sizeof "No match")
|
||||
gettext_noop ("Invalid regular expression") /* REG_BADPAT */
|
||||
"\0"
|
||||
#define REG_ECOLLATE_IDX (REG_BADPAT_IDX + sizeof "Invalid regular expression")
|
||||
gettext_noop ("Invalid collation character") /* REG_ECOLLATE */
|
||||
"\0"
|
||||
#define REG_ECTYPE_IDX (REG_ECOLLATE_IDX + sizeof "Invalid collation character")
|
||||
gettext_noop ("Invalid character class name") /* REG_ECTYPE */
|
||||
"\0"
|
||||
#define REG_EESCAPE_IDX (REG_ECTYPE_IDX + sizeof "Invalid character class name")
|
||||
gettext_noop ("Trailing backslash") /* REG_EESCAPE */
|
||||
"\0"
|
||||
#define REG_ESUBREG_IDX (REG_EESCAPE_IDX + sizeof "Trailing backslash")
|
||||
gettext_noop ("Invalid back reference") /* REG_ESUBREG */
|
||||
"\0"
|
||||
#define REG_EBRACK_IDX (REG_ESUBREG_IDX + sizeof "Invalid back reference")
|
||||
gettext_noop ("Unmatched [ or [^") /* REG_EBRACK */
|
||||
"\0"
|
||||
#define REG_EPAREN_IDX (REG_EBRACK_IDX + sizeof "Unmatched [ or [^")
|
||||
gettext_noop ("Unmatched ( or \\(") /* REG_EPAREN */
|
||||
"\0"
|
||||
#define REG_EBRACE_IDX (REG_EPAREN_IDX + sizeof "Unmatched ( or \\(")
|
||||
gettext_noop ("Unmatched \\{") /* REG_EBRACE */
|
||||
"\0"
|
||||
#define REG_BADBR_IDX (REG_EBRACE_IDX + sizeof "Unmatched \\{")
|
||||
gettext_noop ("Invalid content of \\{\\}") /* REG_BADBR */
|
||||
"\0"
|
||||
#define REG_ERANGE_IDX (REG_BADBR_IDX + sizeof "Invalid content of \\{\\}")
|
||||
gettext_noop ("Invalid range end") /* REG_ERANGE */
|
||||
"\0"
|
||||
#define REG_ESPACE_IDX (REG_ERANGE_IDX + sizeof "Invalid range end")
|
||||
gettext_noop ("Memory exhausted") /* REG_ESPACE */
|
||||
"\0"
|
||||
#define REG_BADRPT_IDX (REG_ESPACE_IDX + sizeof "Memory exhausted")
|
||||
gettext_noop ("Invalid preceding regular expression") /* REG_BADRPT */
|
||||
"\0"
|
||||
#define REG_EEND_IDX (REG_BADRPT_IDX + sizeof "Invalid preceding regular expression")
|
||||
gettext_noop ("Premature end of regular expression") /* REG_EEND */
|
||||
"\0"
|
||||
#define REG_ESIZE_IDX (REG_EEND_IDX + sizeof "Premature end of regular expression")
|
||||
gettext_noop ("Regular expression too big") /* REG_ESIZE */
|
||||
"\0"
|
||||
#define REG_ERPAREN_IDX (REG_ESIZE_IDX + sizeof "Regular expression too big")
|
||||
gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */
|
||||
};
|
||||
|
||||
static const size_t re_error_msgid_idx[] =
|
||||
{
|
||||
REG_NOERROR_IDX,
|
||||
REG_NOMATCH_IDX,
|
||||
REG_BADPAT_IDX,
|
||||
REG_ECOLLATE_IDX,
|
||||
REG_ECTYPE_IDX,
|
||||
REG_EESCAPE_IDX,
|
||||
REG_ESUBREG_IDX,
|
||||
REG_EBRACK_IDX,
|
||||
REG_EPAREN_IDX,
|
||||
REG_EBRACE_IDX,
|
||||
REG_BADBR_IDX,
|
||||
REG_ERANGE_IDX,
|
||||
REG_ESPACE_IDX,
|
||||
REG_BADRPT_IDX,
|
||||
REG_EEND_IDX,
|
||||
REG_ESIZE_IDX,
|
||||
REG_ERPAREN_IDX
|
||||
};
|
||||
|
||||
/* Avoiding alloca during matching, to placate r_alloc. */
|
||||
@@ -1514,7 +1629,8 @@ static boolean at_begline_loc_p _RE_ARGS ((const char *pattern, const char *p,
|
||||
reg_syntax_t syntax));
|
||||
static boolean at_endline_loc_p _RE_ARGS ((const char *p, const char *pend,
|
||||
reg_syntax_t syntax));
|
||||
static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
|
||||
static reg_errcode_t compile_range _RE_ARGS ((unsigned int range_start,
|
||||
const char **p_ptr,
|
||||
const char *pend,
|
||||
char *translate,
|
||||
reg_syntax_t syntax,
|
||||
@@ -1712,7 +1828,7 @@ typedef struct
|
||||
{ if (p != pend) \
|
||||
{ \
|
||||
PATFETCH (c); \
|
||||
while (ISDIGIT (c)) \
|
||||
while ('0' <= c && c <= '9') \
|
||||
{ \
|
||||
if (num < 0) \
|
||||
num = 0; \
|
||||
@@ -2118,6 +2234,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
case '[':
|
||||
{
|
||||
boolean had_char_class = false;
|
||||
unsigned int range_start = 0xffffffff;
|
||||
|
||||
if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
|
||||
|
||||
@@ -2161,6 +2278,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
|
||||
PATFETCH (c1);
|
||||
SET_LIST_BIT (c1);
|
||||
range_start = c1;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2185,8 +2303,10 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
&& *p != ']')
|
||||
{
|
||||
reg_errcode_t ret
|
||||
= compile_range (&p, pend, translate, syntax, b);
|
||||
= compile_range (range_start, &p, pend, translate,
|
||||
syntax, b);
|
||||
if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
|
||||
range_start = 0xffffffff;
|
||||
}
|
||||
|
||||
else if (p[0] == '-' && p[1] != ']')
|
||||
@@ -2196,8 +2316,9 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
/* Move past the `-'. */
|
||||
PATFETCH (c1);
|
||||
|
||||
ret = compile_range (&p, pend, translate, syntax, b);
|
||||
ret = compile_range (c, &p, pend, translate, syntax, b);
|
||||
if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
|
||||
range_start = 0xffffffff;
|
||||
}
|
||||
|
||||
/* See if we're at the beginning of a possible character
|
||||
@@ -2320,13 +2441,289 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
PATUNFETCH;
|
||||
SET_LIST_BIT ('[');
|
||||
SET_LIST_BIT (':');
|
||||
range_start = ':';
|
||||
had_char_class = false;
|
||||
}
|
||||
}
|
||||
else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '=')
|
||||
{
|
||||
unsigned char str[MB_LEN_MAX + 1];
|
||||
#ifdef _LIBC
|
||||
uint32_t nrules =
|
||||
_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
|
||||
#endif
|
||||
|
||||
PATFETCH (c);
|
||||
c1 = 0;
|
||||
|
||||
/* If pattern is `[[='. */
|
||||
if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
PATFETCH (c);
|
||||
if ((c == '=' && *p == ']') || p == pend)
|
||||
break;
|
||||
if (c1 < MB_LEN_MAX)
|
||||
str[c1++] = c;
|
||||
else
|
||||
/* This is in any case an invalid class name. */
|
||||
str[0] = '\0';
|
||||
}
|
||||
str[c1] = '\0';
|
||||
|
||||
if (c == '=' && *p == ']' && str[0] != '\0')
|
||||
{
|
||||
/* If we have no collation data we use the default
|
||||
collation in which each character is in a class
|
||||
by itself. It also means that ASCII is the
|
||||
character set and therefore we cannot have character
|
||||
with more than one byte in the multibyte
|
||||
representation. */
|
||||
#ifdef _LIBC
|
||||
if (nrules == 0)
|
||||
#endif
|
||||
{
|
||||
if (c1 != 1)
|
||||
FREE_STACK_RETURN (REG_ECOLLATE);
|
||||
|
||||
/* Throw away the ] at the end of the equivalence
|
||||
class. */
|
||||
PATFETCH (c);
|
||||
|
||||
/* Set the bit for the character. */
|
||||
SET_LIST_BIT (str[0]);
|
||||
}
|
||||
#ifdef _LIBC
|
||||
else
|
||||
{
|
||||
/* Try to match the byte sequence in `str' against
|
||||
those known to the collate implementation.
|
||||
First find out whether the bytes in `str' are
|
||||
actually from exactly one character. */
|
||||
const int32_t *table;
|
||||
const unsigned char *weights;
|
||||
const unsigned char *extra;
|
||||
const int32_t *indirect;
|
||||
int32_t idx;
|
||||
const unsigned char *cp = str;
|
||||
int ch;
|
||||
|
||||
/* This #include defines a local function! */
|
||||
# include <locale/weight.h>
|
||||
|
||||
table = (const int32_t *)
|
||||
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
|
||||
weights = (const unsigned char *)
|
||||
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB);
|
||||
extra = (const unsigned char *)
|
||||
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
|
||||
indirect = (const int32_t *)
|
||||
_NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
|
||||
|
||||
idx = findidx (&cp);
|
||||
if (idx == 0 || cp < str + c1)
|
||||
/* This is no valid character. */
|
||||
FREE_STACK_RETURN (REG_ECOLLATE);
|
||||
|
||||
/* Throw away the ] at the end of the equivalence
|
||||
class. */
|
||||
PATFETCH (c);
|
||||
|
||||
/* Now we have to go throught the whole table
|
||||
and find all characters which have the same
|
||||
first level weight.
|
||||
|
||||
XXX Note that this is not entirely correct.
|
||||
we would have to match multibyte sequences
|
||||
but this is not possible with the current
|
||||
implementation. */
|
||||
for (ch = 1; ch < 256; ++ch)
|
||||
/* XXX This test would have to be changed if we
|
||||
would allow matching multibyte sequences. */
|
||||
if (table[ch] > 0)
|
||||
{
|
||||
int32_t idx2 = table[ch];
|
||||
size_t len = weights[idx2];
|
||||
|
||||
/* Test whether the lenghts match. */
|
||||
if (weights[idx] == len)
|
||||
{
|
||||
/* They do. New compare the bytes of
|
||||
the weight. */
|
||||
size_t cnt = 0;
|
||||
|
||||
while (cnt < len
|
||||
&& (weights[idx + 1 + cnt]
|
||||
== weights[idx2 + 1 + cnt]))
|
||||
++len;
|
||||
|
||||
if (cnt == len)
|
||||
/* They match. Mark the character as
|
||||
acceptable. */
|
||||
SET_LIST_BIT (ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
had_char_class = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
c1++;
|
||||
while (c1--)
|
||||
PATUNFETCH;
|
||||
SET_LIST_BIT ('[');
|
||||
SET_LIST_BIT ('=');
|
||||
range_start = '=';
|
||||
had_char_class = false;
|
||||
}
|
||||
}
|
||||
else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '.')
|
||||
{
|
||||
unsigned char str[128]; /* Should be large enough. */
|
||||
#ifdef _LIBC
|
||||
uint32_t nrules =
|
||||
_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
|
||||
#endif
|
||||
|
||||
PATFETCH (c);
|
||||
c1 = 0;
|
||||
|
||||
/* If pattern is `[[='. */
|
||||
if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
PATFETCH (c);
|
||||
if ((c == '.' && *p == ']') || p == pend)
|
||||
break;
|
||||
if (c1 < sizeof (str))
|
||||
str[c1++] = c;
|
||||
else
|
||||
/* This is in any case an invalid class name. */
|
||||
str[0] = '\0';
|
||||
}
|
||||
str[c1] = '\0';
|
||||
|
||||
if (c == '.' && *p == ']' && str[0] != '\0')
|
||||
{
|
||||
/* If we have no collation data we use the default
|
||||
collation in which each character is the name
|
||||
for its own class which contains only the one
|
||||
character. It also means that ASCII is the
|
||||
character set and therefore we cannot have character
|
||||
with more than one byte in the multibyte
|
||||
representation. */
|
||||
#ifdef _LIBC
|
||||
if (nrules == 0)
|
||||
#endif
|
||||
{
|
||||
if (c1 != 1)
|
||||
FREE_STACK_RETURN (REG_ECOLLATE);
|
||||
|
||||
/* Throw away the ] at the end of the equivalence
|
||||
class. */
|
||||
PATFETCH (c);
|
||||
|
||||
/* Set the bit for the character. */
|
||||
SET_LIST_BIT (str[0]);
|
||||
range_start = ((const unsigned char *) str)[0];
|
||||
}
|
||||
#ifdef _LIBC
|
||||
else
|
||||
{
|
||||
/* Try to match the byte sequence in `str' against
|
||||
those known to the collate implementation.
|
||||
First find out whether the bytes in `str' are
|
||||
actually from exactly one character. */
|
||||
int32_t table_size;
|
||||
const int32_t *symb_table;
|
||||
const unsigned char *extra;
|
||||
int32_t idx;
|
||||
int32_t elem;
|
||||
int32_t second;
|
||||
int32_t hash;
|
||||
|
||||
table_size =
|
||||
_NL_CURRENT_WORD (LC_COLLATE,
|
||||
_NL_COLLATE_SYMB_HASH_SIZEMB);
|
||||
symb_table = (const int32_t *)
|
||||
_NL_CURRENT (LC_COLLATE,
|
||||
_NL_COLLATE_SYMB_TABLEMB);
|
||||
extra = (const unsigned char *)
|
||||
_NL_CURRENT (LC_COLLATE,
|
||||
_NL_COLLATE_SYMB_EXTRAMB);
|
||||
|
||||
/* Locate the character in the hashing table. */
|
||||
hash = elem_hash (str, c1);
|
||||
|
||||
idx = 0;
|
||||
elem = hash % table_size;
|
||||
second = hash % (table_size - 2);
|
||||
while (symb_table[2 * elem] != 0)
|
||||
{
|
||||
/* First compare the hashing value. */
|
||||
if (symb_table[2 * elem] == hash
|
||||
&& c1 == extra[symb_table[2 * elem + 1]]
|
||||
&& memcmp (str,
|
||||
&extra[symb_table[2 * elem + 1]
|
||||
+ 1],
|
||||
c1) == 0)
|
||||
{
|
||||
/* Yep, this is the entry. */
|
||||
idx = symb_table[2 * elem + 1];
|
||||
idx += 1 + extra[idx];
|
||||
break;
|
||||
}
|
||||
|
||||
/* Next entry. */
|
||||
elem += second;
|
||||
}
|
||||
|
||||
if (symb_table[2 * elem] == 0)
|
||||
/* This is no valid character. */
|
||||
FREE_STACK_RETURN (REG_ECOLLATE);
|
||||
|
||||
/* Throw away the ] at the end of the equivalence
|
||||
class. */
|
||||
PATFETCH (c);
|
||||
|
||||
/* Now add the multibyte character(s) we found
|
||||
to the acceptabed list.
|
||||
|
||||
XXX Note that this is not entirely correct.
|
||||
we would have to match multibyte sequences
|
||||
but this is not possible with the current
|
||||
implementation. Also, we have to match
|
||||
collating symbols, which expand to more than
|
||||
one file, as a whole and not allow the
|
||||
individual bytes. */
|
||||
c1 = extra[idx++];
|
||||
if (c1 == 1)
|
||||
range_start = extra[idx];
|
||||
while (c1-- > 0)
|
||||
SET_LIST_BIT (extra[idx++]);
|
||||
}
|
||||
#endif
|
||||
had_char_class = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
c1++;
|
||||
while (c1--)
|
||||
PATUNFETCH;
|
||||
SET_LIST_BIT ('[');
|
||||
SET_LIST_BIT ('.');
|
||||
range_start = '.';
|
||||
had_char_class = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
had_char_class = false;
|
||||
SET_LIST_BIT (c);
|
||||
range_start = c;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2553,8 +2950,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
if (!(syntax & RE_INTERVALS)
|
||||
/* If we're at `\{' and it's not the open-interval
|
||||
operator. */
|
||||
|| ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
|
||||
|| (p - 2 == pattern && p == pend))
|
||||
|| (syntax & RE_NO_BK_BRACES))
|
||||
goto normal_backslash;
|
||||
|
||||
handle_interval:
|
||||
@@ -2568,7 +2964,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
|
||||
if (p == pend)
|
||||
{
|
||||
if (syntax & RE_NO_BK_BRACES)
|
||||
if (!(syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
|
||||
goto unfetch_interval;
|
||||
else
|
||||
FREE_STACK_RETURN (REG_EBRACE);
|
||||
@@ -2579,7 +2975,12 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
if (c == ',')
|
||||
{
|
||||
GET_UNSIGNED_NUMBER (upper_bound);
|
||||
if (upper_bound < 0) upper_bound = RE_DUP_MAX;
|
||||
if ((!(syntax & RE_NO_BK_BRACES) && c != '\\')
|
||||
|| ((syntax & RE_NO_BK_BRACES) && c != '}'))
|
||||
FREE_STACK_RETURN (REG_BADBR);
|
||||
|
||||
if (upper_bound < 0)
|
||||
upper_bound = RE_DUP_MAX;
|
||||
}
|
||||
else
|
||||
/* Interval such as `{1}' => match exactly once. */
|
||||
@@ -2588,7 +2989,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
if (lower_bound < 0 || upper_bound > RE_DUP_MAX
|
||||
|| lower_bound > upper_bound)
|
||||
{
|
||||
if (syntax & RE_NO_BK_BRACES)
|
||||
if (!(syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
|
||||
goto unfetch_interval;
|
||||
else
|
||||
FREE_STACK_RETURN (REG_BADBR);
|
||||
@@ -2603,7 +3004,7 @@ regex_compile (pattern, size, syntax, bufp)
|
||||
|
||||
if (c != '}')
|
||||
{
|
||||
if (syntax & RE_NO_BK_BRACES)
|
||||
if (!(syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
|
||||
goto unfetch_interval;
|
||||
else
|
||||
FREE_STACK_RETURN (REG_BADBR);
|
||||
@@ -3076,49 +3477,53 @@ group_in_compile_stack (compile_stack, regnum)
|
||||
`regex_compile' itself. */
|
||||
|
||||
static reg_errcode_t
|
||||
compile_range (p_ptr, pend, translate, syntax, b)
|
||||
const char **p_ptr, *pend;
|
||||
RE_TRANSLATE_TYPE translate;
|
||||
reg_syntax_t syntax;
|
||||
unsigned char *b;
|
||||
compile_range (range_start_char, p_ptr, pend, translate, syntax, b)
|
||||
unsigned int range_start_char;
|
||||
const char **p_ptr, *pend;
|
||||
RE_TRANSLATE_TYPE translate;
|
||||
reg_syntax_t syntax;
|
||||
unsigned char *b;
|
||||
{
|
||||
unsigned this_char;
|
||||
|
||||
const char *p = *p_ptr;
|
||||
unsigned int range_start, range_end;
|
||||
reg_errcode_t ret;
|
||||
char range_start[2];
|
||||
char range_end[2];
|
||||
char ch[2];
|
||||
|
||||
if (p == pend)
|
||||
return REG_ERANGE;
|
||||
|
||||
/* Even though the pattern is a signed `char *', we need to fetch
|
||||
with unsigned char *'s; if the high bit of the pattern character
|
||||
is set, the range endpoints will be negative if we fetch using a
|
||||
signed char *.
|
||||
|
||||
We also want to fetch the endpoints without translating them; the
|
||||
/* Fetch the endpoints without translating them; the
|
||||
appropriate translation is done in the bit-setting loop below. */
|
||||
/* The SVR4 compiler on the 3B2 had trouble with unsigned const char *. */
|
||||
range_start = ((const unsigned char *) p)[-2];
|
||||
range_end = ((const unsigned char *) p)[0];
|
||||
range_start[0] = range_start_char;
|
||||
range_start[1] = '\0';
|
||||
range_end[0] = p[0];
|
||||
range_end[1] = '\0';
|
||||
|
||||
/* Have to increment the pointer into the pattern string, so the
|
||||
caller isn't still at the ending character. */
|
||||
(*p_ptr)++;
|
||||
|
||||
/* If the start is after the end, the range is empty. */
|
||||
if (range_start > range_end)
|
||||
return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
|
||||
/* Report an error if the range is empty and the syntax prohibits this. */
|
||||
ret = syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
|
||||
|
||||
/* Here we see why `this_char' has to be larger than an `unsigned
|
||||
char' -- the range is inclusive, so if `range_end' == 0xff
|
||||
(assuming 8-bit characters), we would otherwise go into an infinite
|
||||
loop, since all characters <= 0xff. */
|
||||
for (this_char = range_start; this_char <= range_end; this_char++)
|
||||
char' -- we would otherwise go into an infinite loop, since all
|
||||
characters <= 0xff. */
|
||||
ch[1] = '\0';
|
||||
for (this_char = 0; this_char <= (unsigned char) -1; ++this_char)
|
||||
{
|
||||
SET_LIST_BIT (TRANSLATE (this_char));
|
||||
ch[0] = this_char;
|
||||
if (strcoll (range_start, ch) <= 0 && strcoll (ch, range_end) <= 0)
|
||||
{
|
||||
SET_LIST_BIT (TRANSLATE (this_char));
|
||||
ret = REG_NOERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return REG_NOERROR;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in
|
||||
@@ -3848,7 +4253,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
|
||||
fail_stack_type fail_stack;
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
static unsigned failure_id = 0;
|
||||
static unsigned failure_id;
|
||||
unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0;
|
||||
#endif
|
||||
|
||||
@@ -4779,26 +5184,15 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
|
||||
}
|
||||
else if ((re_opcode_t) *p2 == charset)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
register unsigned char c
|
||||
= *p2 == (unsigned char) endline ? '\n' : p2[2];
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/* We win if the first character of the loop is not part
|
||||
of the charset. */
|
||||
if ((re_opcode_t) p1[3] == exactn
|
||||
&& ! ((int) p2[1] * BYTEWIDTH > (int) p1[5]
|
||||
&& (p2[2 + p1[5] / BYTEWIDTH]
|
||||
& (1 << (p1[5] % BYTEWIDTH)))))
|
||||
#else
|
||||
if ((re_opcode_t) p1[3] == exactn
|
||||
&& ! ((int) p2[1] * BYTEWIDTH > (int) p1[4]
|
||||
&& (p2[2 + p1[4] / BYTEWIDTH]
|
||||
& (1 << (p1[4] % BYTEWIDTH)))))
|
||||
#endif
|
||||
{
|
||||
p[-3] = (unsigned char) pop_failure_jump;
|
||||
DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
|
||||
c, p1[5]);
|
||||
&& ! ((int) p2[1] * BYTEWIDTH > (int) p1[5]
|
||||
&& (p2[2 + p1[5] / BYTEWIDTH]
|
||||
& (1 << (p1[5] % BYTEWIDTH)))))
|
||||
{
|
||||
p[-3] = (unsigned char) pop_failure_jump;
|
||||
DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
|
||||
}
|
||||
|
||||
else if ((re_opcode_t) p1[3] == charset_not)
|
||||
@@ -5489,7 +5883,7 @@ re_compile_pattern (pattern, length, bufp)
|
||||
|
||||
if (!ret)
|
||||
return NULL;
|
||||
return gettext (re_error_msgid[(int) ret]);
|
||||
return gettext (re_error_msgid + re_error_msgid_idx[(int) ret]);
|
||||
}
|
||||
#ifdef _LIBC
|
||||
weak_alias (__re_compile_pattern, re_compile_pattern)
|
||||
@@ -5526,12 +5920,14 @@ re_comp (s)
|
||||
{
|
||||
re_comp_buf.buffer = (unsigned char *) malloc (200);
|
||||
if (re_comp_buf.buffer == NULL)
|
||||
return (char *) gettext (re_error_msgid[(int) REG_ESPACE]);
|
||||
return (char *) gettext (re_error_msgid
|
||||
+ re_error_msgid_idx[(int) REG_ESPACE]);
|
||||
re_comp_buf.allocated = 200;
|
||||
|
||||
re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH);
|
||||
if (re_comp_buf.fastmap == NULL)
|
||||
return (char *) gettext (re_error_msgid[(int) REG_ESPACE]);
|
||||
return (char *) gettext (re_error_msgid
|
||||
+ re_error_msgid_idx[(int) REG_ESPACE]);
|
||||
}
|
||||
|
||||
/* Since `re_exec' always passes NULL for the `regs' argument, we
|
||||
@@ -5546,7 +5942,7 @@ re_comp (s)
|
||||
return NULL;
|
||||
|
||||
/* Yes, we're discarding `const' here if !HAVE_LIBINTL. */
|
||||
return (char *) gettext (re_error_msgid[(int) ret]);
|
||||
return (char *) gettext (re_error_msgid + re_error_msgid_idx[(int) ret]);
|
||||
}
|
||||
|
||||
|
||||
@@ -5666,7 +6062,7 @@ regcomp (preg, pattern, cflags)
|
||||
buffer. */
|
||||
if (re_compile_fastmap (preg) == -2)
|
||||
{
|
||||
/* Some error occured while computing the fastmap, just forget
|
||||
/* Some error occurred while computing the fastmap, just forget
|
||||
about it. */
|
||||
free (preg->fastmap);
|
||||
preg->fastmap = NULL;
|
||||
@@ -5772,15 +6168,15 @@ regerror (errcode, preg, errbuf, errbuf_size)
|
||||
size_t msg_size;
|
||||
|
||||
if (errcode < 0
|
||||
|| errcode >= (int) (sizeof (re_error_msgid)
|
||||
/ sizeof (re_error_msgid[0])))
|
||||
|| errcode >= (int) (sizeof (re_error_msgid_idx)
|
||||
/ sizeof (re_error_msgid_idx[0])))
|
||||
/* Only error codes returned by the rest of the code should be passed
|
||||
to this routine. If we are given anything else, or if other regex
|
||||
code generates an invalid error code, then the program has a bug.
|
||||
Dump core so we can fix it. */
|
||||
abort ();
|
||||
|
||||
msg = gettext (re_error_msgid[errcode]);
|
||||
msg = gettext (re_error_msgid + re_error_msgid_idx[errcode]);
|
||||
|
||||
msg_size = strlen (msg) + 1; /* Includes the null. */
|
||||
|
||||
|
||||
14
lib/regex.h
14
lib/regex.h
@@ -1,6 +1,6 @@
|
||||
/* Definitions for data structures and routines for the regular
|
||||
expression library, version 0.12.
|
||||
Copyright (C) 1985,89,90,91,92,93,95,96,97,98 Free Software Foundation, Inc.
|
||||
Copyright (C) 1985,1989-1993,1995-1998, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
@@ -221,13 +221,13 @@ extern reg_syntax_t re_syntax_options;
|
||||
(_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
|
||||
|
||||
#define RE_SYNTAX_POSIX_EXTENDED \
|
||||
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
|
||||
| RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
|
||||
| RE_NO_BK_PARENS | RE_NO_BK_VBAR \
|
||||
| RE_UNMATCHED_RIGHT_PAREN_ORD)
|
||||
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
|
||||
| RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
|
||||
| RE_NO_BK_PARENS | RE_NO_BK_VBAR \
|
||||
| RE_CONTEXT_INVALID_OPS | RE_UNMATCHED_RIGHT_PAREN_ORD)
|
||||
|
||||
/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
|
||||
replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
|
||||
/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INDEP_OPS is
|
||||
removed and RE_NO_BK_REFS is added. */
|
||||
#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
|
||||
(_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
|
||||
| RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Determine whether string value is affirmation or negative response
|
||||
according to current locale's data.
|
||||
Copyright (C) 1996, 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 1998, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -31,6 +31,9 @@
|
||||
|
||||
#if ENABLE_NLS
|
||||
# include <sys/types.h>
|
||||
# if HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
# endif
|
||||
# include <regex.h>
|
||||
# include <libintl.h>
|
||||
# define _(Text) gettext (Text)
|
||||
|
||||
@@ -89,7 +89,8 @@ savedir (const char *dir, off_t name_size)
|
||||
|
||||
/* Be sure name_size is at least `1' so there's room for
|
||||
the final NUL byte. */
|
||||
name_size += !name_size;
|
||||
if (name_size <= 0)
|
||||
name_size = 1;
|
||||
|
||||
name_space = (char *) malloc (name_size);
|
||||
if (name_space == NULL)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991-1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
@@ -817,6 +817,14 @@ my_strftime (s, maxsize, format, tp ut_argument)
|
||||
char *u = ufmt;
|
||||
char ubuf[1024]; /* enough for any single format in practice */
|
||||
size_t len;
|
||||
/* Make sure we're calling the actual underlying strftime.
|
||||
In some cases, config.h contains something like
|
||||
"#define strftime rpl_strftime". */
|
||||
# ifdef strftime
|
||||
# undef strftime
|
||||
size_t strftime ();
|
||||
# endif
|
||||
|
||||
*u++ = '%';
|
||||
if (modifier != 0)
|
||||
*u++ = modifier;
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
@@ -24,22 +24,32 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
# include <string.h>
|
||||
#if defined _LIBC || defined STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
#else
|
||||
char *malloc ();
|
||||
#endif
|
||||
|
||||
/* Duplicate S, returning an identical malloc'd string. */
|
||||
#undef __strndup
|
||||
#undef strndup
|
||||
|
||||
#ifndef weak_alias
|
||||
# define __strndup strndup
|
||||
#endif
|
||||
|
||||
char *
|
||||
strndup (const char *s, size_t n)
|
||||
__strndup (const char *s, size_t n)
|
||||
{
|
||||
char *new = malloc (n + 1);
|
||||
size_t len = strnlen (s, n);
|
||||
char *new = malloc (len + 1);
|
||||
|
||||
if (new == NULL)
|
||||
return NULL;
|
||||
|
||||
new[n] = '\0';
|
||||
return (char *) memcpy (new, s, n);
|
||||
new[len] = '\0';
|
||||
return (char *) memcpy (new, s, len);
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (__strndup, strndup)
|
||||
#endif
|
||||
|
||||
40
lib/strnlen.c
Normal file
40
lib/strnlen.c
Normal file
@@ -0,0 +1,40 @@
|
||||
/* Find the length of STRING, but scan at most MAXLEN characters.
|
||||
Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#undef __strnlen
|
||||
#undef strnlen
|
||||
|
||||
#ifndef weak_alias
|
||||
# define __strnlen strnlen
|
||||
#endif
|
||||
|
||||
/* Find the length of STRING, but scan at most MAXLEN characters.
|
||||
If no '\0' terminator is found in that many characters, return MAXLEN. */
|
||||
|
||||
size_t
|
||||
__strnlen (const char *string, size_t maxlen)
|
||||
{
|
||||
const char *end = memchr (string, '\0', maxlen);
|
||||
return end ? end - string : maxlen;
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (__strnlen, strnlen)
|
||||
#endif
|
||||
200
lib/unicodeio.c
Normal file
200
lib/unicodeio.c
Normal file
@@ -0,0 +1,200 @@
|
||||
/* Unicode character output to streams with locale dependent encoding.
|
||||
|
||||
Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published
|
||||
by the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
/* Written by Bruno Haible <haible@clisp.cons.org>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_STDDEF_H
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#if HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#if HAVE_ICONV
|
||||
# include <iconv.h>
|
||||
#endif
|
||||
|
||||
#include <error.h>
|
||||
|
||||
#if ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
# define _(Text) gettext (Text)
|
||||
#else
|
||||
# define _(Text) Text
|
||||
#endif
|
||||
|
||||
#include "unicodeio.h"
|
||||
|
||||
/* When we pass a Unicode character to iconv(), we must pass it in a
|
||||
suitable encoding. The standardized Unicode encodings are
|
||||
UTF-8, UCS-2, UCS-4, UTF-16, UTF-16BE, UTF-16LE, UTF-7.
|
||||
UCS-2 supports only characters up to \U0000FFFF.
|
||||
UTF-16 and variants support only characters up to \U0010FFFF.
|
||||
UTF-7 is way too complex and not supported by glibc-2.1.
|
||||
UCS-4 specification leaves doubts about endianness and byte order
|
||||
mark. glibc currently interprets it as big endian without byte order
|
||||
mark, but this is not backed by an RFC.
|
||||
So we use UTF-8. It supports characters up to \U7FFFFFFF and is
|
||||
unambiguously defined. */
|
||||
|
||||
/* Stores the UTF-8 representation of the Unicode character wc in r[0..5].
|
||||
Returns the number of bytes stored, or -1 if wc is out of range. */
|
||||
static int
|
||||
utf8_wctomb (unsigned char *r, unsigned int wc)
|
||||
{
|
||||
int count;
|
||||
|
||||
if (wc < 0x80)
|
||||
count = 1;
|
||||
else if (wc < 0x800)
|
||||
count = 2;
|
||||
else if (wc < 0x10000)
|
||||
count = 3;
|
||||
else if (wc < 0x200000)
|
||||
count = 4;
|
||||
else if (wc < 0x4000000)
|
||||
count = 5;
|
||||
else if (wc <= 0x7fffffff)
|
||||
count = 6;
|
||||
else
|
||||
return -1;
|
||||
|
||||
switch (count)
|
||||
{
|
||||
/* Note: code falls through cases! */
|
||||
case 6: r[5] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x4000000;
|
||||
case 5: r[4] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x200000;
|
||||
case 4: r[3] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x10000;
|
||||
case 3: r[2] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x800;
|
||||
case 2: r[1] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0xc0;
|
||||
case 1: r[0] = wc;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/* Luckily, the encoding's name is platform independent. */
|
||||
#define UTF8_NAME "UTF-8"
|
||||
|
||||
/* Outputs the Unicode character CODE to the output stream STREAM.
|
||||
Assumes that the locale doesn't change between two calls. */
|
||||
void
|
||||
print_unicode_char (FILE *stream, unsigned int code)
|
||||
{
|
||||
static int initialized;
|
||||
static int is_utf8;
|
||||
#if HAVE_ICONV
|
||||
static iconv_t utf8_to_local;
|
||||
#endif
|
||||
|
||||
char inbuf[6];
|
||||
int count;
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
extern const char *locale_charset (void);
|
||||
const char *charset = locale_charset ();
|
||||
|
||||
is_utf8 = (charset != NULL && !strcmp (charset, UTF8_NAME));
|
||||
#if HAVE_ICONV
|
||||
if (!is_utf8)
|
||||
{
|
||||
utf8_to_local = (charset != NULL
|
||||
? iconv_open (charset, UTF8_NAME)
|
||||
: (iconv_t)(-1));
|
||||
if (utf8_to_local == (iconv_t)(-1))
|
||||
{
|
||||
/* For an unknown encoding, assume ASCII. */
|
||||
utf8_to_local = iconv_open ("ASCII", UTF8_NAME);
|
||||
if (utf8_to_local == (iconv_t)(-1))
|
||||
error (1, 0,
|
||||
_("cannot output U+%04X: iconv function not usable"),
|
||||
code);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
initialized = 1;
|
||||
}
|
||||
|
||||
/* Convert the character to UTF-8. */
|
||||
count = utf8_wctomb ((unsigned char *) inbuf, code);
|
||||
if (count < 0)
|
||||
error (1, 0, _("U+%04X: character out of range"), code);
|
||||
|
||||
if (is_utf8)
|
||||
{
|
||||
fwrite (inbuf, 1, count, stream);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if HAVE_ICONV
|
||||
char outbuf[25];
|
||||
const char *inptr;
|
||||
size_t inbytesleft;
|
||||
char *outptr;
|
||||
size_t outbytesleft;
|
||||
size_t res;
|
||||
|
||||
inptr = inbuf;
|
||||
inbytesleft = count;
|
||||
outptr = outbuf;
|
||||
outbytesleft = sizeof (outbuf);
|
||||
|
||||
/* Convert the character from UTF-8 to the locale's charset. */
|
||||
res = iconv (utf8_to_local, &inptr, &inbytesleft, &outptr, &outbytesleft);
|
||||
if (inbytesleft > 0 || res == (size_t)(-1)
|
||||
/* Irix iconv() inserts a NUL byte if it cannot convert. */
|
||||
# if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi)
|
||||
|| (res > 0 && code != 0 && outptr - outbuf == 1 && *outbuf == '\0')
|
||||
# endif
|
||||
)
|
||||
error (1, res == (size_t)(-1) ? errno : 0,
|
||||
_("cannot convert U+%04X to local character set"), code);
|
||||
|
||||
/* Avoid glibc-2.1 bug and Solaris 2.7 bug. */
|
||||
# if defined _LIBICONV_VERSION \
|
||||
|| !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
|
||||
|
||||
/* Get back to the initial shift state. */
|
||||
res = iconv (utf8_to_local, NULL, NULL, &outptr, &outbytesleft);
|
||||
if (res == (size_t)(-1))
|
||||
error (1, errno, _("cannot convert U+%04X to local character set"),
|
||||
code);
|
||||
# endif
|
||||
|
||||
fwrite (outbuf, 1, outptr - outbuf, stream);
|
||||
#else
|
||||
error (1, 0, _("cannot output U+%04X: iconv function not available"),
|
||||
code);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
17
lib/unicodeio.h
Normal file
17
lib/unicodeio.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef UNICODEIO_H
|
||||
# define UNICODEIO_H
|
||||
|
||||
# include <stdio.h>
|
||||
|
||||
# ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* Outputs the Unicode character CODE to the output stream STREAM. */
|
||||
extern void print_unicode_char PARAMS((FILE *stream, unsigned int code));
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Utility to help print --version output in a consistent format.
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -35,7 +35,7 @@
|
||||
/* Default copyright goes to the FSF. */
|
||||
|
||||
char* version_etc_copyright =
|
||||
N_("Copyright (C) 1999 Free Software Foundation, Inc.");
|
||||
N_("Copyright (C) 2000 Free Software Foundation, Inc.");
|
||||
|
||||
|
||||
/* Display the --version information the standard way.
|
||||
|
||||
177
m4/ChangeLog
177
m4/ChangeLog
@@ -1,3 +1,170 @@
|
||||
2000-05-20 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* prereq.m4 (jm_PREREQ_HUMAN): New macro.
|
||||
(jm_PREREQ): Use it.
|
||||
|
||||
2000-05-09 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* gettext.m4: Rename this...
|
||||
* libintl.m4: ...to this.
|
||||
|
||||
2000-05-06 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* jm-macros.m4 (AC_REPLACE_FUNCS): Add atexit.
|
||||
(AC_REPLACE_FUNCS): Add strnlen.
|
||||
|
||||
* rmdir-errno.m4 (fetish_FUNC_RMDIR_NOTEMPTY): New macro and file.
|
||||
* jm-macros.m4: Require fetish_FUNC_RMDIR_NOTEMPTY.
|
||||
|
||||
* nanosleep.m4: (jm_FUNC_NANOSLEEP): Save and restore LIBS around
|
||||
AC_SEARCH_LIBS call for nanosleep.
|
||||
(LIB_NANOSLEEP): Set and AC_SUBST.
|
||||
|
||||
2000-05-03 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* largefile.m4 (AC_SYS_LARGEFILE): Define _XOPEN_SOURCE to
|
||||
be 500, instead of _GNU_SOURCE to be 1, to work around glibc
|
||||
2.1.3 bug. This avoids a clash when files like regex.c define
|
||||
_GNU_SOURCE.
|
||||
|
||||
2000-05-05 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* jm-macros.m4 (jm_MACROS): Save and restore LIBS around AC_SEARCH_LIBS
|
||||
call for clock_gettime.
|
||||
(LIB_CLOCK_GETTIME): Set and AC_SUBST.
|
||||
|
||||
* search-libs.m4: Update from autoconf.
|
||||
|
||||
su doesn't work on Solaris2.6.
|
||||
* lib-check.m4: When checking for struct spwd.sp_pwdp, also include
|
||||
<shadow.h>. Reported by Dragos Harabor.
|
||||
|
||||
2000-05-03 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* check-decl.m4 (AC_CHECK_DECLS): Add strndup.
|
||||
|
||||
2000-05-02 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* largefile.m4 (AC_SYS_LARGEFILE): Define _GNU_SOURCE if
|
||||
this is needed to make ftello visible (e.g. glibc 2.1.3). Use
|
||||
compile-time test, rather than inspecting host and OS, to
|
||||
decide whether to define _LARGEFILE_SOURCE.
|
||||
|
||||
2000-05-01 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* fsusage.m4: Use AC_MSG_CHECKING instead of obsolete AC_CHECKING.
|
||||
|
||||
* ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS): Add BeOS support.
|
||||
Based on a patch from Bruno Haible.
|
||||
|
||||
2000-04-18 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* prereq.m4 (jm_PREREQ_GETPAGESIZE): New macro.
|
||||
(jm_PREREQ): Use it.
|
||||
|
||||
2000-04-17 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Get it right :-)
|
||||
* jm-macros.m4: (jm_CHECK_ALL_TYPES) [_GNU_SOURCE]: Emit the
|
||||
actual #define via AH_VERBATIM. Don't need separate AC_DEFINE.
|
||||
Suggestion from Akim Demaille.
|
||||
|
||||
2000-04-14 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* jm-macros.m4: (jm_CHECK_ALL_TYPES) [_GNU_SOURCE]: Use the one-arg form
|
||||
of AC_DEFINE. Otherwise, the #ifndef in AH_VERBATIM gets clobbered.
|
||||
|
||||
2000-04-13 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* jm-macros.m4 (jm_CHECK_ALL_TYPES) [_GNU_SOURCE]: Use new AH_VERBATIM
|
||||
to insert required #ifndef into config.h.in.
|
||||
Suggestion from Akim Demaille.
|
||||
|
||||
2000-04-12 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* getloadavg.m4 (AM_FUNC_GETLOADAVG): Use AC_CHECK_HEADERS, not
|
||||
`AC_CHECK_HEADER' to check for locale.h. Thanks to a report from
|
||||
Christian Krackowizer.
|
||||
|
||||
More code moved from ../configure.in into (jm_CHECK_ALL_TYPES).
|
||||
* jm-macros.m4 (_GNU_SOURCE): Define.
|
||||
(AC_SYS_LARGEFILE): Require.
|
||||
(AM_C_PROTOTYPES): Require.
|
||||
|
||||
2000-04-05 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Don't use -n32 on
|
||||
IRIX if the installer said otherwise.
|
||||
|
||||
2000-04-05 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Portability tweaks required for ultrix4.3.
|
||||
* check-decl.m4 [!HAVE_UTMPX_H] (headers): Include <utmp.h>.
|
||||
(jm_CHECK_DECLS): Add getutent to the list of functions.
|
||||
(_jm_DECL_HEADERS): Add utmpx.h.
|
||||
From John David Anglin.
|
||||
|
||||
* strftime.m4: Back out the 2000-04-02 change.
|
||||
Instead of that change, simply undefine putenv in the test program.
|
||||
|
||||
2000-04-03 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* gettext.m4: Fix typo in comment.
|
||||
|
||||
* codeset.m4 (AC_CHECK_HEADERS): Add langinfo.h (moved here from
|
||||
textutils/configure.in). Suggestion from Paul Eggert.
|
||||
(AC_CHECK_FUNCS): Add nl_langinfo. (also from textutils/configure.in)
|
||||
|
||||
2000-04-02 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* strftime.m4 (jm_FUNC_GNU_STRFTIME): Set TZ environment
|
||||
variable in the shell rather than using putenv, which isn't
|
||||
portable. This avoids the configure-time inter-test dependency
|
||||
on the potentially-renamed putenv function.
|
||||
|
||||
2000-03-30 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* jm-macros.m4 (jm_CHECK_ALL_TYPES): Include <sys/stat.h>
|
||||
before checking struct stat.st_blksize, so that
|
||||
HAVE_STRUCT_STAT_ST_BLKSIZE is defined correctly.
|
||||
|
||||
2000-03-29 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* strftime.m4 (_jm_STRFTIME_PREREQS): Check for strftime,
|
||||
since strftime.c uses HAVE_STRFTIME to decide whether to use
|
||||
the underlying strftime.
|
||||
|
||||
2000-03-10 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* lib-check.m4: Look for getspnam in -lgen, too.
|
||||
From Marco Franzen.
|
||||
|
||||
2000-02-02 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* codeset.m4: New file.
|
||||
* iconv.m4: New file.
|
||||
* jm-macros.m4 (jm_MACROS): Call jm_LANGINFO_CODESET and jm_ICONV.
|
||||
|
||||
2000-03-04 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* jm-macros.m4 (jm_CHECK_ALL_TYPES): Require AC_C_VOLATILE,
|
||||
for lib/localcharset.c.
|
||||
|
||||
2000-03-03 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* regex.m4: Make sure re_compile_pattern accepts patterns like `{1'.
|
||||
|
||||
2000-03-02 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* timespec.m4: Require AC_HEADER_TIME before the cache check so
|
||||
the messages come out on separate lines.
|
||||
|
||||
* jm-glibc-io.m4 (jm_FUNC_GLIBC_UNLOCKED_IO): Use AC_CHECK_DECLS,
|
||||
rather than jm_CHECK_DECLARATIONS.
|
||||
* decl.m4: Remove now-unused file.
|
||||
|
||||
* check-decl.m4 (AC_CHECK_DECLS): Add getlogin, ttyname, and geteuid.
|
||||
|
||||
2000-02-27 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* check-decl.m4: Add getenv to the list.
|
||||
@@ -170,13 +337,13 @@
|
||||
2000-01-11 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
Quote multibyte characters correctly.
|
||||
* m4/c-bs-a.m4: New file.
|
||||
* m4/prereq.m4 (jm_PREREQ_QUOTEARG): New macro.
|
||||
* c-bs-a.m4: New file.
|
||||
* prereq.m4 (jm_PREREQ_QUOTEARG): New macro.
|
||||
(jm_PREREQ): Use it.
|
||||
|
||||
2000-01-11 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* m4/uintmax_t.m4: Port to autoconf 2.13.
|
||||
* uintmax_t.m4: Port to autoconf 2.13.
|
||||
|
||||
2000-01-08 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
@@ -239,7 +406,7 @@
|
||||
|
||||
1999-11-18 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a
|
||||
* largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a
|
||||
problem with the QNX 4.25 shell, which doesn't propagate exit
|
||||
status of failed commands inside shell assignments.
|
||||
|
||||
@@ -312,7 +479,7 @@
|
||||
|
||||
1999-08-17 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* m4/largefile.m4 (AC_SYS_LARGEFILE): Fix typo: missing comma
|
||||
* largefile.m4 (AC_SYS_LARGEFILE): Fix typo: missing comma
|
||||
in value for _FILE_OFFSET_BITS, which broke ports to HP-UX 10.20.
|
||||
|
||||
1999-08-05 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
@@ -8,9 +8,9 @@ bison.m4 \
|
||||
c-bs-a.m4 \
|
||||
check-decl.m4 \
|
||||
chown.m4 \
|
||||
codeset.m4 \
|
||||
d-ino.m4 \
|
||||
d-type.m4 \
|
||||
decl.m4 \
|
||||
error.m4 \
|
||||
fnmatch.m4 \
|
||||
fstypename.m4 \
|
||||
@@ -19,9 +19,9 @@ ftruncate.m4 \
|
||||
getgroups.m4 \
|
||||
getline.m4 \
|
||||
getloadavg.m4 \
|
||||
gettext.m4 \
|
||||
glibc.m4 \
|
||||
group-member.m4 \
|
||||
iconv.m4 \
|
||||
inttypes_h.m4 \
|
||||
isc-posix.m4 \
|
||||
jm-glibc-io.m4 \
|
||||
@@ -33,6 +33,7 @@ largefile.m4 \
|
||||
lchown.m4 \
|
||||
lcmessage.m4 \
|
||||
lib-check.m4 \
|
||||
libintl.m4 \
|
||||
link-follow.m4 \
|
||||
ls-mntd-fs.m4 \
|
||||
lstat-slash.m4 \
|
||||
@@ -47,6 +48,7 @@ putenv.m4 \
|
||||
readdir.m4 \
|
||||
realloc.m4 \
|
||||
regex.m4 \
|
||||
rmdir-errno.m4 \
|
||||
search-libs.m4 \
|
||||
st_dm_mode.m4 \
|
||||
st_mtim.m4 \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Makefile.in generated automatically by automake 1.4a from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
@@ -31,8 +31,6 @@ mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
@@ -57,6 +55,8 @@ POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
|
||||
@SET_MAKE@
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AMDEP = @AMDEP@
|
||||
@@ -86,8 +86,11 @@ INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
KMEM_GROUP = @KMEM_GROUP@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
|
||||
LIB_CRYPT = @LIB_CRYPT@
|
||||
LIB_NANOSLEEP = @LIB_NANOSLEEP@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MAN = @MAN@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
@@ -118,9 +121,9 @@ bison.m4 \
|
||||
c-bs-a.m4 \
|
||||
check-decl.m4 \
|
||||
chown.m4 \
|
||||
codeset.m4 \
|
||||
d-ino.m4 \
|
||||
d-type.m4 \
|
||||
decl.m4 \
|
||||
error.m4 \
|
||||
fnmatch.m4 \
|
||||
fstypename.m4 \
|
||||
@@ -129,9 +132,9 @@ ftruncate.m4 \
|
||||
getgroups.m4 \
|
||||
getline.m4 \
|
||||
getloadavg.m4 \
|
||||
gettext.m4 \
|
||||
glibc.m4 \
|
||||
group-member.m4 \
|
||||
iconv.m4 \
|
||||
inttypes_h.m4 \
|
||||
isc-posix.m4 \
|
||||
jm-glibc-io.m4 \
|
||||
@@ -143,6 +146,7 @@ largefile.m4 \
|
||||
lchown.m4 \
|
||||
lcmessage.m4 \
|
||||
lib-check.m4 \
|
||||
libintl.m4 \
|
||||
link-follow.m4 \
|
||||
ls-mntd-fs.m4 \
|
||||
lstat-slash.m4 \
|
||||
@@ -157,6 +161,7 @@ putenv.m4 \
|
||||
readdir.m4 \
|
||||
realloc.m4 \
|
||||
regex.m4 \
|
||||
rmdir-errno.m4 \
|
||||
search-libs.m4 \
|
||||
st_dm_mode.m4 \
|
||||
st_mtim.m4 \
|
||||
@@ -188,7 +193,7 @@ all: all-redirect
|
||||
$(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
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@@ -202,11 +207,12 @@ distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pR $$d/$$file $(distdir); \
|
||||
cp -pR $$d/$$file $(distdir) \
|
||||
|| exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
The files in this directory are shared between the fileutils, sh-utils,
|
||||
and textutils packages.
|
||||
|
||||
These files are used by a program called aclocal (part of the GNU automake
|
||||
package). aclocal uses these files to create aclocal.m4 which is in turn
|
||||
used by autoconf to create the configure script at the the top level in
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#serial 1
|
||||
#serial 2
|
||||
|
||||
AC_DEFUN(jm_AFS,
|
||||
AC_CHECKING(for AFS)
|
||||
AC_MSG_CHECKING(for AFS)
|
||||
test -d /afs \
|
||||
&& AC_DEFINE(AFS, 1, [Define if you have the Andrew File System.])
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 8
|
||||
#serial 11
|
||||
|
||||
dnl This is just a wrapper function to encapsulate this kludge.
|
||||
dnl Putting it in a separate file like this helps share it between
|
||||
@@ -37,11 +37,29 @@ AC_DEFUN(jm_CHECK_DECLS,
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !HAVE_UTMPX_H
|
||||
# include <utmp.h>
|
||||
#endif
|
||||
'
|
||||
|
||||
AC_CHECK_DECLS((free, getenv, lseek, malloc, memchr, nanosleep,
|
||||
realloc, stpcpy, strstr, strtoul, strtoull),
|
||||
, , $headers)
|
||||
AC_CHECK_DECLS((
|
||||
free,
|
||||
getenv,
|
||||
geteuid,
|
||||
getlogin,
|
||||
getutent,
|
||||
lseek,
|
||||
malloc,
|
||||
memchr,
|
||||
nanosleep,
|
||||
realloc,
|
||||
stpcpy,
|
||||
strndup,
|
||||
strstr,
|
||||
strtoul,
|
||||
strtoull,
|
||||
ttyname), , , $headers)
|
||||
])
|
||||
|
||||
dnl FIXME: when autoconf has support for it.
|
||||
@@ -49,5 +67,6 @@ dnl This is a little helper so we can require these header checks.
|
||||
AC_DEFUN(_jm_DECL_HEADERS,
|
||||
[
|
||||
AC_REQUIRE([AC_HEADER_STDC])
|
||||
AC_CHECK_HEADERS(memory.h string.h strings.h stdlib.h unistd.h sys/time.h)
|
||||
AC_CHECK_HEADERS(memory.h string.h strings.h stdlib.h unistd.h sys/time.h \
|
||||
utmpx.h)
|
||||
])
|
||||
|
||||
20
m4/codeset.m4
Normal file
20
m4/codeset.m4
Normal file
@@ -0,0 +1,20 @@
|
||||
#serial 2
|
||||
|
||||
dnl From Bruno Haible.
|
||||
|
||||
AC_DEFUN(jm_LANGINFO_CODESET,
|
||||
[
|
||||
AC_CHECK_HEADERS(langinfo.h)
|
||||
AC_CHECK_FUNCS(nl_langinfo)
|
||||
|
||||
AC_CACHE_CHECK([for nl_langinfo and CODESET], jm_cv_langinfo_codeset,
|
||||
[AC_TRY_LINK([#include <langinfo.h>],
|
||||
[char* cs = nl_langinfo(CODESET);],
|
||||
jm_cv_langinfo_codeset=yes,
|
||||
jm_cv_langinfo_codeset=no)
|
||||
])
|
||||
if test $jm_cv_langinfo_codeset = yes; then
|
||||
AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
|
||||
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
|
||||
fi
|
||||
])
|
||||
37
m4/decl.m4
37
m4/decl.m4
@@ -1,37 +0,0 @@
|
||||
#serial 5
|
||||
|
||||
AC_DEFUN(jm_CHECK_DECLARATION,
|
||||
[
|
||||
AC_MSG_CHECKING([whether $1 is declared])
|
||||
AC_CACHE_VAL(jm_cv_func_decl_$1,
|
||||
[AC_TRY_COMPILE($2,
|
||||
[
|
||||
#ifndef $1
|
||||
char *(*pfn) = (char *(*)) $1
|
||||
#endif
|
||||
],
|
||||
eval "jm_cv_func_decl_$1=yes",
|
||||
eval "jm_cv_func_decl_$1=no")])
|
||||
|
||||
if eval "test \"`echo '$jm_cv_func_decl_'$1`\" = yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$3], , :, [$3])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
ifelse([$4], , , [$4
|
||||
])dnl
|
||||
fi
|
||||
])dnl
|
||||
|
||||
dnl jm_CHECK_DECLARATIONS(INCLUDES, FUNCTION... [, ACTION-IF-DECLARED
|
||||
dnl [, ACTION-IF-NOT-DECLARED]])
|
||||
AC_DEFUN(jm_CHECK_DECLARATIONS,
|
||||
[
|
||||
for jm_func in $2
|
||||
do
|
||||
jm_CHECK_DECLARATION($jm_func, $1,
|
||||
[
|
||||
jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
|
||||
AC_DEFINE_UNQUOTED($jm_tr_func) $3], $4)dnl
|
||||
done
|
||||
])
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 1
|
||||
#serial 2
|
||||
|
||||
# From fileutils/configure.in
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
AC_DEFUN(jm_FILE_SYSTEM_USAGE,
|
||||
[
|
||||
|
||||
AC_CHECKING(how to get filesystem space usage)
|
||||
AC_MSG_CHECKING(how to get filesystem space usage)
|
||||
ac_fsusage_space=no
|
||||
|
||||
# Perform only the link test since it seems there are no variants of the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 5
|
||||
#serial 6
|
||||
|
||||
AC_DEFUN(AM_FUNC_GETLOADAVG,
|
||||
[ac_have_func=no # yes means we've found a way to get the load average.
|
||||
@@ -47,7 +47,7 @@ else
|
||||
[ac_have_func=yes; AC_DEFINE(DGUX, 1, [FIXME])
|
||||
AC_CHECK_LIB(dgc, dg_sys_info)])
|
||||
|
||||
AC_CHECK_HEADER(locale.h)
|
||||
AC_CHECK_HEADERS(locale.h)
|
||||
AC_CHECK_FUNCS(setlocale)
|
||||
|
||||
# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
|
||||
|
||||
39
m4/iconv.m4
Normal file
39
m4/iconv.m4
Normal file
@@ -0,0 +1,39 @@
|
||||
#serial 1
|
||||
|
||||
dnl From Bruno Haible.
|
||||
|
||||
AC_DEFUN(jm_ICONV,
|
||||
[
|
||||
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
|
||||
dnl those with the standalone portable libiconv installed).
|
||||
AC_CACHE_CHECK(for iconv, jm_cv_func_iconv, [
|
||||
jm_cv_func_iconv="no, consider installing libiconv"
|
||||
jm_cv_lib_iconv=no
|
||||
AC_TRY_LINK([#include <stdlib.h>
|
||||
#include <iconv.h>],
|
||||
[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);],
|
||||
jm_cv_func_iconv=yes)
|
||||
if test "$jm_cv_func_iconv" != yes; then
|
||||
jm_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -liconv"
|
||||
AC_TRY_LINK([#include <stdlib.h>
|
||||
#include <iconv.h>],
|
||||
[iconv_t cd = iconv_open("","");
|
||||
iconv(cd,NULL,NULL,NULL,NULL);
|
||||
iconv_close(cd);],
|
||||
jm_cv_lib_iconv=yes
|
||||
jm_cv_func_iconv=yes)
|
||||
LIBS="$jm_save_LIBS"
|
||||
fi
|
||||
])
|
||||
if test "$jm_cv_func_iconv" = yes; then
|
||||
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
|
||||
fi
|
||||
LIBICONV=
|
||||
if test "$jm_cv_lib_iconv" = yes; then
|
||||
LIBICONV="-liconv"
|
||||
fi
|
||||
AC_SUBST(LIBICONV)
|
||||
])
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 2
|
||||
#serial 3
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl
|
||||
@@ -16,10 +16,10 @@ AC_DEFUN(jm_FUNC_GLIBC_UNLOCKED_IO,
|
||||
# Otherwise, we'd get the Solaris5.5.1 functions that are not
|
||||
# declared, and that have been removed from Solaris5.6. The resulting
|
||||
# 5.5.1 binaries would not run on 5.6 due to shared library differences.
|
||||
jm_CHECK_DECLARATIONS([#include <stdio.h>
|
||||
], $jm_io_func,
|
||||
jm_declared=yes,
|
||||
jm_declared=no)
|
||||
AC_CHECK_DECLS(($jm_io_func),
|
||||
jm_declared=yes,
|
||||
jm_declared=no,
|
||||
[#include <stdio.h>])
|
||||
if test $jm_declared = yes; then
|
||||
AC_CHECK_FUNCS($jm_io_func)
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 13
|
||||
#serial 17
|
||||
|
||||
dnl Misc type-related macros for fileutils, sh-utils, textutils.
|
||||
|
||||
@@ -31,6 +31,7 @@ AC_DEFUN(jm_MACROS,
|
||||
netdb.h \
|
||||
paths.h \
|
||||
stdlib.h \
|
||||
stddef.h \
|
||||
string.h \
|
||||
sys/acl.h \
|
||||
sys/filsys.h \
|
||||
@@ -69,6 +70,7 @@ AC_DEFUN(jm_MACROS,
|
||||
AC_REQUIRE([jm_PREREQ])
|
||||
|
||||
AC_REQUIRE([jm_FUNC_LCHOWN])
|
||||
AC_REQUIRE([fetish_FUNC_RMDIR_NOTEMPTY])
|
||||
AC_REQUIRE([jm_FUNC_CHOWN])
|
||||
AC_REQUIRE([jm_FUNC_MKTIME])
|
||||
AC_REQUIRE([jm_FUNC_LSTAT])
|
||||
@@ -106,6 +108,8 @@ AC_DEFUN(jm_MACROS,
|
||||
AC_REPLACE_FUNCS(stime strcspn stpcpy strstr strtol strtoul)
|
||||
AC_REPLACE_FUNCS(strpbrk)
|
||||
AC_REPLACE_FUNCS(euidaccess memcmp mkdir rmdir rpmatch strndup strverscmp)
|
||||
AC_REPLACE_FUNCS(atexit)
|
||||
AC_REPLACE_FUNCS(strnlen)
|
||||
|
||||
dnl used by e.g. intl/*domain.c and lib/canon-host.c
|
||||
AC_REPLACE_FUNCS(strdup)
|
||||
@@ -127,8 +131,16 @@ AC_DEFUN(jm_MACROS,
|
||||
# used by sleep and shred
|
||||
# Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
|
||||
# Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
|
||||
AC_SEARCH_LIBS(clock_gettime, [rt posix4])
|
||||
AC_CHECK_FUNCS(clock_gettime)
|
||||
|
||||
# Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
|
||||
# programs in the package would end up linked with that potentially-shared
|
||||
# library, inducing unnecessary run-time overhead.
|
||||
fetish_saved_libs=$LIBS
|
||||
AC_SEARCH_LIBS(clock_gettime, [rt posix4],
|
||||
[LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
|
||||
AC_SUBST(LIB_CLOCK_GETTIME)
|
||||
AC_CHECK_FUNCS(clock_gettime)
|
||||
LIBS=$fetish_saved_libs
|
||||
AC_CHECK_FUNCS(gettimeofday)
|
||||
|
||||
AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
|
||||
@@ -175,6 +187,10 @@ AC_DEFUN(jm_MACROS,
|
||||
AC_SUBST(POW_LIBM)
|
||||
test $am_cv_func_strtod_needs_libm = yes && POW_LIBM=-lm
|
||||
|
||||
jm_LANGINFO_CODESET
|
||||
|
||||
jm_ICONV
|
||||
|
||||
# These tests are for df.
|
||||
jm_LIST_MOUNTED_FILESYSTEMS([list_mounted_fs=yes], [list_mounted_fs=no])
|
||||
jm_FSTYPENAME
|
||||
@@ -187,18 +203,38 @@ AC_DEFUN(jm_MACROS,
|
||||
|
||||
])
|
||||
|
||||
# This macro must be invoked before any tests that run the compiler.
|
||||
AC_DEFUN(jm_CHECK_ALL_TYPES,
|
||||
[
|
||||
# Emit this code into config.h.in.
|
||||
# The ifndef is to avoid redefinition warnings.
|
||||
AH_VERBATIM([_GNU_SOURCE], [#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE
|
||||
#endif])
|
||||
|
||||
dnl This test must come as early as possible after the compiler configuration
|
||||
dnl tests, because the choice of the file model can (in principle) affect
|
||||
dnl whether functions and headers are available, whether they work, etc.
|
||||
AC_REQUIRE([AC_SYS_LARGEFILE])
|
||||
|
||||
dnl This test must precede tests of compiler characteristics like
|
||||
dnl that for the inline keyword, since it may change the degree to
|
||||
dnl which the compiler supports such features.
|
||||
AC_REQUIRE([AM_C_PROTOTYPES])
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_REQUIRE([AC_C_BIGENDIAN])
|
||||
AC_REQUIRE([AC_PROG_CC_STDC])
|
||||
AC_REQUIRE([AC_C_CONST])
|
||||
AC_REQUIRE([AC_C_VOLATILE])
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
AC_REQUIRE([AC_C_LONG_DOUBLE])
|
||||
|
||||
AC_REQUIRE([AC_HEADER_DIRENT])
|
||||
AC_REQUIRE([AC_HEADER_STDC])
|
||||
AC_CHECK_MEMBERS((struct stat.st_blksize))
|
||||
AC_CHECK_MEMBERS((struct stat.st_blksize),,,[$ac_includes_default
|
||||
#include <sys/stat.h>
|
||||
])
|
||||
AC_REQUIRE([AC_STRUCT_ST_BLOCKS])
|
||||
|
||||
AC_REQUIRE([AC_STRUCT_TM])
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 8
|
||||
#serial 11
|
||||
|
||||
dnl By default, many hosts won't let programs access large files;
|
||||
dnl one must use special compiler options to get large-file access to work.
|
||||
@@ -25,10 +25,14 @@ AC_DEFUN(AC_SYS_LARGEFILE_FLAGS,
|
||||
ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__
|
||||
fi
|
||||
;;
|
||||
# IRIX 6.2 and later require cc -n32.
|
||||
# IRIX 6.2 and later do not support large files by default,
|
||||
# so use the -n32 ABI unless the installer said otherwise.
|
||||
[ irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)]
|
||||
if test "$GCC" != yes; then
|
||||
ac_cv_sys_largefile_CFLAGS=-n32
|
||||
case "$CC $CFLAGS " in
|
||||
*' -o32 '*|*' -n32 '*|*' -64 '*) ;;
|
||||
*) ac_cv_sys_largefile_CFLAGS=-n32 ;;
|
||||
esac
|
||||
fi
|
||||
esac
|
||||
if test "$ac_cv_sys_largefile_CFLAGS" != no; then
|
||||
@@ -105,12 +109,11 @@ AC_DEFUN(AC_SYS_LARGEFILE,
|
||||
esac])
|
||||
AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
|
||||
ac_cv_sys_largefile_source,
|
||||
[Define to make fseeko etc. visible, on some hosts.],
|
||||
[case "$host_os" in
|
||||
# HP-UX 10.20 and later
|
||||
[ hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)]
|
||||
ac_cv_sys_largefile_source=1 ;;
|
||||
esac])
|
||||
[Define to make ftello visible on some hosts (e.g. HP-UX 10.20).],
|
||||
[AC_TRY_COMPILE([#include <stdio.h>], [return !ftello;], ,
|
||||
[AC_TRY_COMPILE([#define _LARGEFILE_SOURCE 1
|
||||
#include <stdio.h>], [return !ftello;],
|
||||
ac_cv_sys_largefile_source=1)])])
|
||||
AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
|
||||
ac_cv_sys_large_files,
|
||||
[Define for large files, on AIX-style hosts.],
|
||||
@@ -119,5 +122,13 @@ AC_DEFUN(AC_SYS_LARGEFILE,
|
||||
[ aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)]
|
||||
ac_cv_sys_large_files=1 ;;
|
||||
esac])
|
||||
AC_SYS_LARGEFILE_MACRO_VALUE(_XOPEN_SOURCE,
|
||||
ac_cv_sys_xopen_source,
|
||||
[Define to make ftello visible on some hosts (e.g. glibc 2.1.3).],
|
||||
[AC_TRY_COMPILE([#include <stdio.h>], [return !ftello;], ,
|
||||
[AC_TRY_COMPILE([#define _XOPEN_SOURCE 500
|
||||
#include <stdio.h>],
|
||||
[return !ftello;],
|
||||
ac_cv_sys_xopen_source=500)])])
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 2
|
||||
#serial 3
|
||||
|
||||
dnl Misc lib-related macros for fileutils, sh-utils, textutils.
|
||||
|
||||
@@ -39,13 +39,20 @@ AC_DEFUN(jm_LIB_CHECK,
|
||||
AC_SEARCH_LIBS(yp_match, [sun ypsec])
|
||||
|
||||
# SysV needs -lsec, older versions of Linux need -lshadow for
|
||||
# shadow passwords.
|
||||
AC_SEARCH_LIBS(getspnam, [shadow sec])
|
||||
# shadow passwords. UnixWare 7 needs -lgen.
|
||||
AC_SEARCH_LIBS(getspnam, [shadow sec gen])
|
||||
|
||||
AC_CHECK_HEADERS(shadow.h)
|
||||
|
||||
# Requirements for su.c.
|
||||
AC_CHECK_MEMBERS((struct spwd.sp_pwdp))
|
||||
shadow_includes="\
|
||||
$ac_includes_default
|
||||
#if HAVE_SHADOW_H
|
||||
# include <shadow.h>
|
||||
#endif
|
||||
"
|
||||
AC_CHECK_MEMBERS((struct spwd.sp_pwdp),,,[$shadow_includes])
|
||||
AC_CHECK_FUNCS(getspnam)
|
||||
AC_CHECK_HEADERS(shadow.h)
|
||||
|
||||
# SCO-ODT-3.0 is reported to need -lufc for crypt.
|
||||
# NetBSD needs -lcrypt for crypt.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
# serial 108
|
||||
# serial 109
|
||||
|
||||
AC_PREREQ(2.13) dnl Minimum Autoconf version required.
|
||||
|
||||
@@ -286,7 +286,7 @@ strdup __argz_count __argz_stringify __argz_next])
|
||||
|
||||
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
|
||||
dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
|
||||
dnl Try to locate is.
|
||||
dnl Try to locate it.
|
||||
MKINSTALLDIRS=
|
||||
if test -n "$ac_aux_dir"; then
|
||||
MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 3
|
||||
#serial 4
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl
|
||||
@@ -180,8 +180,6 @@ if test -z "$ac_list_mounted_fs"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# FIXME: add a test for netbsd-1.1 here
|
||||
|
||||
if test -z "$ac_list_mounted_fs"; then
|
||||
# Ultrix
|
||||
AC_MSG_CHECKING([for getmnt function])
|
||||
@@ -200,6 +198,27 @@ if test -z "$ac_list_mounted_fs"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$ac_list_mounted_fs"; then
|
||||
# BeOS
|
||||
AC_CHECK_FUNCS(next_dev fs_stat_dev)
|
||||
AC_CHECK_HEADERS(fs_info.h)
|
||||
AC_MSG_CHECKING([for BEOS mounted file system support functions])
|
||||
if test $ac_cv_header_fs_info_h = yes \
|
||||
&& test $ac_cv_func_next_dev = yes \
|
||||
&& test $ac_cv_func_fs_stat_dev = yes; then
|
||||
fu_result=yes
|
||||
else
|
||||
fu_result=no
|
||||
fi
|
||||
AC_MSG_RESULT($fu_result)
|
||||
if test $fu_result = yes; then
|
||||
ac_list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_NEXT_DEV, 1,
|
||||
[Define if there are functions named next_dev and fs_stat_dev for
|
||||
reading the list of mounted filesystems. (BeOS)])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$ac_list_mounted_fs"; then
|
||||
# SVR2
|
||||
AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 5
|
||||
#serial 6
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl Check for the nanosleep function.
|
||||
@@ -7,9 +7,12 @@ dnl
|
||||
|
||||
AC_DEFUN(jm_FUNC_NANOSLEEP,
|
||||
[
|
||||
nanosleep_save_libs=$LIBS
|
||||
|
||||
# Solaris 2.5.1 needs -lposix4 to get the nanosleep function.
|
||||
# Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
|
||||
AC_SEARCH_LIBS(nanosleep, [rt posix4])
|
||||
AC_SEARCH_LIBS(nanosleep, [rt posix4], [LIB_NANOSLEEP=$ac_cv_search_nanosleep])
|
||||
AC_SUBST(LIB_NANOSLEEP)
|
||||
|
||||
AC_CACHE_CHECK([whether nanosleep works],
|
||||
jm_cv_func_nanosleep_works,
|
||||
@@ -47,4 +50,6 @@ AC_DEFUN(jm_FUNC_NANOSLEEP,
|
||||
AC_DEFINE_UNQUOTED(nanosleep, rpl_nanosleep,
|
||||
[Define to rpl_nanosleep if the replacement function should be used.])
|
||||
fi
|
||||
|
||||
LIBS=$nanosleep_save_libs
|
||||
])
|
||||
|
||||
20
m4/prereq.m4
20
m4/prereq.m4
@@ -1,4 +1,4 @@
|
||||
#serial 5
|
||||
#serial 7
|
||||
|
||||
dnl These are the prerequisite macros for files in the lib/
|
||||
dnl directories of the fileutils, sh-utils, and textutils packages.
|
||||
@@ -8,6 +8,8 @@ AC_DEFUN(jm_PREREQ,
|
||||
jm_PREREQ_ADDEXT
|
||||
jm_PREREQ_CANON_HOST
|
||||
jm_PREREQ_ERROR
|
||||
jm_PREREQ_GETPAGESIZE
|
||||
jm_PREREQ_HUMAN
|
||||
jm_PREREQ_QUOTEARG
|
||||
jm_PREREQ_READUTMP
|
||||
jm_PREREQ_REGEX
|
||||
@@ -36,6 +38,22 @@ AC_DEFUN(jm_PREREQ_CANON_HOST,
|
||||
netinet/in.h arpa/inet.h)
|
||||
])
|
||||
|
||||
# If you use human.c, you need the following files:
|
||||
# uintmax_t.m4 inttypes_h.m4 ulonglong.m4
|
||||
AC_DEFUN(jm_PREREQ_HUMAN,
|
||||
[
|
||||
AC_CHECK_HEADERS(limits.h stdlib.h string.h)
|
||||
AC_CHECK_DECLS((getenv))
|
||||
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
|
||||
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
|
||||
])
|
||||
|
||||
AC_DEFUN(jm_PREREQ_GETPAGESIZE,
|
||||
[
|
||||
AC_CHECK_FUNCS(getpagesize)
|
||||
AC_CHECK_HEADERS(OS.h unistd.h)
|
||||
])
|
||||
|
||||
AC_DEFUN(jm_PREREQ_QUOTEARG,
|
||||
[
|
||||
AC_CHECK_FUNCS(isascii mbrtowc)
|
||||
|
||||
14
m4/regex.m4
14
m4/regex.m4
@@ -1,4 +1,4 @@
|
||||
#serial 6
|
||||
#serial 7
|
||||
|
||||
dnl Initially derived from code in GNU grep.
|
||||
dnl Mostly written by Jim Meyering.
|
||||
@@ -16,8 +16,8 @@ AC_DEFUN(jm_INCLUDED_REGEX,
|
||||
# However, if the system regex support is good enough that it passes the
|
||||
# the following run test, then default to *not* using the included regex.c.
|
||||
# If cross compiling, assume the test would fail and use the included
|
||||
# regex.c. The failing regular expression is from `Spencer ere test #75'
|
||||
# in grep-2.3.
|
||||
# regex.c. The first failing regular expression is from `Spencer ere
|
||||
# test #75' in grep-2.3.
|
||||
AC_CACHE_CHECK([for working re_compile_pattern],
|
||||
jm_cv_func_working_re_compile_pattern,
|
||||
AC_TRY_RUN(
|
||||
@@ -33,7 +33,13 @@ AC_DEFUN(jm_INCLUDED_REGEX,
|
||||
three right ones below. Otherwise autoconf-2.14 chokes. */
|
||||
s = re_compile_pattern ("a[[:]:]]b\n", 9, ®ex);
|
||||
/* This should fail with _Invalid character class name_ error. */
|
||||
exit (s ? 0 : 1);
|
||||
if (!s)
|
||||
exit (1);
|
||||
|
||||
/* This should succeed, but doesn't for e.g. glibc-2.1.3. */
|
||||
s = re_compile_pattern ("{1", 2, ®ex);
|
||||
|
||||
exit (s ? 1 : 0);
|
||||
}
|
||||
],
|
||||
jm_cv_func_working_re_compile_pattern=yes,
|
||||
|
||||
43
m4/rmdir-errno.m4
Normal file
43
m4/rmdir-errno.m4
Normal file
@@ -0,0 +1,43 @@
|
||||
#serial 1
|
||||
|
||||
# When rmdir fails because the specified directory is not empty, it sets
|
||||
# errno to some value, usually ENOTEMPTY. However, on some AIX systems,
|
||||
# ENOTEMPTY is mistakenly defined to be EEXIST. To work around this, and
|
||||
# in general, to avoid depending on the use of any particular symbol, this
|
||||
# test runs a test to determine the actual numeric value.
|
||||
AC_DEFUN(fetish_FUNC_RMDIR_NOTEMPTY,
|
||||
[dnl
|
||||
AC_CACHE_CHECK([for rmdir-not-empty errno value],
|
||||
fetish_cv_func_rmdir_errno_not_empty,
|
||||
[
|
||||
# Arrange for deletion of the temporary directory this test creates.
|
||||
ac_clean_files="$ac_clean_files confdir2"
|
||||
mkdir confdir2; : > confdir2/file
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
int main ()
|
||||
{
|
||||
FILE *s;
|
||||
int val;
|
||||
rmdir ("confdir2");
|
||||
val = errno;
|
||||
s = fopen ("confdir2/file", "w");
|
||||
fprintf (s, "%d\n", val);
|
||||
exit (0);
|
||||
}
|
||||
],
|
||||
fetish_cv_func_rmdir_errno_not_empty=`cat confdir2/file`,
|
||||
fetish_cv_func_rmdir_errno_not_empty='configure error in rmdir-errno.m4',
|
||||
fetish_cv_func_rmdir_errno_not_empty=ENOTEMPTY
|
||||
)
|
||||
]
|
||||
)
|
||||
|
||||
AC_DEFINE_UNQUOTED([RMDIR_ERRNO_NOT_EMPTY],
|
||||
$fetish_cv_func_rmdir_errno_not_empty,
|
||||
[the value to which errno is set when rmdir fails on a nonempty directory])
|
||||
])
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 3
|
||||
#serial 4
|
||||
|
||||
dnl A replacement for autoconf's macro by the same name. This version
|
||||
dnl uses `ac_lib' rather than `i' for the loop variable, but more importantly
|
||||
@@ -8,33 +8,31 @@ dnl the `none required' case.
|
||||
dnl I hope it's only temporary while we wait for that version to be fixed.
|
||||
undefine([AC_SEARCH_LIBS])
|
||||
|
||||
dnl AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS [, ACTION-IF-FOUND
|
||||
dnl [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
|
||||
dnl Search for a library defining FUNC, if it's not already available.
|
||||
|
||||
# AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS,
|
||||
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
|
||||
# [OTHER-LIBRARIES])
|
||||
# --------------------------------------------------------
|
||||
# Search for a library defining FUNC, if it's not already available.
|
||||
AC_DEFUN(AC_SEARCH_LIBS,
|
||||
[
|
||||
AC_PREREQ([2.13])
|
||||
AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
|
||||
[
|
||||
ac_func_search_save_LIBS="$LIBS"
|
||||
ac_cv_search_$1="no"
|
||||
AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="none required"])
|
||||
if test "$ac_cv_search_$1" = "no"; then
|
||||
ac_func_search_save_LIBS=$LIBS
|
||||
ac_cv_search_$1=no
|
||||
AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1='none required'])
|
||||
if test "$ac_cv_search_$1" = no; then
|
||||
for ac_lib in $2; do
|
||||
LIBS="-l$ac_lib $5 $ac_func_search_save_LIBS"
|
||||
AC_TRY_LINK_FUNC([$1],
|
||||
[ac_cv_search_$1="-l$ac_lib"
|
||||
break])
|
||||
AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="-l$ac_lib"; break])
|
||||
done
|
||||
fi
|
||||
LIBS="$ac_func_search_save_LIBS"
|
||||
LIBS=$ac_func_search_save_LIBS
|
||||
])
|
||||
|
||||
if test "$ac_cv_search_$1" = "no"; then :
|
||||
if test "$ac_cv_search_$1" = no; then :
|
||||
$4
|
||||
else
|
||||
if test "$ac_cv_search_$1" = "none required"; then :
|
||||
if test "$ac_cv_search_$1" = 'none required'; then :
|
||||
$4
|
||||
else
|
||||
LIBS="$ac_cv_search_$1 $LIBS"
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#serial 9
|
||||
#serial 13
|
||||
|
||||
dnl This macro is intended to be used solely in this file.
|
||||
dnl These are the prerequisite macros for GNU's strftime.c replacement.
|
||||
AC_DEFUN(_jm_STRFTIME_PREREQS,
|
||||
[
|
||||
dnl strftime.c uses localtime_r if it exists. Check for it.
|
||||
AC_CHECK_FUNCS(localtime_r)
|
||||
dnl strftime.c uses localtime_r and the underyling system strftime
|
||||
dnl if they exist.
|
||||
AC_CHECK_FUNCS(localtime_r strftime)
|
||||
|
||||
AC_CHECK_HEADERS(limits.h)
|
||||
AC_CHECK_FUNCS(bcopy tzset mempcpy memcpy memset)
|
||||
@@ -76,6 +77,11 @@ main ()
|
||||
time_t t = 738367; /* Fri Jan 9 13:06:07 1970 */
|
||||
tm = gmtime (&t);
|
||||
|
||||
/* Undefine this in case the configure-time putenv test has defined it
|
||||
to something else. The use we make of this function here doesn't
|
||||
require the added functionality of the replacement one. */
|
||||
#undef putenv
|
||||
|
||||
/* This is necessary to make strftime give consistent zone strings and
|
||||
e.g., seconds since the epoch (%s). */
|
||||
putenv ("TZ=GMT0");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 3
|
||||
#serial 4
|
||||
|
||||
dnl From Jim Meyering
|
||||
|
||||
@@ -7,8 +7,8 @@ dnl in time.h or sys/time.h.
|
||||
|
||||
AC_DEFUN(jm_CHECK_TYPE_STRUCT_TIMESPEC,
|
||||
[
|
||||
AC_REQUIRE([AC_HEADER_TIME])
|
||||
AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
|
||||
AC_REQUIRE([AC_HEADER_TIME])
|
||||
[AC_TRY_COMPILE(
|
||||
[
|
||||
# if TIME_WITH_SYS_TIME
|
||||
|
||||
4
man/factor.x
Normal file
4
man/factor.x
Normal file
@@ -0,0 +1,4 @@
|
||||
[NAME]
|
||||
factor \- factor numbers
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
4
man/uptime.x
Normal file
4
man/uptime.x
Normal file
@@ -0,0 +1,4 @@
|
||||
[NAME]
|
||||
uptime \- tell how long the system has been running
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
@@ -1,3 +1,280 @@
|
||||
2000-05-20 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 4.0s.
|
||||
|
||||
* tests/mv/Makefile.am (TESTS): Add i-2, for 2000-05-12 change.
|
||||
|
||||
* tests/rm/r-2: Clean up.
|
||||
* tests/ls/time-1 (LC_ALL): Set it unconditionally.
|
||||
|
||||
2000-05-19 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Save device number as well as inode number for each directory,
|
||||
and use both in comparisons. This makes the directory cycle
|
||||
test more robust, and closes the small remaining hole whereby
|
||||
an attacker could subvert a running `rm -r' command.
|
||||
|
||||
* src/remove.c (struct active_dir_ent) [st_dev]: New member.
|
||||
[st_ino]: Rename from `inum'.
|
||||
(make_active_dir_ent) [device]: New parameter.
|
||||
(hash_compare_active_dir_ents): Compare using SAME_INODE macro.
|
||||
(fspec_init_common): New function, factored out.
|
||||
(fspec_init_file): Initialize have_device member.
|
||||
(fspec_get_full_mode): Remove parameter. Update caller.
|
||||
Set have_device and st_dev members.
|
||||
* src/remove.h (struct File_spec) [have_device, st_dev]: New members
|
||||
|
||||
2000-05-18 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/remove.c (rm): Combine adjacent fputc and fprintf.
|
||||
|
||||
* tests/rm/Makefile.am (TESTS): Add hash.
|
||||
* tests/rm/hash: New test for the fix in lib/hash.c.
|
||||
|
||||
2000-05-17 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/remove.c (remove_dir): Detect (and fail upon) attempt to subvert
|
||||
a running `rm -r'. Reported by Morten Welinder.
|
||||
|
||||
2000-05-15 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/ln.c (do_link): Use complete strings in diagnostics so they
|
||||
are easier to translate. Reported by Michel Robitaille.
|
||||
(main): Drop support for the case in which S_ISLNK wasn't defined.
|
||||
It was broken in any case.
|
||||
|
||||
* tests/ls/time-1: Set LC_ALL to `C' to avoid failure when the
|
||||
current locale is not C (POSIX). From Matthew Clarke.
|
||||
|
||||
2000-05-13 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/help-version: New test.
|
||||
* src/Makefile.am (TESTS): Define.
|
||||
(TESTS_ENVIRONMENT): Likewise.
|
||||
(EXTRA_DIST): Add help-version.
|
||||
|
||||
* src/chgrp.c: Arrange to call close_stdout only upon exit.
|
||||
* src/chmod.c: Likewise.
|
||||
* src/chown.c: Likewise.
|
||||
* src/cp.c: Likewise.
|
||||
* src/df.c: Likewise.
|
||||
* src/dircolors.c: Likewise.
|
||||
* src/du.c: Likewise.
|
||||
* src/install.c: Likewise.
|
||||
* src/ln.c: Likewise.
|
||||
* src/ls.c: Likewise.
|
||||
* src/mkdir.c: Likewise.
|
||||
* src/mkfifo.c: Likewise.
|
||||
* src/mknod.c: Likewise.
|
||||
* src/mv.c: Likewise.
|
||||
* src/rm.c: Likewise.
|
||||
* src/rmdir.c: Likewise.
|
||||
* src/shred.c: Likewise.
|
||||
* src/sync.c: Likewise.
|
||||
* src/touch.c: Likewise.
|
||||
|
||||
* src/dd.c: Include closeout.h.
|
||||
(usage): Don't call close_stdout here.
|
||||
(close_stdout_wrapper): New, kludgey, function and file-scoped global.
|
||||
(main): Register it with atexit.
|
||||
|
||||
2000-05-12 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Unlike for mv, -i doesn't cancel the effect of -f
|
||||
and -f doesn't cancel the effect of -i.
|
||||
* src/cp.c (main) ['f']: Don't reset `x.interactive'.
|
||||
['i']: Don't reset `x.force'.
|
||||
* src/copy.c (copy_internal): Fix force and interactive tests.
|
||||
Patch from Michael Stone, reported by Jeff Sheinberg.
|
||||
|
||||
2000-05-09 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/shred.c: Include sys/types.h in shred.c before including
|
||||
sys/stat.h or system.h. From John David Anglin.
|
||||
|
||||
2000-05-08 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/shred/remove: Don't use touch in root test. Instead, append to
|
||||
the test file, since now touch operates even on files which deny owner
|
||||
write access.
|
||||
|
||||
2000-05-06 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/Makefile.am (shred_LDADD): Add @LIB_CLOCK_GETTIME@.
|
||||
|
||||
* src/rmdir.c (EEXIST): Remove now-unused definition.
|
||||
(ENOTEMPTY): Likewise.
|
||||
(errno_rmdir_non_empty): Rewrite to use RMDIR_ERRNO_NOT_EMPTY,
|
||||
which is determined by the autoconf test in m4/rmdir-errno.m4.
|
||||
|
||||
2000-05-03 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
Don't fail when running `make check' with non-`C' locale.
|
||||
* tests/cp/symlink-slash: During ls, set LANGUAGE (for GNU gettext)
|
||||
and LC_ALL (for systems which look at LC_MESSAGES).
|
||||
* tests/rm/r-2: Define LC_ALL instead of LANG, in case the user has
|
||||
LC_CTYPE or LC_ALL set. Define it and LANGUAGE before the first use
|
||||
of sort.
|
||||
|
||||
2000-05-03 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
With a recent glibc, _GNU_SOURCE, and -O, strndup may be a macro.
|
||||
* src/sys2.h (!HAVE_DECL_STRNDUP): Declare strndup.
|
||||
* src/dircolors.c: Remove declaration of strndup.
|
||||
Reported by Bruno Haible.
|
||||
|
||||
2000-05-02 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/rm.c (usage): Add the answer to `How do I remove a file named -f?'
|
||||
|
||||
2000-05-01 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/install.c (change_attributes): Don't even attempt the chmod
|
||||
if the chown fails. Before, when a non-root user ran `install -m 4755
|
||||
-o nobody FILE DEST', DEST would set-uid not to `nobody' but rather to
|
||||
the ID of the installing user. Reported by Marc Olzheim.
|
||||
|
||||
2000-04-30 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/touch.c (O_NOCTTY): Define if not defined already.
|
||||
(touch): Add O_NOCTTY to the flags passed to open.
|
||||
|
||||
2000-04-29 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 4.0r.
|
||||
|
||||
* src/cp.c [LSTAT_FOLLOWS_SLASHED_SYMLINK] (lstat): Define to rpl_lstat.
|
||||
|
||||
2000-04-27 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Clean up.
|
||||
* tests/mkdir/Makefile.am (TESTS_ENVIRONMENT): Set PATH, not MKDIR.
|
||||
* tests/mkdir/p-1: Use mkdir, not $MKDIR.
|
||||
* tests/mkdir/p-2: Likewise.
|
||||
|
||||
* configure.in (AC_OUTPUT): Add tests/du/Makefile.
|
||||
* tests/Makefile.am (SUBDIRS): Add du.
|
||||
* tests/du: New directory.
|
||||
* tests/du/two-args: New test.
|
||||
|
||||
* tests/mkdir/special-1: New test.
|
||||
* tests/mkdir/Makefile.am (TESTS): Add special-1.
|
||||
|
||||
2000-04-25 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/du.c (pop_dir): Remove through_symlink arg; use null cwd
|
||||
for that purpose instead.
|
||||
(count_entry): Also save the directory if we're saving more
|
||||
than one level.
|
||||
Fix file descriptor and memory leak when chdir fails.
|
||||
|
||||
2000-04-26 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/mkdir.c: Rename global: s/path_mode/create_parents/.
|
||||
(main): No longer perform explicit chmod when creating
|
||||
parent directories, since make_path now does the chmod.
|
||||
|
||||
2000-04-17 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/chown.c: New option: --from=CURRENT_OWNER:CURRENT_GROUP.
|
||||
(enum) [FROM_OPTION]: New member.
|
||||
(long_options): New getopt spec.
|
||||
(change_file_owner): Add old_user, old_group parameters. Use them.
|
||||
(change_dir_owner): Likewise.
|
||||
(usage): Describe.
|
||||
(main): New case.
|
||||
From Andries Brouwer.
|
||||
* doc/fileutils.texi (invoking chown): Document it.
|
||||
|
||||
2000-04-16 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/cp.c: New option: --strip-trailing-slashes.
|
||||
(enum) [STRIP_TRAILING_SLASHES_OPTION]: New member.
|
||||
(remove_trailing_slashes): New global.
|
||||
(long_opts): New getopt spec.
|
||||
(usage): Describe.
|
||||
(do_copy): Strip trailing slashes on SOURCE names only if the new
|
||||
option has been specified.
|
||||
(main): New case.
|
||||
|
||||
* tests/cp/symlink-slash: New test for the change in behavior.
|
||||
* tests/cp/Makefile.am (TESTS): Add symlink-slash.
|
||||
|
||||
* doc/fileutils.texi (Trailing slashes): Factor out discussion on
|
||||
trailing slashes into its own node.
|
||||
Cross reference from cp and mv.
|
||||
|
||||
2000-04-14 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/touch.c (touch): Add O_NOCTTY to the list of open-time flags.
|
||||
|
||||
2000-04-13 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Move some code into m4/.
|
||||
* configure.in (_GNU_SOURCE): Don't define here.
|
||||
(AC_SYS_LARGEFILE): Don't use here.
|
||||
(AM_C_PROTOTYPES): Don't use here.
|
||||
* acconfig.h: Remove now-unused file.
|
||||
|
||||
2000-04-08 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* doc/fileutils.texi (cp invocation): Mention that there is an
|
||||
application for cp's --sparse=never option. From Martin Hippe.
|
||||
(cp invocation): Describe how --backup and --force
|
||||
can be useful together.
|
||||
|
||||
2000-03-10 Alan Iwi <iwi@atm.ox.ac.uk>
|
||||
|
||||
* src/ls.c: Add support for "ln=target" in the LS_COLORS variable,
|
||||
to colorize links as for the file/directory pointed to.
|
||||
* src/dircolors.hin: Add a few words of documentation of the above.
|
||||
|
||||
2000-04-08 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/cp.c (usage): Document that while the --backup option takes an
|
||||
optional argument, the -b option accepts none.
|
||||
(main): Use `backup type' in call to xget_version, not the
|
||||
now-deprecated `--version-control'.
|
||||
* src/install.c: Likewise.
|
||||
* src/ln.c: Likewise.
|
||||
* src/mv.c: Likewise.
|
||||
|
||||
2000-03-12 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Merge from textutils.
|
||||
* src/system.h: (O_BINARY, O_TEXT): Define if necessary.
|
||||
(SET_BINARY, SET_BINARY2): Define.
|
||||
(DEV_BSIZE): Define to BBSIZE if appropriate.
|
||||
|
||||
2000-03-10 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/mv/mv-special-1: Make the message more like that in the
|
||||
similar touch and shred tests.
|
||||
* tests/touch/fifo: Accommodate SunOS-NFS-mounting-OpenBSD mkfifo
|
||||
bug and `exit 77' if the fifo cannot be created.
|
||||
Report and suggestion from Volker Borchert.
|
||||
|
||||
2000-03-03 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* po/Makefile.in.in (dist distdir): Don't use `ln' (which was just a
|
||||
space optimization anyway) to populate $(distdir). Otherwise, the dist
|
||||
rules that change permissions would end up affecting the master sources.
|
||||
|
||||
2000-03-01 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/df.c (show_point): Ignore shortcuts based on path
|
||||
prefixes that are loop file system mount points, since they
|
||||
yield undesirable output.
|
||||
|
||||
2000-02-29 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/ls.c (decode_switches): Remove `e' from getopt_long's list of
|
||||
option characters. Reported by John Summerfield.
|
||||
|
||||
2000-02-28 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/install/basic-1: Use ginstall, not install.
|
||||
|
||||
2000-02-27 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 4.0q.
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
Changes in release 4.1:
|
||||
[4.0s]
|
||||
* rm no longer segfaults on certain very deep hierarchies
|
||||
* IMPORTANT SECURITY FIX: a running `rm -r' may no longer be subverted to
|
||||
remove unintended directories
|
||||
* cp can now remove unwritable files in interactive mode; contrary to how mv
|
||||
works, cp's --interactive (-i) option does *not* cancel the effect of a
|
||||
preceding --force (-f) option.
|
||||
* all programs fail when printing --help or --version output to a full device
|
||||
* install no longer performs chmod if chown fails (see ChangeLog for example)
|
||||
[4.0r]
|
||||
* `du dir/subdir1 dir/subdir2' no longer fails
|
||||
* chown accepts new option: --from=CURRENT_OWNER:CURRENT_GROUP
|
||||
* cp accepts new option: --strip-trailing-slashes
|
||||
* install --directory (-d) may now be used to set special bits
|
||||
e.g., `install -m a=rwx,o+t -d DIR' now honors the `o+t' part
|
||||
* cp, mv, ln, install: document that while the --backup option takes an
|
||||
optional argument, the -b option accepts none
|
||||
* `ls -e' fails with a more useful diagnostic
|
||||
* df produces better output for loop file system mount points
|
||||
[4.0q]
|
||||
* install -D bug is fixed
|
||||
* chown now works properly when the specified login name contains a period
|
||||
@@ -26,7 +45,7 @@ Changes in release 4.1:
|
||||
[4.0m]
|
||||
* mv accepts new option: --strip-trailing-slashes (soon, many other
|
||||
programs will, too)
|
||||
* df no longer hangs when there is inaccessible mount point unrelated to PATH
|
||||
* df no longer hangs when there is an inaccessible mount point unrelated to PATH
|
||||
* rmdir --verbose no longer prints extra, bogus diagnosic upon failure
|
||||
* fix df bug that made it print bogus values in the `Use%' column.
|
||||
* touch -d once again parses dates with `hh:mm ZONE' time zone info.
|
||||
@@ -61,6 +80,7 @@ Changes in release 4.1:
|
||||
* cp, install, ln, mv: deprecate the --version-control option. Use --backup's
|
||||
new optional argument instead. The old option still works, but now evokes a
|
||||
warning.
|
||||
* cp, install, ln, mv: the --backup option now accepts an optional argument
|
||||
* cp, install, ln, mv: accept new option: --target-directory=DIR
|
||||
* chgrp: accept new option, --dereference. --no-dereference is now the default.
|
||||
* New ls option --quoting-style=locale acts like --quoting-style=c, except
|
||||
|
||||
@@ -1,3 +1,212 @@
|
||||
2000-05-15 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/date/Test.pm (test_vector): Skip the %c test on SunOS4 systems.
|
||||
Suggested by Paul Eggert. Reported by Volker Borchert.
|
||||
|
||||
2000-05-13 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/groups.sh: Detect and report write failure of --help/--version.
|
||||
* src/nohup.sh: Likewise.
|
||||
|
||||
2000-05-11 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/date.c (usage): Don't call close_stdout_status directly,
|
||||
since that didn't cover --version output.
|
||||
(main): Instead, call close_stdout_set_status and arrange to
|
||||
call close_stdout via atexit.
|
||||
* src/printenv.c: Likewise.
|
||||
* src/tty.c: Likewise.
|
||||
|
||||
* src/true.c (usage): Don't call close_stdout directly, since that
|
||||
didn't cover --version output.
|
||||
(main): Arrange to call close_stdout via atexit, instead.
|
||||
* src/yes.c: Likewise.
|
||||
* src/sleep.c: Likewise.
|
||||
|
||||
2000-05-09 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/sys2.h (case_GETOPT_VERSION_CHAR): Don't call close_stdout.
|
||||
* src/help-version: New test.
|
||||
* src/Makefile.am (TESTS): Define.
|
||||
(TESTS_ENVIRONMENT): Likewise.
|
||||
(EXTRA_DIST): Add help-version.
|
||||
|
||||
2000-05-08 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 2.0i.
|
||||
|
||||
2000-05-07 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 2.0h.
|
||||
|
||||
* src/basename.c: Include "closeout.h".
|
||||
(main): Call atexit with close_stdout.
|
||||
* src/chroot.c: Likewise.
|
||||
* src/dirname.c: Likewise.
|
||||
* src/echo.c: Likewise.
|
||||
* src/env.c: Likewise.
|
||||
* src/expr.c: Likewise.
|
||||
* src/factor.c: Likewise.
|
||||
* src/hostid.c: Likewise.
|
||||
* src/hostname.c: Likewise.
|
||||
* src/id.c: Likewise.
|
||||
* src/logname.c: Likewise.
|
||||
* src/nice.c: Likewise.
|
||||
* src/pathchk.c: Likewise.
|
||||
* src/pinky.c: Likewise.
|
||||
* src/printf.c: Likewise.
|
||||
* src/pwd.c: Likewise.
|
||||
* src/seq.c: Likewise.
|
||||
* src/stty.c: Likewise.
|
||||
* src/su.c: Likewise.
|
||||
* src/test.c: Likewise.
|
||||
* src/uname.c: Likewise.
|
||||
* src/uptime.c: Likewise.
|
||||
* src/users.c: Likewise.
|
||||
* src/who.c: Likewise.
|
||||
* src/whoami.c: Likewise.
|
||||
* src/tee.c: Likewise. Remove explicit close_stdout.
|
||||
|
||||
* src/yes.c Include "closeout.h".
|
||||
(usage): Call close_stdout just before exit.
|
||||
* src/sleep.c: Likewise.
|
||||
* src/true.c: Likewise.
|
||||
* src/date.c (usage): Call close_stdout_status.
|
||||
* src/printenv.c (usage): Likewise.
|
||||
|
||||
* tests/date/Test.pm ($Test::env{'rfc822-1'}): Add TZ=UTC0.
|
||||
|
||||
2000-05-06 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/Makefile.am (sleep_LDADD): Add @LIB_CLOCK_GETTIME@ and
|
||||
@LIB_NANOSLEEP@.
|
||||
|
||||
* src/tty.c (main): Warn about arguments, don't fail.
|
||||
(usage): Call close_stdout_status from here as well as from main.
|
||||
|
||||
2000-05-05 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Exit nonzero upon write failure.
|
||||
* src/printf.c: Include "closeout.h".
|
||||
(main): Call close_stdout.
|
||||
Reported by Ian Jackson via Michael Stone.
|
||||
|
||||
2000-05-04 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Makefile.maint (my-distcheck): Remove spurious blank line.
|
||||
Remove $(DEPDIR) *after* making distclean, not before.
|
||||
|
||||
2000-04-30 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/yes.c: Detect and terminate upon write failure.
|
||||
|
||||
2000-04-14 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/seq.c: Shorten `#ifdef HAVE_...' to `#if HAVE_...' and
|
||||
remove unnecessary uses of `defined' (aesthetics).
|
||||
|
||||
2000-04-12 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Move some code into m4/.
|
||||
* configure.in (_GNU_SOURCE): Don't define here.
|
||||
(AC_SYS_LARGEFILE): Don't use here.
|
||||
(AM_C_PROTOTYPES): Don't use here.
|
||||
(AC_DEFINE): Use 3-arg form.
|
||||
* acconfig.h: Remove now-unused file.
|
||||
|
||||
2000-04-09 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure.in (ALL_LINGUAS): Add Estonian (et).
|
||||
|
||||
2000-04-01 Jochen Hein <jochen@jochen.org>
|
||||
|
||||
* src/date.c: Use the "C" locale when using --rfc-822 (-R), as
|
||||
required by rfc822. Before, in the de_DE locale, date would
|
||||
print the German weekday and month abbreviations.
|
||||
|
||||
* tests/date/Test.pm: Add test for rfc822 format and foreign
|
||||
locale settings.
|
||||
|
||||
2000-04-04 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* man/Makefile.am (man_MANS): Add uptime.1.
|
||||
* man/uptime.x: New file.
|
||||
|
||||
* man/Makefile.am (man_MANS): Add factor.1.
|
||||
* man/factor.x: New file.
|
||||
|
||||
* tests/seq/basic: Split a long line and tweak for font-lock mode.
|
||||
* tests/factor/basic: Likewise.
|
||||
* tests/basename/basic: Likewise.
|
||||
|
||||
2000-03-29 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/date.c: Include <langinfo.h> if it exists.
|
||||
(DATE_FMT_LANGINFO): New macro.
|
||||
(show_date): Use it to get the locale-specific default format for
|
||||
"date" if it exists.
|
||||
|
||||
2000-03-19 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 2.0g.
|
||||
|
||||
* doc/sh-utils.texi (chroot invocation): Include a couple tips and
|
||||
a simple example.
|
||||
|
||||
* doc/getdate.texi (Calendar date item): Fix typos.
|
||||
From Per Cederqvist.
|
||||
|
||||
2000-03-18 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/uptime.c (print_uptime): Use `buf' only if fgets succeeds.
|
||||
|
||||
2000-03-12 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Merge from textutils.
|
||||
* src/system.h: (O_BINARY, O_TEXT): Define if necessary.
|
||||
(SET_BINARY, SET_BINARY2): Define.
|
||||
(DEV_BSIZE): Define to BBSIZE if appropriate.
|
||||
|
||||
2000-03-11 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/date/Test.pm: Set the default TZ value to UTC0, not UTC.
|
||||
The latter didn't have any effect on alphaev56-dec-osf4.0f.
|
||||
|
||||
Final merge with fileutils.
|
||||
* src/system.h: Use standard `#if TIME_WITH_SYS_TIME...' block
|
||||
rather than `#if TM_IN_SYS_TIME' one.
|
||||
|
||||
2000-02-02 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* printf.c: Include "unicodeio.h".
|
||||
(usage): Mention \u and \U directives. \x outputs a byte, not a
|
||||
character.
|
||||
(print_esc): Implement \u and \U.
|
||||
* Makefile.am (printf_LDADD): Add @LIBICONV@.
|
||||
|
||||
2000-03-03 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Make it so stty's rprnt attribute works on HPUX 10.20.
|
||||
* src/stty.c [CREPRINT && !CRPRNT] (CRPRNT): Define.
|
||||
(control_info): Recognize HPUX's CREPRINT.
|
||||
|
||||
2000-03-02 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* doc/sh-utils.texi (printf invocation): Describe new unicode syntax.
|
||||
From Bruno Haible.
|
||||
|
||||
Unify with fileutils/src/system.h.
|
||||
* src/system.h (ST_NBLOCKS): Sync with recent changes in fileutils.
|
||||
[!_POSIX_VERSION]: Remove declarations of getlogin, ttyname, geteuid.
|
||||
* src/sys2.h: Declare them here, if needed.
|
||||
|
||||
2000-03-01 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Include GNUmakefile.
|
||||
|
||||
* src/seq.c (get_width_format): Fix portability problem with
|
||||
`-0' vs. `0'.
|
||||
|
||||
2000-02-22 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/date/Test.pm (datevtime-1): New test.
|
||||
|
||||
@@ -1,4 +1,20 @@
|
||||
Changes in release 2.1
|
||||
[2.0j]
|
||||
[2.0i]
|
||||
* fixed a bug introduced in 2.0h that made many programs fail with a
|
||||
`write error' when invoked with the --version option
|
||||
[2.0h]
|
||||
* all programs fail when printing --help or --version output to a full device
|
||||
* printf exits nonzero upon write failure
|
||||
* yes now detects and terminates upon write failure
|
||||
* date --rfc-822 now always emits day and month names from the `C' locale
|
||||
* portability tweaks for Solaris8, Ultrix, and DOS
|
||||
[2.0g]
|
||||
* date now handles two-digit years with leading zeros correctly.
|
||||
* printf interprets unicode, \uNNNN \UNNNNNNNN, on systems with the
|
||||
required support; from Bruno Haible.
|
||||
* stty's rprnt attribute now works on HPUX 10.20
|
||||
* seq's --equal-width option works more portably
|
||||
[2.0f]
|
||||
* fix build problems with ut_name vs. ut_user
|
||||
[2.0e]
|
||||
|
||||
@@ -1,3 +1,127 @@
|
||||
2000-05-12 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/head.c (string_to_integer): Restrict base to 10.
|
||||
Reported by Joseph S. Myers.
|
||||
* tests/head/Test.pm: Add a few tests for this.
|
||||
|
||||
New option: --first-only
|
||||
* src/unexpand.c (anonymous enum) [CONVERT_FIRST_ONLY_OPTION]: Define.
|
||||
(long_options): Add `first-only'.
|
||||
(main): Handle new option.
|
||||
|
||||
2000-05-11 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/unexpand/basic-1: New tests.
|
||||
|
||||
2000-04-17 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* src/system.h [__BEOS__]: Ignore O_BINARY and O_TEXT.
|
||||
|
||||
2000-04-16 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/tail.c: Prepare to remove option: --max-consecutive-size-changes.
|
||||
Doesn't seem useful.
|
||||
(usage): Remove description.
|
||||
* doc/textutils.texi (tail invocation): Remove description.
|
||||
|
||||
2000-04-12 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/tail.c (usage): Tweak --help output. Suggestions from Karl Berry.
|
||||
|
||||
Move some macros into m4/.
|
||||
* configure.in (_GNU_SOURCE): Don't define here.
|
||||
(AC_SYS_LARGEFILE): Don't use here.
|
||||
(AM_C_PROTOTYPES): Don't use here.
|
||||
* acconfig.h: Remove now-unused file.
|
||||
|
||||
2000-04-09 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* doc/textutils.texi: Include constants.texi.
|
||||
(tail invocation): Use `@value's instead of referring to the
|
||||
output of `tail --help' for defaults.
|
||||
* doc/Makefile.am (constants.texi): New rule.
|
||||
(EXTRA_DIST): Add constants.texi.
|
||||
(MAINTAINERCLEANFILES): Add it here, too.
|
||||
(textutils.dvi, textutils.info): Depend on constants.texi.
|
||||
|
||||
* src/tail.c (usage): Clarify descriptions of the --max-* options.
|
||||
From Karl Berry.
|
||||
|
||||
2000-04-03 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure.in (AC_CHECK_HEADERS): Remove langinfo.h. Now it's in m4/.
|
||||
(AC_CHECK_FUNCS): Remove nl_langinfo. Now it's in m4/.
|
||||
|
||||
2000-03-17 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure.in (ALL_LINGUAS): Add Slovenian (sl).
|
||||
|
||||
2000-03-12 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Merge from fileutils.
|
||||
* src/system.h "pathmax.h": Include.
|
||||
<sys/time.h>: Include if appropriate.
|
||||
<time.h>: Likewise.
|
||||
<sys/mkdev.h>: Likewise.
|
||||
<sys/sysmacros.h>: Likewise.
|
||||
<utime.h>: Likewise.
|
||||
(major, minor, makedev): Define if needed.
|
||||
(struct utimbuf): Declare if missing.
|
||||
(ST_BLKSIZE, ST_NBLOCKS, ST_NBLOCKSIZE): Define.
|
||||
|
||||
* src/cksum.c (usage): Correct --help output.
|
||||
Prompted by a report from Gregory Leblanc.
|
||||
|
||||
2000-03-05 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/sort.c (struct buffer.newline_free): New member.
|
||||
(initbuf, findlines): Set it.
|
||||
(fillbuf): Do not double the size of a full buffer to append a newline
|
||||
unless the buffer is known to be newline free.
|
||||
|
||||
2000-03-05 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 2.0e.
|
||||
|
||||
2000-03-04 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Don't get failed assertion for `tail -f directory'.
|
||||
* src/tail.c: Revert most of 1999-10-20 change. Instead, ...
|
||||
(IS_TAILABLE_FILE_TYPE): Define to produce similar result.
|
||||
(recheck): Use it here.
|
||||
(tail_file): Use it here.
|
||||
Reported by François Pinard.
|
||||
|
||||
Once we encounter a file that is not of IS_TAILABLE_FILE_TYPE,
|
||||
marke it as such and ignore it forever after.
|
||||
* src/tail.c (struct File_spec): New member.
|
||||
(recheck): Initialize new member.
|
||||
(tail_file): Likewise.
|
||||
(tail_forever): Skip the file if it's marked as ignorable.
|
||||
|
||||
2000-03-03 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/sort.c (fillbuf): Move declaration of local, cc, into scope of
|
||||
`while' loop where it's used.
|
||||
|
||||
2000-03-02 Paul Eggert <eggert@set.twinsun.com>
|
||||
|
||||
Big performance improvement when sorting many small files,
|
||||
building on a suggestion by Charles Randall.
|
||||
|
||||
* src/sort.c (fillbuf): Skip memmove if it would be a no-op,
|
||||
as many memmove implementations are slow in that case.
|
||||
Don't examine leftover bytes for eolchar, since they may be left
|
||||
over from a previous file, and we want to read from this file.
|
||||
|
||||
(sort): At end of file, if there is more input and buffer room,
|
||||
concatenate the next input file.
|
||||
|
||||
2000-02-29 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/join.c (make_blank): Add an explicit cast to `unsigned char *'
|
||||
to placate HPUX's C compiler. Reported by Bob Proulx.
|
||||
|
||||
2000-01-30 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 2.0d.
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
Changes in release 2.1
|
||||
[2.0f]
|
||||
* unexpand accepts new option: --first-only
|
||||
[2.0e]
|
||||
* `tail -f directory' no longer gets a failed assertion
|
||||
* sort: big performance improvement when sorting many small files;
|
||||
from Charles Randall
|
||||
* configure and portability changes in m4/ and lib/
|
||||
[2.0d]
|
||||
* preliminary sort performance improvements
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* basename -- strip directory and suffix from filenames
|
||||
Copyright (C) 1990-1997, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990-1997, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "system.h"
|
||||
#include "long-options.h"
|
||||
#include "error.h"
|
||||
#include "closeout.h"
|
||||
|
||||
/* The official name of this program (e.g., no `g' prefix). */
|
||||
#define PROGRAM_NAME "basename"
|
||||
@@ -98,6 +99,8 @@ main (int argc, char **argv)
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
|
||||
AUTHORS, usage);
|
||||
/* The above handles --help and --version.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* chgrp -- change group ownership of files
|
||||
Copyright (C) 89, 90, 91, 1995-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 89, 90, 91, 1995-2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -356,7 +356,6 @@ Change the group membership of each FILE to GROUP.\n\
|
||||
--version output version information and exit\n\
|
||||
"));
|
||||
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
|
||||
close_stdout ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
@@ -373,6 +372,8 @@ main (int argc, char **argv)
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
recurse = force_silent = 0;
|
||||
|
||||
while ((optc = getopt_long (argc, argv, "Rcfhv", long_options, NULL)) != -1)
|
||||
@@ -434,7 +435,5 @@ main (int argc, char **argv)
|
||||
for (; optind < argc; ++optind)
|
||||
errors |= change_file_group (1, argv[optind], group);
|
||||
|
||||
if (verbosity != V_off)
|
||||
close_stdout ();
|
||||
exit (errors);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* chmod -- change permission modes of files
|
||||
Copyright (C) 89, 90, 91, 1995-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 89, 90, 91, 1995-2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -263,7 +263,6 @@ Each MODE is one or more of the letters ugoa, one of the symbols +-= and\n\
|
||||
one or more of the letters rwxXstugo.\n\
|
||||
"));
|
||||
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
|
||||
close_stdout ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
@@ -285,6 +284,8 @@ main (int argc, char **argv)
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
recurse = force_silent = 0;
|
||||
|
||||
while (1)
|
||||
@@ -364,7 +365,5 @@ main (int argc, char **argv)
|
||||
errors |= change_file_mode (argv[optind], changes, 1);
|
||||
}
|
||||
|
||||
if (verbosity != V_off)
|
||||
close_stdout ();
|
||||
exit (errors);
|
||||
}
|
||||
|
||||
117
src/chown.c
117
src/chown.c
@@ -79,6 +79,7 @@ enum Verbosity
|
||||
};
|
||||
|
||||
static int change_dir_owner PARAMS ((const char *dir, uid_t user, gid_t group,
|
||||
uid_t old_user, gid_t old_group,
|
||||
const struct stat *statp));
|
||||
|
||||
/* The name the program was run with. */
|
||||
@@ -112,7 +113,8 @@ static char *reference_file;
|
||||
enum
|
||||
{
|
||||
REFERENCE_FILE_OPTION = CHAR_MAX + 1,
|
||||
DEREFERENCE_OPTION
|
||||
DEREFERENCE_OPTION,
|
||||
FROM_OPTION
|
||||
};
|
||||
|
||||
static struct option const long_options[] =
|
||||
@@ -120,6 +122,7 @@ static struct option const long_options[] =
|
||||
{"recursive", no_argument, 0, 'R'},
|
||||
{"changes", no_argument, 0, 'c'},
|
||||
{"dereference", no_argument, 0, DEREFERENCE_OPTION},
|
||||
{"from", required_argument, 0, FROM_OPTION},
|
||||
{"no-dereference", no_argument, 0, 'h'},
|
||||
{"quiet", no_argument, 0, 'f'},
|
||||
{"silent", no_argument, 0, 'f'},
|
||||
@@ -166,12 +169,14 @@ describe_change (const char *file, enum Change_status changed)
|
||||
printf ("%s\n", username);
|
||||
}
|
||||
|
||||
/* Change the ownership of FILE to UID USER and GID GROUP.
|
||||
/* Change the ownership of FILE to UID USER and GID GROUP
|
||||
provided it presently has UID OLDUSER and GID OLDGROUP.
|
||||
If it is a directory and -R is given, recurse.
|
||||
Return 0 if successful, 1 if errors occurred. */
|
||||
|
||||
static int
|
||||
change_file_owner (int cmdline_arg, const char *file, uid_t user, gid_t group)
|
||||
change_file_owner (int cmdline_arg, const char *file, uid_t user, gid_t group,
|
||||
uid_t old_user, gid_t old_group)
|
||||
{
|
||||
struct stat file_stats;
|
||||
uid_t newuser;
|
||||
@@ -185,51 +190,58 @@ change_file_owner (int cmdline_arg, const char *file, uid_t user, gid_t group)
|
||||
return 1;
|
||||
}
|
||||
|
||||
newuser = user == (uid_t) -1 ? file_stats.st_uid : user;
|
||||
newgroup = group == (gid_t) -1 ? file_stats.st_gid : group;
|
||||
if (newuser != file_stats.st_uid || newgroup != file_stats.st_gid)
|
||||
if ((old_user == (uid_t) -1 || file_stats.st_uid == old_user) &&
|
||||
(old_group == (gid_t) -1 || file_stats.st_gid == old_group))
|
||||
{
|
||||
int fail;
|
||||
int symlink_changed = 1;
|
||||
|
||||
if (S_ISLNK (file_stats.st_mode) && change_symlinks)
|
||||
newuser = user == (uid_t) -1 ? file_stats.st_uid : user;
|
||||
newgroup = group == (gid_t) -1 ? file_stats.st_gid : group;
|
||||
if (newuser != file_stats.st_uid || newgroup != file_stats.st_gid)
|
||||
{
|
||||
fail = lchown (file, newuser, newgroup);
|
||||
int fail;
|
||||
int symlink_changed = 1;
|
||||
|
||||
/* 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)
|
||||
if (S_ISLNK (file_stats.st_mode) && change_symlinks)
|
||||
{
|
||||
fail = 0;
|
||||
symlink_changed = 0;
|
||||
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);
|
||||
}
|
||||
|
||||
if (verbosity == V_high || (verbosity == V_changes_only && !fail))
|
||||
{
|
||||
enum Change_status ch_status = (! symlink_changed
|
||||
? CH_NOT_APPLIED
|
||||
: (fail
|
||||
? CH_FAILED : CH_SUCCEEDED));
|
||||
describe_change (file, ch_status);
|
||||
}
|
||||
|
||||
if (fail)
|
||||
{
|
||||
if (force_silent == 0)
|
||||
error (0, errno, "%s", file);
|
||||
errors = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (verbosity == V_high)
|
||||
{
|
||||
fail = chown (file, newuser, newgroup);
|
||||
describe_change (file, CH_NO_CHANGE_REQUESTED);
|
||||
}
|
||||
|
||||
if (verbosity == V_high || (verbosity == V_changes_only && !fail))
|
||||
{
|
||||
enum Change_status ch_status = (! symlink_changed ? CH_NOT_APPLIED
|
||||
: (fail ? CH_FAILED : CH_SUCCEEDED));
|
||||
describe_change (file, ch_status);
|
||||
}
|
||||
|
||||
if (fail)
|
||||
{
|
||||
if (force_silent == 0)
|
||||
error (0, errno, "%s", file);
|
||||
errors = 1;
|
||||
}
|
||||
}
|
||||
else if (verbosity == V_high)
|
||||
{
|
||||
describe_change (file, CH_NO_CHANGE_REQUESTED);
|
||||
}
|
||||
|
||||
if (recurse && S_ISDIR (file_stats.st_mode))
|
||||
errors |= change_dir_owner (file, user, group, &file_stats);
|
||||
errors |= change_dir_owner (file, user, group,
|
||||
old_user, old_group, &file_stats);
|
||||
return errors;
|
||||
}
|
||||
|
||||
@@ -240,6 +252,7 @@ change_file_owner (int cmdline_arg, const char *file, uid_t user, gid_t group)
|
||||
|
||||
static int
|
||||
change_dir_owner (const char *dir, uid_t user, gid_t group,
|
||||
uid_t old_user, gid_t old_group,
|
||||
const struct stat *statp)
|
||||
{
|
||||
char *name_space, *namep;
|
||||
@@ -279,7 +292,7 @@ change_dir_owner (const char *dir, uid_t user, gid_t group,
|
||||
path = xrealloc (path, pathlength);
|
||||
}
|
||||
strcpy (path + dirlength, namep);
|
||||
errors |= change_file_owner (0, path, user, group);
|
||||
errors |= change_file_owner (0, path, user, group, old_user, old_group);
|
||||
}
|
||||
free (path);
|
||||
free (name_space);
|
||||
@@ -309,6 +322,11 @@ Change the owner and/or group of each FILE to OWNER and/or GROUP.\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\
|
||||
--from=CURRENT_OWNER:CURRENT_GROUP\n\
|
||||
change the owner and/or group of each file only if\n\
|
||||
its current owner and/or group match those specified\n\
|
||||
here. Either may be omitted, in which case a match\n\
|
||||
is not required for the omitted attribute.\n\
|
||||
-f, --silent, --quiet suppress most error messages\n\
|
||||
--reference=RFILE use RFILE's owner and group rather than\n\
|
||||
the specified OWNER:GROUP values\n\
|
||||
@@ -318,10 +336,10 @@ Change the owner and/or group of each FILE to OWNER and/or GROUP.\n\
|
||||
--version output version information and exit\n\
|
||||
\n\
|
||||
Owner is unchanged if missing. Group is unchanged if missing, but changed\n\
|
||||
to login group if implied by a `:'.\n\
|
||||
to login group if implied by a `:'. OWNER and GROUP may be numeric as well\n\
|
||||
as symbolic.\n\
|
||||
"));
|
||||
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
|
||||
close_stdout ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
@@ -331,6 +349,9 @@ main (int argc, char **argv)
|
||||
{
|
||||
uid_t user = (uid_t) -1; /* New uid; -1 if not to be changed. */
|
||||
gid_t group = (uid_t) -1; /* New gid; -1 if not to be changed. */
|
||||
uid_t old_user = (uid_t) -1; /* Old uid; -1 if unrestricted. */
|
||||
gid_t old_group = (uid_t) -1; /* Old gid; -1 if unrestricted. */
|
||||
|
||||
int errors = 0;
|
||||
int optc;
|
||||
|
||||
@@ -339,6 +360,8 @@ main (int argc, char **argv)
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
recurse = force_silent = 0;
|
||||
|
||||
while ((optc = getopt_long (argc, argv, "Rcfhv", long_options, NULL)) != -1)
|
||||
@@ -353,6 +376,15 @@ main (int argc, char **argv)
|
||||
case DEREFERENCE_OPTION:
|
||||
change_symlinks = 0;
|
||||
break;
|
||||
case FROM_OPTION:
|
||||
{
|
||||
char *u_dummy, *g_dummy;
|
||||
const char *e = parse_user_spec (argv[optind], &old_user, &old_group,
|
||||
&u_dummy, &g_dummy);
|
||||
if (e)
|
||||
error (1, 0, "%s: %s", argv[optind], e);
|
||||
break;
|
||||
}
|
||||
case 'R':
|
||||
recurse = 1;
|
||||
break;
|
||||
@@ -406,10 +438,9 @@ main (int argc, char **argv)
|
||||
for (; optind < argc; ++optind)
|
||||
{
|
||||
strip_trailing_slashes (argv[optind]);
|
||||
errors |= change_file_owner (1, argv[optind], user, group);
|
||||
errors |= change_file_owner (1, argv[optind], user, group,
|
||||
old_user, old_group);
|
||||
}
|
||||
|
||||
if (verbosity != V_off)
|
||||
close_stdout ();
|
||||
exit (errors);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* chroot -- run command or shell with special root directory
|
||||
Copyright (C) 95, 96, 1997, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 95, 96, 1997, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "system.h"
|
||||
#include "long-options.h"
|
||||
#include "error.h"
|
||||
#include "closeout.h"
|
||||
|
||||
/* The official name of this program (e.g., no `g' prefix). */
|
||||
#define PROGRAM_NAME "chroot"
|
||||
@@ -66,6 +67,8 @@ main (int argc, char **argv)
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
|
||||
AUTHORS, usage);
|
||||
if (argc == 1)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* cksum -- calculate and print POSIX.2 checksums and sizes of files
|
||||
Copyright (C) 92, 1995-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 92, 1995-2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -267,9 +267,10 @@ usage (int status)
|
||||
else
|
||||
{
|
||||
printf (_("\
|
||||
Usage: %s [OPTION]... [FILE]...\n\
|
||||
Usage: %s [FILE]...\n\
|
||||
or: %s [OPTION]\n\
|
||||
"),
|
||||
program_name);
|
||||
program_name, program_name);
|
||||
printf (_("\
|
||||
Print CRC checksum and byte counts of each FILE.\n\
|
||||
\n\
|
||||
|
||||
@@ -489,9 +489,9 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!S_ISDIR (src_type) && !x->force && x->interactive)
|
||||
if (!S_ISDIR (src_type) && x->interactive)
|
||||
{
|
||||
if (euidaccess (dst_path, W_OK) != 0)
|
||||
if (euidaccess (dst_path, W_OK) != 0 && x->force)
|
||||
{
|
||||
fprintf (stderr,
|
||||
_("%s: overwrite `%s', overriding mode %04lo? "),
|
||||
|
||||
42
src/cp.c
42
src/cp.c
@@ -1,5 +1,5 @@
|
||||
/* cp.c -- file copying (main routines)
|
||||
Copyright (C) 89, 90, 91, 1995-1999 Free Software Foundation.
|
||||
Copyright (C) 89, 90, 91, 1995-2000 Free Software Foundation.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -60,12 +60,22 @@ struct dir_attr
|
||||
enum
|
||||
{
|
||||
TARGET_DIRECTORY_OPTION = CHAR_MAX + 1,
|
||||
SPARSE_OPTION
|
||||
SPARSE_OPTION,
|
||||
STRIP_TRAILING_SLASHES_OPTION
|
||||
};
|
||||
|
||||
int stat ();
|
||||
int lstat ();
|
||||
|
||||
/* Arrange to make lstat calls go through the wrapper function
|
||||
on systems with an lstat function that does not dereference symlinks
|
||||
that are specified with a trailing slash. */
|
||||
#if ! LSTAT_FOLLOWS_SLASHED_SYMLINK
|
||||
int rpl_lstat PARAMS((const char *, struct stat *));
|
||||
# undef lstat
|
||||
# define lstat rpl_lstat
|
||||
#endif
|
||||
|
||||
void strip_trailing_slashes ();
|
||||
|
||||
/* Initial number of entries in each hash table entry's table of inodes. */
|
||||
@@ -81,6 +91,9 @@ char *program_name;
|
||||
as its destination instead of the usual "e_dir/e_file." */
|
||||
static int flag_path = 0;
|
||||
|
||||
/* Remove any trailing slashes from each SOURCE argument. */
|
||||
static int remove_trailing_slashes;
|
||||
|
||||
static char const *const sparse_type_string[] =
|
||||
{
|
||||
"never", "auto", "always", 0
|
||||
@@ -108,6 +121,7 @@ static struct option const long_opts[] =
|
||||
{"path", no_argument, NULL, 'P'},
|
||||
{"preserve", no_argument, NULL, 'p'},
|
||||
{"recursive", no_argument, NULL, 'R'},
|
||||
{"strip-trailing-slash", no_argument, NULL, STRIP_TRAILING_SLASHES_OPTION},
|
||||
{"suffix", required_argument, NULL, 'S'},
|
||||
{"symbolic-link", no_argument, NULL, 's'},
|
||||
{"target-directory", required_argument, NULL, TARGET_DIRECTORY_OPTION},
|
||||
@@ -137,7 +151,8 @@ Usage: %s [OPTION]... SOURCE DEST\n\
|
||||
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
|
||||
\n\
|
||||
-a, --archive same as -dpR\n\
|
||||
-b, --backup[=CONTROL] make a backup of each existing destination file\n\
|
||||
--backup[=CONTROL] make a backup of each existing destination file\n\
|
||||
-b like --backup but does not accept an argument\n\
|
||||
-d, --no-dereference preserve links\n\
|
||||
-f, --force remove existing destinations, never prompt\n\
|
||||
-i, --interactive prompt before overwrite\n\
|
||||
@@ -149,6 +164,8 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\
|
||||
special files like FIFOs or /dev/zero\n\
|
||||
--sparse=WHEN control creation of sparse files\n\
|
||||
-R, --recursive copy directories recursively\n\
|
||||
--strip-trailing-slashes remove any trailing slashes from each SOURCE\n\
|
||||
argument\n\
|
||||
-s, --symbolic-link make symbolic links instead of copying\n\
|
||||
-S, --suffix=SUFFIX override the usual backup suffix\n\
|
||||
--target-directory=DIRECTORY move all SOURCE arguments into DIRECTORY\n\
|
||||
@@ -184,7 +201,6 @@ options are given and SOURCE and DEST are the same name for an existing,\n\
|
||||
regular file.\n\
|
||||
"));
|
||||
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
|
||||
close_stdout ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
@@ -485,7 +501,8 @@ do_copy (int n_files, char **file, const char *target_directory,
|
||||
char *arg_in_concat = NULL;
|
||||
char *arg = file[i];
|
||||
|
||||
strip_trailing_slashes (arg);
|
||||
if (remove_trailing_slashes)
|
||||
strip_trailing_slashes (arg);
|
||||
|
||||
if (flag_path)
|
||||
{
|
||||
@@ -597,7 +614,8 @@ do_copy (int n_files, char **file, const char *target_directory,
|
||||
|
||||
tmp_source = (char *) alloca (strlen (source) + 1);
|
||||
strcpy (tmp_source, source);
|
||||
strip_trailing_slashes (tmp_source);
|
||||
if (remove_trailing_slashes)
|
||||
strip_trailing_slashes (tmp_source);
|
||||
source_base = base_name (tmp_source);
|
||||
|
||||
new_dest = (char *) alloca (strlen (dest)
|
||||
@@ -664,6 +682,8 @@ main (int argc, char **argv)
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
cp_option_init (&x);
|
||||
|
||||
/* FIXME: consider not calling getenv for SIMPLE_BACKUP_SUFFIX unless
|
||||
@@ -712,11 +732,9 @@ main (int argc, char **argv)
|
||||
|
||||
case 'f':
|
||||
x.force = 1;
|
||||
x.interactive = 0;
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
x.force = 0;
|
||||
x.interactive = 1;
|
||||
break;
|
||||
|
||||
@@ -745,6 +763,10 @@ main (int argc, char **argv)
|
||||
x.copy_as_regular = 0;
|
||||
break;
|
||||
|
||||
case STRIP_TRAILING_SLASHES_OPTION:
|
||||
remove_trailing_slashes = 1;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
#ifdef S_ISLNK
|
||||
x.symbolic_link = 1;
|
||||
@@ -793,7 +815,7 @@ main (int argc, char **argv)
|
||||
simple_backup_suffix = xstrdup (backup_suffix_string);
|
||||
|
||||
x.backup_type = (make_backups
|
||||
? xget_version (_("--version-control"),
|
||||
? xget_version (_("backup type"),
|
||||
version_control_string)
|
||||
: none);
|
||||
|
||||
@@ -814,7 +836,5 @@ main (int argc, char **argv)
|
||||
|
||||
exit_status |= do_copy (argc - optind, argv + optind, target_directory, &x);
|
||||
|
||||
if (x.verbose)
|
||||
close_stdout ();
|
||||
exit (exit_status);
|
||||
}
|
||||
|
||||
35
src/date.c
35
src/date.c
@@ -21,6 +21,9 @@
|
||||
#include <stdio.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/types.h>
|
||||
#if HAVE_LANGINFO_H
|
||||
# include <langinfo.h>
|
||||
#endif
|
||||
|
||||
#include "system.h"
|
||||
#include "argmatch.h"
|
||||
@@ -106,6 +109,12 @@ static struct option const long_options[] =
|
||||
#define MAYBE_SET_TZ_UTC0 \
|
||||
do { if (universal_time) set_tz (TZ_UTC0); } while (0)
|
||||
|
||||
#ifdef _DATE_FMT
|
||||
# define DATE_FMT_LANGINFO() nl_langinfo (_DATE_FMT)
|
||||
#else
|
||||
# define DATE_FMT_LANGINFO() ""
|
||||
#endif
|
||||
|
||||
void
|
||||
usage (int status)
|
||||
{
|
||||
@@ -310,6 +319,9 @@ main (int argc, char **argv)
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
close_stdout_set_status (2);
|
||||
atexit (close_stdout);
|
||||
|
||||
while ((optc = getopt_long (argc, argv, "d:f:I::r:Rs:u", long_options, NULL))
|
||||
!= -1)
|
||||
switch (optc)
|
||||
@@ -454,8 +466,6 @@ argument must be a format string beginning with `+'."),
|
||||
show_date (format, when);
|
||||
}
|
||||
|
||||
close_stdout_status (2);
|
||||
|
||||
exit (status);
|
||||
}
|
||||
|
||||
@@ -490,13 +500,17 @@ show_date (const char *format, time_t when)
|
||||
in the RFC format to %Z; this gives, however, an invalid
|
||||
RFC time format outside the continental United States and GMT. */
|
||||
|
||||
format = (rfc_format
|
||||
? (universal_time
|
||||
? "%a, %_d %b %Y %H:%M:%S GMT"
|
||||
: "%a, %_d %b %Y %H:%M:%S %z")
|
||||
: (iso_8601_format
|
||||
? iso_format_string[iso_8601_format][universal_time]
|
||||
: "%a %b %e %H:%M:%S %Z %Y"));
|
||||
if (rfc_format)
|
||||
format = (universal_time
|
||||
? "%a, %_d %b %Y %H:%M:%S GMT"
|
||||
: "%a, %_d %b %Y %H:%M:%S %z");
|
||||
else if (iso_8601_format)
|
||||
format = iso_format_string[iso_8601_format][universal_time];
|
||||
else
|
||||
{
|
||||
char *date_fmt = DATE_FMT_LANGINFO ();
|
||||
format = *date_fmt ? date_fmt : "%a %b %e %H:%M:%S %Z %Y";
|
||||
}
|
||||
}
|
||||
else if (*format == '\0')
|
||||
{
|
||||
@@ -504,6 +518,9 @@ show_date (const char *format, time_t when)
|
||||
return;
|
||||
}
|
||||
|
||||
if (rfc_format)
|
||||
setlocale (LC_ALL, "C");
|
||||
|
||||
do
|
||||
{
|
||||
out_length += 200;
|
||||
|
||||
19
src/dd.c
19
src/dd.c
@@ -30,6 +30,7 @@
|
||||
#include <getopt.h>
|
||||
|
||||
#include "system.h"
|
||||
#include "closeout.h"
|
||||
#include "error.h"
|
||||
#include "getpagesize.h"
|
||||
#include "human.h"
|
||||
@@ -314,7 +315,6 @@ Each KEYWORD may be:\n\
|
||||
sync pad every input block with NULs to ibs-size\n\
|
||||
"));
|
||||
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
|
||||
close_stdout ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
@@ -1048,6 +1048,17 @@ dd_copy (void)
|
||||
return exit_status;
|
||||
}
|
||||
|
||||
/* This is gross, but necessary, because of the way close_stdout
|
||||
works and because this program closes STDOUT_FILENO directly. */
|
||||
static void (*closeout_func) (void) = close_stdout;
|
||||
|
||||
static void
|
||||
close_stdout_wrapper (void)
|
||||
{
|
||||
if (*closeout_func)
|
||||
(*closeout_func) ();
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
@@ -1059,9 +1070,15 @@ main (int argc, char **argv)
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
/* Arrange to close stdout if parse_long_options exits. */
|
||||
atexit (close_stdout_wrapper);
|
||||
|
||||
parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
|
||||
AUTHORS, usage);
|
||||
|
||||
/* Don't close stdout on exit from here on. */
|
||||
closeout_func = NULL;
|
||||
|
||||
/* Initialize translation table to identity translation. */
|
||||
for (i = 0; i < 256; i++)
|
||||
trans_table[i] = i;
|
||||
|
||||
8
src/df.c
8
src/df.c
@@ -507,7 +507,7 @@ show_point (const char *point, const struct stat *statp)
|
||||
{
|
||||
for (me = mount_list; me; me = me->me_next)
|
||||
{
|
||||
if (STREQ (me->me_mountdir, point))
|
||||
if (STREQ (me->me_mountdir, point) && !STREQ (me->me_type, "lofs"))
|
||||
{
|
||||
/* Prefer non-dummy entries. */
|
||||
if (! me->me_dummy)
|
||||
@@ -599,7 +599,7 @@ show_point (const char *point, const struct stat *statp)
|
||||
}
|
||||
}
|
||||
|
||||
if (best_match)
|
||||
if (best_match && !STREQ (best_match->me_type, "lofs"))
|
||||
{
|
||||
me = best_match;
|
||||
goto show_me;
|
||||
@@ -752,7 +752,6 @@ or all filesystems by default.\n\
|
||||
--version output version information and exit\n\
|
||||
"));
|
||||
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
|
||||
close_stdout ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
@@ -769,6 +768,8 @@ main (int argc, char **argv)
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
fs_select_list = NULL;
|
||||
fs_exclude_list = NULL;
|
||||
inode_format = 0;
|
||||
@@ -932,6 +933,5 @@ main (int argc, char **argv)
|
||||
show_entry (argv[i], &stats[i - optind]);
|
||||
}
|
||||
|
||||
close_stdout ();
|
||||
exit (exit_status);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* dircolors - output commands to set the LS_COLOR environment variable
|
||||
Copyright (C) 1994, 1995, 1997, 1998, 1999 H. Peter Anvin
|
||||
Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000 H. Peter Anvin
|
||||
Copyright (C) 1996-1999 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -39,8 +39,6 @@
|
||||
#define obstack_chunk_alloc malloc
|
||||
#define obstack_chunk_free free
|
||||
|
||||
char *strndup();
|
||||
|
||||
enum Shell_syntax
|
||||
{
|
||||
SHELL_SYNTAX_BOURNE,
|
||||
@@ -117,7 +115,6 @@ file types and extensions. Otherwise, a precompiled database is used.\n\
|
||||
For details on the format of these files, run `dircolors --print-database'.\n\
|
||||
"));
|
||||
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
|
||||
close_stdout ();
|
||||
}
|
||||
|
||||
exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||
@@ -431,6 +428,8 @@ main (int argc, char **argv)
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
while ((optc = getopt_long (argc, argv, "bcp", long_options, NULL)) != -1)
|
||||
switch (optc)
|
||||
{
|
||||
@@ -532,7 +531,6 @@ dircolors' internal database"));
|
||||
}
|
||||
}
|
||||
|
||||
close_stdout ();
|
||||
|
||||
if (have_read_stdin && fclose (stdin) == EOF)
|
||||
error (EXIT_FAILURE, errno, _("standard input"));
|
||||
|
||||
@@ -37,7 +37,8 @@ TERM vt100
|
||||
NORMAL 00 # global default, although everything should be something.
|
||||
FILE 00 # normal file
|
||||
DIR 01;34 # directory
|
||||
LINK 01;36 # symbolic link
|
||||
LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
|
||||
# numerical value, the color is as for the file pointed to.)
|
||||
FIFO 40;33 # pipe
|
||||
SOCK 01;35 # socket
|
||||
DOOR 01;35 # door
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* dirname -- strip filename suffix from pathname
|
||||
Copyright (C) 1990-1997, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990-1997, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "system.h"
|
||||
#include "long-options.h"
|
||||
#include "error.h"
|
||||
#include "closeout.h"
|
||||
|
||||
/* The official name of this program (e.g., no `g' prefix). */
|
||||
#define PROGRAM_NAME "dirname"
|
||||
@@ -71,6 +72,8 @@ main (int argc, char **argv)
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
|
||||
AUTHORS, usage);
|
||||
/* The above handles --help and --version.
|
||||
|
||||
43
src/du.c
43
src/du.c
@@ -227,7 +227,6 @@ Summarize disk usage of each FILE, recursively for directories.\n\
|
||||
--version output version information and exit\n\
|
||||
"));
|
||||
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
|
||||
close_stdout ();
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
@@ -455,14 +454,14 @@ hash_insert (ino_t ino, dev_t dev)
|
||||
}
|
||||
|
||||
/* Restore the previous working directory or exit.
|
||||
If THROUGH_SYMLINK is non-zero, simply call `chdir ("..")'. Otherwise,
|
||||
If CWD is null, simply call `chdir ("..")'. Otherwise,
|
||||
use CWD and free it. CURR_DIR_NAME is the name of the current directory
|
||||
and is used solely in failure diagnostics. */
|
||||
|
||||
static void
|
||||
pop_dir (int through_symlink, struct saved_cwd *cwd, const char *curr_dir_name)
|
||||
pop_dir (struct saved_cwd *cwd, const char *curr_dir_name)
|
||||
{
|
||||
if (through_symlink)
|
||||
if (cwd)
|
||||
{
|
||||
if (restore_cwd (cwd, "..", curr_dir_name))
|
||||
exit (1);
|
||||
@@ -513,8 +512,8 @@ count_entry (const char *ent, int top, dev_t last_dev, int depth)
|
||||
dev_t dir_dev;
|
||||
char *name_space;
|
||||
char *namep;
|
||||
struct saved_cwd cwd;
|
||||
int through_symlink;
|
||||
struct saved_cwd *cwd;
|
||||
struct saved_cwd cwd_buf;
|
||||
struct stat e_buf;
|
||||
|
||||
dir_dev = stat_buf.st_dev;
|
||||
@@ -525,18 +524,27 @@ count_entry (const char *ent, int top, dev_t last_dev, int depth)
|
||||
#ifndef S_ISLNK
|
||||
# define S_ISLNK(s) 0
|
||||
#endif
|
||||
/* If we're dereferencing symlinks and we're about to chdir through
|
||||
a symlink, remember the current directory so we can return to it
|
||||
later. In other cases, chdir ("..") works fine. */
|
||||
through_symlink = (xstat == stat
|
||||
&& lstat (ent, &e_buf) == 0
|
||||
&& S_ISLNK (e_buf.st_mode));
|
||||
if (through_symlink && save_cwd (&cwd))
|
||||
exit (1);
|
||||
/* If we're traversing more than one level, or if we're
|
||||
dereferencing symlinks and we're about to chdir through a
|
||||
symlink, remember the current directory so we can return to
|
||||
it later. In other cases, chdir ("..") works fine. */
|
||||
if (strchr (ent, '/')
|
||||
|| (xstat == stat
|
||||
&& lstat (ent, &e_buf) == 0
|
||||
&& S_ISLNK (e_buf.st_mode)))
|
||||
{
|
||||
if (save_cwd (&cwd_buf))
|
||||
exit (1);
|
||||
cwd = &cwd_buf;
|
||||
}
|
||||
else
|
||||
cwd = NULL;
|
||||
|
||||
if (chdir (ent) < 0)
|
||||
{
|
||||
error (0, errno, _("cannot change to directory %s"), path->text);
|
||||
if (cwd)
|
||||
free_cwd (cwd);
|
||||
exit_status = 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -548,7 +556,7 @@ count_entry (const char *ent, int top, dev_t last_dev, int depth)
|
||||
if (errno)
|
||||
{
|
||||
error (0, errno, "%s", path->text);
|
||||
pop_dir (through_symlink, &cwd, path->text);
|
||||
pop_dir (cwd, path->text);
|
||||
exit_status = 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -572,7 +580,7 @@ count_entry (const char *ent, int top, dev_t last_dev, int depth)
|
||||
}
|
||||
|
||||
free (name_space);
|
||||
pop_dir (through_symlink, &cwd, path->text);
|
||||
pop_dir (cwd, path->text);
|
||||
|
||||
str_trunc (path, pathlen - 1); /* Remove the "/" we added. */
|
||||
if (depth <= max_depth || top)
|
||||
@@ -647,6 +655,8 @@ main (int argc, char **argv)
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
exclude = new_exclude ();
|
||||
xstat = lstat;
|
||||
|
||||
@@ -774,6 +784,5 @@ main (int argc, char **argv)
|
||||
|
||||
du_files (optind == argc ? cwd_only : argv + optind);
|
||||
|
||||
close_stdout ();
|
||||
exit (exit_status);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* echo.c, derived from code echo.c in Bash.
|
||||
Copyright (C) 87,89, 1991-1997, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 87,89, 1991-1997, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include "system.h"
|
||||
#include "closeout.h"
|
||||
#include "long-options.h"
|
||||
|
||||
/* The official name of this program (e.g., no `g' prefix). */
|
||||
@@ -117,6 +118,8 @@ main (int argc, char **argv)
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
/* Don't recognize --help or --version if POSIXLY_CORRECT is set. */
|
||||
if (getenv ("POSIXLY_CORRECT") == NULL)
|
||||
parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* env - run a program in a modified environment
|
||||
Copyright (C) 1986, 1991-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1986, 1991-2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -85,6 +85,7 @@
|
||||
|
||||
#include "system.h"
|
||||
#include "error.h"
|
||||
#include "closeout.h"
|
||||
|
||||
/* The official name of this program (e.g., no `g' prefix). */
|
||||
#define PROGRAM_NAME "env"
|
||||
@@ -145,6 +146,8 @@ main (register int argc, register char **argv, char **envp)
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
while ((optc = getopt_long (argc, argv, "+iu:", longopts, NULL)) != -1)
|
||||
{
|
||||
switch (optc)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* expr -- evaluate expressions.
|
||||
Copyright (C) 86, 1991-1997, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 86, 1991-1997, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "long-options.h"
|
||||
#include "error.h"
|
||||
#include "xalloc.h"
|
||||
#include "closeout.h"
|
||||
|
||||
/* The official name of this program (e.g., no `g' prefix). */
|
||||
#define PROGRAM_NAME "expr"
|
||||
@@ -168,6 +169,8 @@ main (int argc, char **argv)
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
posixly_correct = (getenv ("POSIXLY_CORRECT") != NULL);
|
||||
|
||||
/* Recognize --help or --version only if POSIXLY_CORRECT is not set. */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user