mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
Compare commits
409 Commits
FILEUTILS-
...
FILEUTILS-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b8209bca8 | ||
|
|
a98c656b54 | ||
|
|
e43759db0c | ||
|
|
507d0aa278 | ||
|
|
86845e9bfe | ||
|
|
633c0745b9 | ||
|
|
5bea77e1af | ||
|
|
4fef810c37 | ||
|
|
7717354351 | ||
|
|
07ab5fec9a | ||
|
|
8cf07d2253 | ||
|
|
aadde40206 | ||
|
|
aee6c49887 | ||
|
|
8041fd5301 | ||
|
|
7a80c0cacc | ||
|
|
c2f3af37bb | ||
|
|
fe56d629d1 | ||
|
|
6c5f00186d | ||
|
|
27acd938a1 | ||
|
|
dda6c3fdc4 | ||
|
|
9d343b0852 | ||
|
|
36aea8162f | ||
|
|
fb0afad994 | ||
|
|
847ee5a3bd | ||
|
|
649349a300 | ||
|
|
759591ae51 | ||
|
|
bb8bb211a1 | ||
|
|
47322c2a8e | ||
|
|
e86141f400 | ||
|
|
8ebde9b0bb | ||
|
|
47eed28390 | ||
|
|
72bd5150fd | ||
|
|
a8223df329 | ||
|
|
7c0e2db49b | ||
|
|
1f6347114a | ||
|
|
9c1810823d | ||
|
|
f25e10f24d | ||
|
|
9bb4588551 | ||
|
|
678d98c083 | ||
|
|
b0952dd045 | ||
|
|
20552b01be | ||
|
|
1b136ab2e9 | ||
|
|
d682521386 | ||
|
|
fb50c4895a | ||
|
|
29e2ec8676 | ||
|
|
f8845967cf | ||
|
|
a849cac5b5 | ||
|
|
d63f6d17dd | ||
|
|
979ea98a3e | ||
|
|
4dbf0a39a6 | ||
|
|
6a7e32b137 | ||
|
|
63444750ac | ||
|
|
4c1158bac0 | ||
|
|
43b2179550 | ||
|
|
ec940f653c | ||
|
|
7c270275fe | ||
|
|
09ce6f34a1 | ||
|
|
999a14a6a5 | ||
|
|
64a7649926 | ||
|
|
0d96fcf423 | ||
|
|
658207b433 | ||
|
|
1f1f9fe885 | ||
|
|
40e6e7a44e | ||
|
|
77dfc82293 | ||
|
|
5813e98ace | ||
|
|
b8cf92fee6 | ||
|
|
31ef40d60b | ||
|
|
66a4b0e7a3 | ||
|
|
3d9c2a6c35 | ||
|
|
282fa27b51 | ||
|
|
04d0388df4 | ||
|
|
d89210720b | ||
|
|
1347ab3fa2 | ||
|
|
35d44548fb | ||
|
|
269c31af34 | ||
|
|
afc2960851 | ||
|
|
d9aece69b3 | ||
|
|
d31f3e34a6 | ||
|
|
260ff68425 | ||
|
|
ddee3f420c | ||
|
|
8b7a023ff1 | ||
|
|
31c3ae1545 | ||
|
|
55e5a84fed | ||
|
|
35d017aa1d | ||
|
|
99c95d35e9 | ||
|
|
40a4ab97fe | ||
|
|
03062f0904 | ||
|
|
d6181296dd | ||
|
|
e2cc35f086 | ||
|
|
5e3d1430e3 | ||
|
|
9951c9f723 | ||
|
|
2781381e83 | ||
|
|
035e61e595 | ||
|
|
345ed2f0c4 | ||
|
|
c52336c440 | ||
|
|
9936c270a7 | ||
|
|
0c0a8f7180 | ||
|
|
dfd37e9e59 | ||
|
|
58d3cbbc5c | ||
|
|
6b239bb039 | ||
|
|
2e18b62d99 | ||
|
|
7392a5fd49 | ||
|
|
e413127dd4 | ||
|
|
fa183ca836 | ||
|
|
ab4923e01e | ||
|
|
2ffef0cd25 | ||
|
|
80862b8fb4 | ||
|
|
6cf7855da7 | ||
|
|
5d716e440a | ||
|
|
05073cdf67 | ||
|
|
a6ac5e555f | ||
|
|
5c67c91bb1 | ||
|
|
70bf2ee07d | ||
|
|
e40b2aea74 | ||
|
|
980db8d94b | ||
|
|
3f4d9d2baf | ||
|
|
2e35cf88d4 | ||
|
|
3b85a5c102 | ||
|
|
03885c59b5 | ||
|
|
47fe4e2b81 | ||
|
|
afed58448d | ||
|
|
83b7332303 | ||
|
|
b1a7c1d3f6 | ||
|
|
07730c119b | ||
|
|
ce286ec9da | ||
|
|
40f2b94df5 | ||
|
|
e03663fafd | ||
|
|
6d94f760a2 | ||
|
|
10ababf6b2 | ||
|
|
faae41a3ef | ||
|
|
177daedd5e | ||
|
|
aeedb315dd | ||
|
|
93d0c6c472 | ||
|
|
7138e43074 | ||
|
|
84b2bdcb3a | ||
|
|
787ee99d38 | ||
|
|
b8293a0364 | ||
|
|
5e8af70e24 | ||
|
|
d8c942fdef | ||
|
|
715f1c67f9 | ||
|
|
ffb0e90647 | ||
|
|
cf4a419332 | ||
|
|
490bf3d6e9 | ||
|
|
6ce0ab6d40 | ||
|
|
70ac08368a | ||
|
|
26310e4984 | ||
|
|
6b43446a33 | ||
|
|
c3a1a2a912 | ||
|
|
348f0efabe | ||
|
|
5b2acd8d30 | ||
|
|
488aef7301 | ||
|
|
be1784cf31 | ||
|
|
c453666c3a | ||
|
|
cbe550de62 | ||
|
|
333d061276 | ||
|
|
b0be1bfab9 | ||
|
|
c58c8f5fcf | ||
|
|
9733e004ef | ||
|
|
fd3817b9dc | ||
|
|
744efcce69 | ||
|
|
3d64706c7e | ||
|
|
774786b0cd | ||
|
|
22cb099f3c | ||
|
|
b737ed325a | ||
|
|
fedbe363a9 | ||
|
|
5df431d118 | ||
|
|
b43184c5e5 | ||
|
|
ab365a8297 | ||
|
|
f573721b82 | ||
|
|
1c1efebc1d | ||
|
|
be27aed1ec | ||
|
|
cf16d34a4d | ||
|
|
8d6ec015de | ||
|
|
5c4b305870 | ||
|
|
62ec3fd688 | ||
|
|
eda468af14 | ||
|
|
8775803a9d | ||
|
|
8c6fe7ba06 | ||
|
|
2e962bb26f | ||
|
|
3f8032ddc9 | ||
|
|
7a4fca9d77 | ||
|
|
c1aaa6492f | ||
|
|
f8f48d0023 | ||
|
|
e446ebf6c3 | ||
|
|
273d5d4925 | ||
|
|
bd8333c63d | ||
|
|
d176b68faa | ||
|
|
f6b673d543 | ||
|
|
bb84498a89 | ||
|
|
90eddc5478 | ||
|
|
e3fa0cb53b | ||
|
|
62205d8c7e | ||
|
|
6cac32ec7f | ||
|
|
4db6224838 | ||
|
|
ba088349be | ||
|
|
bbcd510bc5 | ||
|
|
489f1925be | ||
|
|
d813adbf1f | ||
|
|
13707ac76a | ||
|
|
b631b5c3ac | ||
|
|
06b0be15bb | ||
|
|
1f18465289 | ||
|
|
a8b0898ba5 | ||
|
|
9a2ff5e31c | ||
|
|
03caa431a0 | ||
|
|
231f8fc887 | ||
|
|
15ee939c3c | ||
|
|
893fdf84e8 | ||
|
|
f57f26e36a | ||
|
|
7d31261496 | ||
|
|
b67de020d9 | ||
|
|
06eee4e253 | ||
|
|
efa9563f3d | ||
|
|
ae5c430364 | ||
|
|
fe3a834b9f | ||
|
|
d32cf4d872 | ||
|
|
9e30aaca79 | ||
|
|
26c96331b2 | ||
|
|
81df043fdd | ||
|
|
d495aaf3e7 | ||
|
|
3705d57846 | ||
|
|
d5eb5821c6 | ||
|
|
48efd1644d | ||
|
|
a9d4aadb5e | ||
|
|
ce0262560b | ||
|
|
505805856e | ||
|
|
aef5ff97f7 | ||
|
|
7d7c104722 | ||
|
|
d0a520d367 | ||
|
|
4d5960cf1f | ||
|
|
5adc8fd591 | ||
|
|
47b4e7f1aa | ||
|
|
46980c56e0 | ||
|
|
86f00ce878 | ||
|
|
2c702c93fe | ||
|
|
c91b47d64f | ||
|
|
9e4428a605 | ||
|
|
b76b69c8a2 | ||
|
|
4f0cb8adcb | ||
|
|
cbe1109277 | ||
|
|
08e09e9ab4 | ||
|
|
f3f4a60164 | ||
|
|
dce8ba11dd | ||
|
|
45d534215a | ||
|
|
1a50efcd03 | ||
|
|
86a839108c | ||
|
|
aebba9cd1d | ||
|
|
42e962a284 | ||
|
|
0de00b9e6a | ||
|
|
f23d5119d8 | ||
|
|
0d9735fbb4 | ||
|
|
0b7e06d203 | ||
|
|
968d5b2bbf | ||
|
|
abab15deb9 | ||
|
|
570080ef25 | ||
|
|
595bfc8a83 | ||
|
|
dfb0540bb1 | ||
|
|
c099a14fac | ||
|
|
c219eb2daf | ||
|
|
c9c2cdda8b | ||
|
|
58da7aa5b3 | ||
|
|
7bce838dab | ||
|
|
24c45a756e | ||
|
|
d4db66a0fb | ||
|
|
09f1b5f940 | ||
|
|
a2e435c395 | ||
|
|
e1cc8122af | ||
|
|
8ce9f19835 | ||
|
|
f5ff12fcbc | ||
|
|
c7bd32731e | ||
|
|
0f9105c7be | ||
|
|
c4a0e46616 | ||
|
|
a33ca24833 | ||
|
|
465e3422e8 | ||
|
|
1a8bedfeb7 | ||
|
|
88e049caf5 | ||
|
|
8ecfdb48a9 | ||
|
|
c88a1e4466 | ||
|
|
4186d5762f | ||
|
|
c951e3f2c9 | ||
|
|
e48c320244 | ||
|
|
625a560403 | ||
|
|
f3a2399998 | ||
|
|
fc32116042 | ||
|
|
1a779705e8 | ||
|
|
6df5aa20d7 | ||
|
|
d29115d80f | ||
|
|
89d8c4e859 | ||
|
|
4ba6864c31 | ||
|
|
dc6a5317bc | ||
|
|
98379bfc4f | ||
|
|
cfa079e41d | ||
|
|
553fe00983 | ||
|
|
c4acbcc996 | ||
|
|
e8611c5714 | ||
|
|
9393315a06 | ||
|
|
7990f92f15 | ||
|
|
2435963a1f | ||
|
|
469d21a9d3 | ||
|
|
ddcb373abc | ||
|
|
e0a66a6600 | ||
|
|
d448da43d6 | ||
|
|
870858ccad | ||
|
|
fa25e451f9 | ||
|
|
3e115cf2b5 | ||
|
|
41a7e7c193 | ||
|
|
8024f33e45 | ||
|
|
1fe0bff2f4 | ||
|
|
c829e00d78 | ||
|
|
95b4ba5e0d | ||
|
|
f106184dd2 | ||
|
|
93a834533b | ||
|
|
2c3cad16b2 | ||
|
|
7f54d0b6b7 | ||
|
|
751d1a1888 | ||
|
|
47be9d6b2f | ||
|
|
4d034357da | ||
|
|
ea51a6cbaa | ||
|
|
065c2a2cda | ||
|
|
e9296ad49f | ||
|
|
588bb7b9e2 | ||
|
|
53000596a9 | ||
|
|
ccd763bee2 | ||
|
|
0c4d4d0081 | ||
|
|
ac9b999873 | ||
|
|
7a8e14b287 | ||
|
|
38b49a265f | ||
|
|
fb6ad846b4 | ||
|
|
67cf2e1e2e | ||
|
|
2b47bcaca6 | ||
|
|
11d24c8713 | ||
|
|
7c99efe376 | ||
|
|
6bcc673201 | ||
|
|
337515e1ed | ||
|
|
fda148fb1b | ||
|
|
e7d71e0725 | ||
|
|
110b79479d | ||
|
|
e64e8130b1 | ||
|
|
5fae922bab | ||
|
|
840aee01de | ||
|
|
dfc6a234b0 | ||
|
|
b07aaa6cd0 | ||
|
|
9e8497dd61 | ||
|
|
6a483c24a8 | ||
|
|
590f2decc5 | ||
|
|
489dafa7bc | ||
|
|
8ee46f4bf8 | ||
|
|
b6040be40a | ||
|
|
116bfa584d | ||
|
|
c3f357adf5 | ||
|
|
78992ab94f | ||
|
|
48bbfe2e71 | ||
|
|
f02fa3aa3e | ||
|
|
616361c4f6 | ||
|
|
48e3ed52ee | ||
|
|
46d6db5426 | ||
|
|
4841119c1a | ||
|
|
8c0c6b0468 | ||
|
|
5159046f88 | ||
|
|
0d5f220029 | ||
|
|
afd24c5869 | ||
|
|
9bb0428a59 | ||
|
|
cf0a18b69d | ||
|
|
6c7d8fd5b5 | ||
|
|
3eb8c1fea4 | ||
|
|
3ee8530a1e | ||
|
|
66cbf09569 | ||
|
|
3152cf6f82 | ||
|
|
0567a5d9c8 | ||
|
|
a69a2d6856 | ||
|
|
35ed98cc06 | ||
|
|
ff626bd3c0 | ||
|
|
b52f383a7f | ||
|
|
b14089f76b | ||
|
|
3df9479ab4 | ||
|
|
bbe32e1637 | ||
|
|
79732f800d | ||
|
|
c186123316 | ||
|
|
e50dab4ad9 | ||
|
|
5d0f90dff7 | ||
|
|
f3b0ab5eba | ||
|
|
551ab8474b | ||
|
|
12d6e4b1cd | ||
|
|
a5ab3d9aac | ||
|
|
fbe7dca27f | ||
|
|
0d47b4be52 | ||
|
|
59457bee16 | ||
|
|
a3b2c5389c | ||
|
|
1c4c285999 | ||
|
|
1b84791bc8 | ||
|
|
126e14b161 | ||
|
|
80fd95a91d | ||
|
|
ca974b3755 | ||
|
|
9f5307f1d3 | ||
|
|
97085c8df7 | ||
|
|
de1cb33196 | ||
|
|
741c7303a5 | ||
|
|
f23b3eb47a | ||
|
|
f488edddf7 | ||
|
|
60dabf5cd1 | ||
|
|
44381ed288 | ||
|
|
4717bb93f2 | ||
|
|
9442b6050b | ||
|
|
6adb0e4d56 | ||
|
|
6f06aad852 | ||
|
|
baf8720297 | ||
|
|
94966b9515 | ||
|
|
55d80ad41a | ||
|
|
7b9c964fde |
4
COPYING
4
COPYING
@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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
|
||||
@@ -313,7 +313,7 @@ Also add information on how to contact you by electronic and paper mail.
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
@@ -48,7 +48,8 @@ null_AM_MAKEFLAGS = \
|
||||
MAKEINFO=false
|
||||
|
||||
t=./=test
|
||||
my-distcheck:
|
||||
my-distcheck: writable-files po-check
|
||||
|
||||
-rm -rf $(t)
|
||||
mkdir $(t)
|
||||
GZIP=$(GZIP) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
|
||||
@@ -86,7 +87,6 @@ a_real_dir=/fs/share/ftp/gnu/fetish
|
||||
b_real_dir=/home/ftp/pub/gnu/fetish
|
||||
|
||||
url_dir_list = $(foreach x,a b,ftp://$($(x)_host)/$($(x)_url_dir))
|
||||
real_dir_list = $(foreach x,a b,ftp://$($(x)_host)$($(x)_real_dir))
|
||||
|
||||
md5 = $(shell md5sum < $(distdir).tar.gz|sed 's/ -//')
|
||||
|
||||
@@ -99,6 +99,10 @@ rel-check:
|
||||
echo "$(md5) -" > $$md5_tmp; \
|
||||
md5sum -c $$md5_tmp < $$tarz
|
||||
|
||||
release-archive-dir = ../release
|
||||
prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
|
||||
xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
|
||||
|
||||
announcement: NEWS ChangeLog $(distdir).tar.gz
|
||||
@( \
|
||||
echo Subject: $(distdir) released; \
|
||||
@@ -109,6 +113,12 @@ announcement: NEWS ChangeLog $(distdir).tar.gz
|
||||
echo " $$url/$(distdir).tar.gz"; \
|
||||
done; \
|
||||
echo; \
|
||||
echo And here are xdelta-style diffs; \
|
||||
echo; \
|
||||
for url in $(url_dir_list); do \
|
||||
echo " $$url/$(xd-delta)"; \
|
||||
done; \
|
||||
echo; \
|
||||
echo "$(md5) $(distdir).tar.gz"; \
|
||||
echo; \
|
||||
echo NEWS:; \
|
||||
@@ -123,12 +133,16 @@ announcement: NEWS ChangeLog $(distdir).tar.gz
|
||||
-e 'print "\n"."*"x70 ."\n"; s///; print; print "*"x70 ."\n"'; \
|
||||
)
|
||||
|
||||
release-archive-dir = ../release
|
||||
prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
|
||||
xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
|
||||
writable-files:
|
||||
for file in $(distdir).tar.gz $(xd-delta) \
|
||||
../release/$(distdir).tar.gz ../release/$(xd-delta); do \
|
||||
test -e $$file || continue; \
|
||||
test -w $$file \
|
||||
|| { echo ERROR: $$file is not writable; fail=1; }; \
|
||||
done; \
|
||||
test "$$fail" && exit 1 || :
|
||||
|
||||
alpha:
|
||||
$(MAKE) po-check
|
||||
alpha: writable-files po-check
|
||||
$(MAKE) cvs-dist
|
||||
$(MAKE) -s announcement > /tmp/announce-$(distdir)
|
||||
ln $(distdir).tar.gz ../release
|
||||
@@ -138,9 +152,9 @@ alpha:
|
||||
ln $(release-archive-dir)/$(xd-delta) .
|
||||
chmod a-w $(release-archive-dir)/$(xd-delta)
|
||||
@echo =====================================
|
||||
@for url in $(real_dir_list); do \
|
||||
echo "ncftp -u $$url/"; \
|
||||
done
|
||||
@echo '# mput $(xd-delta) $(distdir).tar.gz'
|
||||
@echo =====================================
|
||||
@echo 'scp $(xd-delta) $(distdir).tar.gz \'
|
||||
@echo ' $(b_host):$(b_real_dir)'
|
||||
@echo '# send the /tmp/announcement e-mail'
|
||||
@echo =====================================
|
||||
@echo =====================================
|
||||
|
||||
337
THANKS
337
THANKS
@@ -1,107 +1,236 @@
|
||||
This is just a start at listing e-mail addresses of contributors.
|
||||
The rest of the addresses are still in the ChangeLog.
|
||||
|
||||
Achim Blumensath: blume@corona.oche.de
|
||||
aldomel: aldomel@ix.netcom.com
|
||||
Alen Muzinic: zveki@fly.cc.fer.hr
|
||||
Akim Demaille: demaille@inf.enst.fr
|
||||
Alain Magloire: alain@qnx.com
|
||||
Alexey Solovyov: alekso@math.uu.se
|
||||
Andreas Jaeger: jaeger@gnu.org
|
||||
Andreas Schwab: schwab@suse.de
|
||||
Andres Soolo: andres@soolo.matti.ee
|
||||
Andrew Dalke: dalke@bioreason.com
|
||||
Andrew Tridgell: tridge@samba.org
|
||||
Andries Brouwer: Andries.Brouwer@cwi.nl
|
||||
Arne Henrik Juul: arnej@imf.unit.no
|
||||
Bauke Jan Douma: bjdouma@xs4all.nl
|
||||
Bengt Martensson: bengt@mathematik.uni-Bremen.de
|
||||
Bernd Leibing: bernd.leibing@rz.uni-ulm.de
|
||||
Bernhard Rosenkraenzer: bero@redhat.de
|
||||
Bjorn Helgaas: helgaas@rsn.hp.com
|
||||
Bob McCracken: kerouac@ravenet.com
|
||||
Bob Proulx: rwp@fc.hp.com
|
||||
Brendan O'Dea: bod@compusol.com.au
|
||||
Charles Karney: karney@pppl.gov
|
||||
Chip Salzenberg: chip@valinux.com
|
||||
Chris Yeo: cyeo@biking.org
|
||||
Christian von Roques: roques@pond.sub.org
|
||||
Colin Plumb: colin@nyx.net
|
||||
David Godfrey: dave@delta.demon.co.uk
|
||||
Dirk Lattermann: dlatt@t-online.de
|
||||
Don Parsons: dparsons@synapse.kent.edu
|
||||
Eirik Fuller: eirik@netcom.com
|
||||
Eli Zaretskii: eliz@is.elta.co.il
|
||||
Emile LeBlanc: leblanc@math.toronto.edu
|
||||
François Pinard: pinard@iro.umontreal.ca
|
||||
Galen Hazelwood: galenh@micron.net
|
||||
Germano Leichsenring: germano@jedi.cs.kobe-u.ac.jp
|
||||
Göran Uddeborg: goeran@uddeborg.pp.se
|
||||
Greg McGary: gkm@eng.ascend.com
|
||||
Gabor Z. Papp: gzp@gzp.org.hu
|
||||
Holger Berger: hberger@ess.nec.de
|
||||
Hugh Daniel: hugh@xanadu.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
|
||||
Jamie Lokier: jamie@imbolc.ucc.ie
|
||||
Janos Farkas: chexum@shadow.banki.hu
|
||||
Jesse Thilo: jgt2@eecs.lehigh.edu
|
||||
Joakim Rosqvist: dvljrt@cs.umu.se
|
||||
Joe Orton: joe@orton.demon.co.uk
|
||||
Johan Danielsson: joda@pdc.kth.se
|
||||
John Bley: jbb6@acpub.duke.edu
|
||||
John Gatewood Ham: zappaman@alphabox.compsci.buu.ac.th
|
||||
John Gotts: jgotts@umich.edu
|
||||
Jürgen Fluk: louis@dachau.marco.de
|
||||
jvogel: jvogel@linkny.com
|
||||
Kalle Olavi Niemitalo: tosi@stekt.oulu.fi
|
||||
Karl Heuer: kwzh@gnu.org
|
||||
Kjetil Torgrim Homme: kjetilho@ifi.uio.no
|
||||
Larry McVoy: lm@sgi.com
|
||||
Lars Hecking: lhecking@nmrc.ucc.ie
|
||||
Lorne Baker: lbaker@nitro.avint.net
|
||||
Marcus Daniels: marcus@sysc.pdx.edu
|
||||
Mark A. Thomas: thommark@access.digex.net
|
||||
Mark Harris: mark@monitor.designacc.com
|
||||
Mark Kettenis: kettenis@phys.uva.nl
|
||||
Martin Mitchell: martin@debian.org
|
||||
Marty Leisner: leisner@sdsp.mc.xerox.com
|
||||
Masami Takikawa: takikawm@CS.ORST.EDU
|
||||
Matthew S. Levine: mslevine@theory.lcs.mit.edu
|
||||
Matthew Swift: swift@alum.mit.edu
|
||||
Matthias Urlichs: smurf@noris.de
|
||||
Michiel Bacchiani: bacchian@raven.bu.edu
|
||||
Michael ???:michael@roka.net
|
||||
Michael Veksler: mveksler@techunix.technion.ac.il
|
||||
Michael Stone: mstone@debian.org
|
||||
Miles Bader: miles@gnu.ai.mit.edu
|
||||
Nelson H. F. Beebe: beebe@math.utah.edu
|
||||
Noel Cragg: noel@red-bean.com
|
||||
Olav Morkrid: olav@funcom.com
|
||||
Per Kristian Hove: perhov@math.ntnu.no
|
||||
Peter Eriksson: peter@ifm.liu.se
|
||||
Peter Moulder: reiter@netspace.net.au
|
||||
Peter Samuelson: psamuels@sampo.creighton.edu
|
||||
Paul Eggert: eggert@twinsun.com
|
||||
Paul Slootman: paul@debian.org
|
||||
Philippe De Muyter: phdm@macqel.be
|
||||
Rainer Orth: ro@TechFak.Uni-Bielefeld.DE
|
||||
Richard Braakman: dark@xs4all.nl
|
||||
Ross Ridge: rridge@calum.csclub.uwaterloo.ca
|
||||
Sami Farin: sfarin@ratol.fi
|
||||
Santiago Vila Doncel: sanvila@unex.es
|
||||
Scott Lurndal: slurn@griffin.engr.sgi.com
|
||||
Stuart Kemp: skemp@peter.bmc.com
|
||||
Thomas Bushnell, n/BSG: thomas@gnu.ai.mit.edu
|
||||
Ton Hospel: thospel@mail.dma.be
|
||||
Torbjorn Lindgren: tl@funcom.no
|
||||
Torsten Landschoff: torsten@pclab.ifg.uni-kiel.de
|
||||
Tony Leneis: tony@plaza.ds.adp.com
|
||||
Ulrich Drepper: drepper@cygnus.com
|
||||
Vin Shelton: acs@alumni.princeton.edu
|
||||
Volker Borchert: bt@teknon.de
|
||||
Wayne Stewart: wstewa@atl.com
|
||||
Wichert Akkerman: wichert@cistron.nl
|
||||
William Bader: william@nscs.fast.net
|
||||
Achim Blumensath blume@corona.oche.de
|
||||
Adam Klein aklein@debian.org
|
||||
Akim Demaille demaille@inf.enst.fr
|
||||
Alain Magloire alain@qnx.com
|
||||
Alberto Accomazzi alberto@cfa0.harvard.edu
|
||||
aldomel aldomel@ix.netcom.com
|
||||
Alen Muzinic zveki@fly.cc.fer.hr
|
||||
Alexey Solovyov alekso@math.uu.se
|
||||
Andre Novaes Cunha Andre.Cunha@br.global-one.net
|
||||
Andreas Jaeger jaeger@gnu.org
|
||||
Andreas Luik luik@isa.de
|
||||
Andreas Schwab schwab@suse.de
|
||||
Andreas Stolcke stolcke@ICSI.Berkeley.EDU
|
||||
Andres Soolo andres@soolo.matti.ee
|
||||
Andrew Dalke dalke@bioreason.com
|
||||
Andrew Tridgell tridge@samba.org
|
||||
Andries Brouwer Andries.Brouwer@cwi.nl
|
||||
Andy Longton alongton@metamark.com
|
||||
Ariel Faigon ariel@cthulhu.engr.sgi.com
|
||||
Arne H. Juul arnej@solan.unit.no
|
||||
Arne Henrik Juul arnej@imf.unit.no
|
||||
Arthur Pool pool@commerce.uq.edu.au
|
||||
Austin Donnelly Austin.Donnelly@cl.cam.ac.uk
|
||||
Bauke Jan Douma bjdouma@xs4all.nl
|
||||
Bengt Martensson bengt@mathematik.uni-Bremen.de
|
||||
Bernd Leibing bernd.leibing@rz.uni-ulm.de
|
||||
Bernhard Rosenkraenzer bero@redhat.de
|
||||
Bill Peters peters@gaffel.as.arizona.edu
|
||||
Bjorn Helgaas helgaas@rsn.hp.com
|
||||
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
|
||||
Carl Johnson carlj@cjlinux.home.org
|
||||
Carl Lowenstein cdl@mpl.UCSD.EDU
|
||||
Carlos Canau Carlos.Canau@relay.puug.pt
|
||||
Charles Karney karney@pppl.gov
|
||||
Chip Salzenberg chip@valinux.com
|
||||
Chris Yeo cyeo@biking.org
|
||||
Christi Alice Scarborough christi@chiark.greenend.org.uk
|
||||
Christian Krackowizer kra1@technodat.co.at
|
||||
Christian von Roques roques@pond.sub.org
|
||||
Chuck Hedrick hedrick@klinzhai.rutgers.edu
|
||||
Clark Morgan cmorgan@aracnet.com
|
||||
Colin Plumb colin@nyx.net
|
||||
Collin Rogowski collin@rogowski.de
|
||||
Dan Hagerty hag@gnu.ai.it.edu
|
||||
Daniel Bergstrom noa@melody.se
|
||||
David Dyck dcd@tc.fluke.COM
|
||||
David Godfrey dave@delta.demon.co.uk
|
||||
Dennis Henriksen opus@flamingo.osrl.dk
|
||||
Derek Clegg dclegg@next.com
|
||||
Dick Streefland dick_streefland@tasking.com
|
||||
Dirk Lattermann dlatt@t-online.de
|
||||
Dirk-Jan Faber djfaber@snow.nl
|
||||
Don Parsons dparsons@synapse.kent.edu
|
||||
Donni Erpel donald@appc11.gsi.de
|
||||
Doug McLaren dougmc@comco.com
|
||||
Ed Avis epa98@doc.ic.ac.uk
|
||||
Edzer Pebesma Edzer.Pebesma@rivm.nl
|
||||
Eirik Fuller eirik@netcom.com
|
||||
Eivind eivindt@multinet.no
|
||||
Eli Zaretskii eliz@is.elta.co.il
|
||||
Emile LeBlanc leblanc@math.toronto.edu
|
||||
Eric Backus ericb@lsid.hp.com
|
||||
Eric G. Miller egm2@jps.net
|
||||
Erik Bennett bennett@cvo.oneworld.com
|
||||
Erik Corry erik@kroete2.freinet.de
|
||||
Felix Lee flee@teleport.com
|
||||
Fletcher Mattox fletcher@cs.utexas.edu
|
||||
Florin Iucha fiucha@hsys.mic.ro
|
||||
Frank T Lofaro ftlofaro@snooks.Egr.UNLV.EDU
|
||||
François Pinard pinard@iro.umontreal.ca
|
||||
Fred Fish fnf@ninemoons.com
|
||||
Gabor Z. Papp gzp@gzp.org.hu
|
||||
Galen Hazelwood galenh@micron.net
|
||||
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
|
||||
Greg McGary gkm@gnu.org
|
||||
Greg Troxel gdt@bbn.com
|
||||
Greg Wooledge gawooledge@sherwin.com
|
||||
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 Lance Taylor ian@cygnus.com
|
||||
Ian Turner vectro@pipeline.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
|
||||
Jens Schmidt jms@jsds.hamburg.com
|
||||
Jerome Abela abela@hsc.fr
|
||||
Jesse Thilo jgt2@eecs.lehigh.edu
|
||||
Jim Blandy jimb@cyclic.com
|
||||
Jim Dennis jimd@starshine.org
|
||||
Joakim Rosqvist dvljrt@cs.umu.se
|
||||
Jochen Hein jochen.hein@delphi.central.de
|
||||
Joe Orton joe@orton.demon.co.uk
|
||||
Johan Danielsson joda@pdc.kth.se
|
||||
John Bley jbb6@acpub.duke.edu
|
||||
John Gatewood Ham zappaman@alphabox.compsci.buu.ac.th
|
||||
John Gotts jgotts@umich.edu
|
||||
John Kendall kendall@capps.com
|
||||
John Kodis kodis@acm.org
|
||||
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
|
||||
Joseph S. Myers jsm28@cam.ac.uk
|
||||
jvogel jvogel@linkny.com
|
||||
Jürgen Fluk louis@dachau.marco.de
|
||||
Kai-Uwe Rommel rommel@informatik.tu-muenchen.de
|
||||
Kalle Olavi Niemitalo tosi@stekt.oulu.fi
|
||||
Kamal Paul Nigam Kamal_Paul_Nigam@gs35.sp.cs.cmu.edu
|
||||
Karl Heuer kwzh@gnu.org
|
||||
Karsten Thygesen karthy@kom.auc.dk
|
||||
Kaveh R. Ghazi ghazi@caip.rutgers.edu
|
||||
Keith Owens kaos@audio.apana.org.au
|
||||
Ken Pizzini kenp@halcyon.com
|
||||
Kjetil Torgrim Homme kjetilho@ifi.uio.no
|
||||
Kristoffer Rose kris@diku.dk
|
||||
Larry McVoy lm@sgi.com
|
||||
Lars Hecking lhecking@nmrc.ucc.ie
|
||||
Lehti Rami rammer@cs.tut.fi
|
||||
Leonard N. Zubkoff lnz@dandelion.com
|
||||
Lorne Baker lbaker@nitro.avint.net
|
||||
Manas Garg manas@cygsoft.com
|
||||
Manfred Hollstein manfred@s-direktnet.de
|
||||
Marc Boucher marc@mbsi.ca
|
||||
Marcus Daniels marcus@ee.pdx.edu
|
||||
Mark A. Thomas thommark@access.digex.net
|
||||
Mark Harris mark@monitor.designacc.com
|
||||
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 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
|
||||
Matej Vela mvela@public.srce.hr
|
||||
Matthew Braun matthew@ans.net
|
||||
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 Hasselberg mikelh@zonta.ping.de
|
||||
Michael Stone mstone@debian.org
|
||||
Michael Stutz stutz@dsl.org
|
||||
Michael Veksler mveksler@techunix.technion.ac.il
|
||||
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
|
||||
Nelson H. F. Beebe beebe@math.utah.edu
|
||||
Niklas Edmundsson nikke@acc.umu.se
|
||||
Noah Friedman friedman@splode.com
|
||||
Noel Cragg noel@red-bean.com
|
||||
Olav Morkrid olav@funcom.com
|
||||
Paul Eggert eggert@twinsun.com
|
||||
Paul Nevai nevai@ops.mps.ohio-state.edu
|
||||
Paul Slootman paul@debian.org
|
||||
Per Kristian Hove perhov@math.ntnu.no
|
||||
Peter Eriksson peter@ifm.liu.se
|
||||
Peter Moulder reiter@netspace.net.au
|
||||
Peter Samuelson psamuels@sampo.creighton.edu
|
||||
Peter Seebach seebs@taniemarie.solon.com
|
||||
Phil Richards phil.richards@vf.vodafone.co.uk
|
||||
Philippe De Muyter phdm@macqel.be
|
||||
Philippe Schnoebelen Philippe.Schnoebelen@imag.fr
|
||||
Rainer Orth ro@TechFak.Uni-Bielefeld.DE
|
||||
Ralf W. Stephan stephan@tmt.de
|
||||
Ralph Loader loader@maths.ox.ac.uk
|
||||
Raul Miller moth@magenta.com
|
||||
Richard Braakman dark@xs4all.nl
|
||||
Richard J. Rauenzahn rrauenza@hairball.cup.hp.com
|
||||
Richard Sharman rsharman@magmacom.com
|
||||
Rick Sladkey jrs@world.std.com
|
||||
Rik Faith faith@cs.unc.edu
|
||||
Risto Kankkunen kankkune@lingsoft.fi
|
||||
Robert H. de Vries robert@and.nl
|
||||
Rogier Wolff R.E.Wolff@BitWizard.nl
|
||||
Ronald F. Guilmette rfg@netcom.com
|
||||
Ross Alexander r.alexander@auckland.ac.nz
|
||||
Ross Paterson rap@doc.ic.ac.uk
|
||||
Ross Ridge rridge@calum.csclub.uwaterloo.ca
|
||||
Sami Farin sfarin@ratol.fi
|
||||
Samuli Karkkainen Samuli.Karkkainen@hut.fi
|
||||
Sander van Malssen svm@kozmix.ow.nl
|
||||
Santiago Vila Doncel sanvila@unex.es
|
||||
Savochkin Andrey Vladimirovich saw@msu.ru
|
||||
Scott Lurndal slurn@griffin.engr.sgi.com
|
||||
Stephen Gildea gildea@x.org
|
||||
Steve McConnel steve@acadcomp.sil.org
|
||||
Stuart Kemp skemp@peter.bmc.com
|
||||
Tadayoshi Funaba tadf@kt.rim.or.jp
|
||||
Theodore Ts'o tytso@rsts-11.mit.edu
|
||||
Thomas Bushnell thomas@gnu.ai.mit.edu
|
||||
Thomas Quinot thomas@Cuivre.FR.EU.ORG
|
||||
Tim Smithers mouse@dmouse.com.au
|
||||
Tim Waugh twaugh@redhat
|
||||
Tom Quinn trq@dionysos.thphys.ox.ac.uk
|
||||
Ton Hospel thospel@mail.dma.be
|
||||
Tony Leneis tony@plaza.ds.adp.com
|
||||
Tony Robinson ajr@eng.cam.ac.uk
|
||||
Torbjorn Granlund tege@nada.kth.se
|
||||
Torbjorn Lindgren tl@funcom.no
|
||||
Torsten Landschoff torsten@pclab.ifg.uni-kiel.de
|
||||
Ulrich Drepper drepper@gnu.org
|
||||
Urs Thuermann urs@isnogud.escape.de
|
||||
Vin Shelton acs@alumni.princeton.edu
|
||||
Volker Borchert bt@teknon.de
|
||||
Wayne Stewart wstewa@atl.com
|
||||
Wichert Akkerman wichert@cistron.nl
|
||||
Will Edgington wedgingt@acm.org
|
||||
William Bader william@nscs.fast.net
|
||||
William Dowling will@franklin.com
|
||||
William Lewis wiml@omnigroup.com
|
||||
Wolfram Kleff kleff@cs.uni-bonn.de
|
||||
Zvi Har'El rl@math.technion.ac.il
|
||||
Ørn E. Hansen oehansen@daimi.aau.dk
|
||||
|
||||
@@ -71,8 +71,10 @@ CXXCPP = @CXXCPP@
|
||||
DATADIRNAME = @DATADIRNAME@
|
||||
DEPDIR = @DEPDIR@
|
||||
DF_PROG = @DF_PROG@
|
||||
FESETROUND_LIBM = @FESETROUND_LIBM@
|
||||
GENCAT = @GENCAT@
|
||||
GETCONF = @GETCONF@
|
||||
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
|
||||
GMOFILES = @GMOFILES@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GNU_PACKAGE = @GNU_PACKAGE@
|
||||
@@ -83,14 +85,22 @@ INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
KMEM_GROUP = @KMEM_GROUP@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIB_CRYPT = @LIB_CRYPT@
|
||||
MAN = @MAN@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
NEED_SETGID = @NEED_SETGID@
|
||||
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
|
||||
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
|
||||
PACKAGE = @PACKAGE@
|
||||
PERL = @PERL@
|
||||
POFILES = @POFILES@
|
||||
POSUB = @POSUB@
|
||||
POW_LIBM = @POW_LIBM@
|
||||
RANLIB = @RANLIB@
|
||||
SQRT_LIBM = @SQRT_LIBM@
|
||||
U = @U@
|
||||
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||
USE_NLS = @USE_NLS@
|
||||
|
||||
@@ -3143,8 +3143,8 @@ The program accepts the following options. Also see @ref{Common options}.
|
||||
@opindex --format=@var{format}
|
||||
@cindex formatting of numbers in @code{seq}
|
||||
Print all numbers using @var{format}; default @samp{%g}.
|
||||
@var{format} must contain exactly one of the standarding float output
|
||||
formats @samp{%e}, @samp{%f}, or @samp{%g}.
|
||||
@var{format} must contain exactly one of the standarding floating point
|
||||
output formats @samp{%e}, @samp{%f}, or @samp{%g}.
|
||||
|
||||
@item -s @var{string}
|
||||
@itemx --separator=@var{string}
|
||||
@@ -3159,6 +3159,66 @@ Print all numbers with the same width, by padding with leading zeroes.
|
||||
|
||||
@end table
|
||||
|
||||
If you want to use @code{seq} to print sequences of large integer values,
|
||||
don't use the default @samp{%g} format since it can result in
|
||||
loss of precision:
|
||||
|
||||
@example
|
||||
$ seq 1000000 1000001
|
||||
1e+06
|
||||
1e+06
|
||||
@end example
|
||||
|
||||
Instead, you can use the format, @samp{%1.f},
|
||||
to print large decimal numbers with no exponent and no decimal point.
|
||||
|
||||
@example
|
||||
$ seq --format=%1.f 1000000 1000001
|
||||
1000000
|
||||
1000001
|
||||
@end example
|
||||
|
||||
If you want hexadecimal output, you can use @code{printf}
|
||||
to perform the conversion:
|
||||
|
||||
@example
|
||||
$ printf %x'\n' `seq -f %1.f 1048575 1024 1050623`
|
||||
fffff
|
||||
1003ff
|
||||
1007ff
|
||||
@end example
|
||||
|
||||
For very long lists of numbers, use xargs to avoid
|
||||
system limitations on the length of an argument list:
|
||||
|
||||
@example
|
||||
$ seq -f %1.f 1000000 | xargs printf %x'\n' |tail -3
|
||||
f423e
|
||||
f423f
|
||||
f4240
|
||||
@end example
|
||||
|
||||
To generate octal output, use the printf @code{%o} format instead
|
||||
of @code{%x}. Note however that using printf works only for numbers
|
||||
smaller than @code{2^32}:
|
||||
|
||||
@example
|
||||
$ printf "%x\n" `seq -f %1.f 4294967295 4294967296`
|
||||
ffffffff
|
||||
bash: printf: 4294967296: Numerical result out of range
|
||||
@end example
|
||||
|
||||
On most systems, seq can produce whole-number output for values up to
|
||||
@code{2^53}, so here's a more general approach to base conversion that
|
||||
also happens to be more robust for such large numbers. It works by
|
||||
using @code{bc} and setting its output radix variable, @var{obase},
|
||||
to @samp{16} in this case to produce hexadecimal output.
|
||||
|
||||
@example
|
||||
$ (echo obase=16; seq -f %1.f 4294967295 4294967296)|bc
|
||||
FFFFFFFF
|
||||
100000000
|
||||
@end example
|
||||
|
||||
@node Index
|
||||
@unnumbered Index
|
||||
|
||||
176
lib/.gdb-history
176
lib/.gdb-history
@@ -19,3 +19,179 @@ n
|
||||
p (he->h_addrtype)
|
||||
n
|
||||
q
|
||||
r a:b
|
||||
b main
|
||||
r a:b
|
||||
n
|
||||
s
|
||||
n
|
||||
p separator
|
||||
n
|
||||
l 128
|
||||
c
|
||||
q
|
||||
r meyering:store
|
||||
p *username
|
||||
p *username[separator - name]
|
||||
p separator - name
|
||||
p username[separator - name]
|
||||
r ''
|
||||
l
|
||||
q
|
||||
r ''
|
||||
l
|
||||
q
|
||||
r meyering
|
||||
b main
|
||||
r meyering
|
||||
n
|
||||
r
|
||||
n
|
||||
s
|
||||
n
|
||||
p u
|
||||
n
|
||||
n
|
||||
q
|
||||
r ''
|
||||
r meyering
|
||||
up
|
||||
l
|
||||
q
|
||||
b main
|
||||
b a.out 1
|
||||
r a.out 1
|
||||
n
|
||||
s
|
||||
fin
|
||||
s
|
||||
n
|
||||
p uid
|
||||
p gid
|
||||
p euid
|
||||
p egid
|
||||
n
|
||||
p mode
|
||||
p path
|
||||
fin
|
||||
r -v -c 10 -n 20 -x 80 < in-2
|
||||
up
|
||||
up
|
||||
p &dummy
|
||||
p *ovp
|
||||
p *(int*)*ovp
|
||||
p ((struct item*)*ovp)->key
|
||||
p old_vec@10
|
||||
r -v -c 10 -n 20 -x 80 < in-3
|
||||
p *(int*)*ovp
|
||||
up
|
||||
dow
|
||||
p *(int*)*ovp
|
||||
up
|
||||
p *(int*)*ovp
|
||||
i loca
|
||||
dow
|
||||
p key
|
||||
p dummy
|
||||
p &dummy
|
||||
up
|
||||
p old_vec
|
||||
p *ovp
|
||||
p ovp
|
||||
p ovp - old_vec
|
||||
p *old_vec@10
|
||||
p *old_vec@13
|
||||
b hash_insert_item
|
||||
r
|
||||
b hash_insert_item_at
|
||||
r
|
||||
n
|
||||
p fail
|
||||
p *(ht->vec)@13
|
||||
p *(ht->ht_vec)@13
|
||||
p ((struct item*)(ht->ht_vec)[10])->key
|
||||
b hash_delete_item
|
||||
b hash_delete_item_at
|
||||
c
|
||||
n
|
||||
p slot
|
||||
p item
|
||||
n
|
||||
n
|
||||
p *(ht->ht_vec)@13
|
||||
p &dummy
|
||||
p dummy
|
||||
n
|
||||
s
|
||||
n
|
||||
n
|
||||
p *(ht->ht_vec)@13
|
||||
n
|
||||
p new_size
|
||||
n
|
||||
p *old_vec@13
|
||||
p old_vec@13
|
||||
n
|
||||
p *old_vec@13
|
||||
n
|
||||
p *old_vec@13
|
||||
n
|
||||
l
|
||||
n
|
||||
p ovp - old_vec
|
||||
n
|
||||
p ovp - old_vec
|
||||
n
|
||||
p ovp - old_vec
|
||||
p *old_vec@13
|
||||
p &dummy
|
||||
q
|
||||
r 444444444444 44444444444
|
||||
b human_readable
|
||||
r
|
||||
n
|
||||
q
|
||||
b main
|
||||
r 444444444444 44444444444
|
||||
n
|
||||
p a
|
||||
p b
|
||||
r 34343434 3434343434
|
||||
c
|
||||
r
|
||||
n
|
||||
n
|
||||
p a
|
||||
p b
|
||||
r 343434343 343434343
|
||||
c
|
||||
q
|
||||
b posixtime
|
||||
r
|
||||
n
|
||||
s
|
||||
n
|
||||
p len
|
||||
n
|
||||
p pair
|
||||
p len
|
||||
n
|
||||
b year
|
||||
y
|
||||
c
|
||||
c
|
||||
p n
|
||||
up
|
||||
p len
|
||||
q
|
||||
complete b user
|
||||
complete b user
|
||||
complete b pars
|
||||
b parse_user_spec
|
||||
r a.b
|
||||
n
|
||||
n
|
||||
p u
|
||||
n
|
||||
p u
|
||||
n
|
||||
|
||||
144
lib/ChangeLog
Normal file
144
lib/ChangeLog
Normal file
@@ -0,0 +1,144 @@
|
||||
2000-02-27 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
|
||||
Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
|
||||
|
||||
* backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
|
||||
not `#if STDC_HEADERS'.
|
||||
Declare malloc if needed.
|
||||
|
||||
* backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
|
||||
now that autoconf always defines the HAVE_DECL_ symbols.
|
||||
* human.c: Likewise.
|
||||
* same.c: Likewise.
|
||||
* strtoumax.c: Likewise.
|
||||
|
||||
* backupfile.c: Arrange for cpp to fail if the configure-time
|
||||
declaration check was not run.
|
||||
* hash.c: Likewise.
|
||||
* human.c: Likewise.
|
||||
* same.c: Likewise.
|
||||
* strtoumax.c: Likewise.
|
||||
|
||||
* userspec.c (parse_user_spec): If there is no `:' but there is a `.',
|
||||
then first look up the entire `.'-containing string as a login name.
|
||||
|
||||
2000-02-18 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* lib/getdate.y: Handle two-digit years with leading zeros correctly.
|
||||
(textint): New typedef.
|
||||
(parser_control): Member year changed from int to textint.
|
||||
All uses changed.
|
||||
(YYSTYPE): Removed; replaced by %union with int and textint members.
|
||||
(tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
|
||||
tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
|
||||
tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
|
||||
(tSNUMBER, tUNUMBER): Now of type <textintval>.
|
||||
(date, number, to_year): Use width of number in digits, not its value,
|
||||
to determine whether it's a 2-digit year, or a 2-digit time.
|
||||
(yylex): Store number of digits of numeric tokens.
|
||||
Reported by John Kendall.
|
||||
|
||||
(parser_control): Changed from struct parser_control to typedef (for
|
||||
consistency). All uses changed.
|
||||
|
||||
(tID): Removed; not used.
|
||||
(yylex): Return '?' for unknown identifiers, rather than (unused) tID.
|
||||
|
||||
2000-02-14 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* lib/getpagesize.h (getpagesize): Port to VMS for Alpha;
|
||||
adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
|
||||
|
||||
2000-02-12 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* userspec.c (ISDIGIT): Define it.
|
||||
(isdigit): Remove definition.
|
||||
(is_number): Use ISDIGIT, not isdigit.
|
||||
<libintl.h>: Include.
|
||||
(_ and N_): Define.
|
||||
(parse_user_spec): Mark translatable strings.
|
||||
|
||||
2000-02-10 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
With these changes, nanosleep.[ch] are finally enough like the other
|
||||
lib/* replacement files to compile on a few more losing systems.
|
||||
|
||||
* nanosleep.h: Don't include config.h.
|
||||
Remove prototype from declaration of nanosleep.
|
||||
(PARAMS): Remove now-unneeded definition.
|
||||
* nanosleep.c: #undef nanosleep.
|
||||
(rpl_nanosleep): Rename from nanosleep.
|
||||
|
||||
2000-02-03 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
|
||||
rather than with `#if HAVE_UTMPNAME'.
|
||||
|
||||
2000-02-01 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* readutmp.h (UT_USER): Add parens. From Andreas Schwab.
|
||||
|
||||
2000-01-31 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* nanosleep.h (nanosleep): Guard declaration with
|
||||
`#if ! HAVE_DECL_NANOSLEEP'.
|
||||
Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
|
||||
the declaration in that vendor's sys/timers.h.
|
||||
Reported by Christian Krackowizer.
|
||||
|
||||
* quotearg.c (ISASCII): Add #undef and move definition to follow
|
||||
inclusion of wctype.h to work around solaris2.6 namespace pollution.
|
||||
(ISPRINT): Likewise.
|
||||
Reported by Tom Tromey.
|
||||
|
||||
2000-01-30 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
|
||||
uses of ->ut_name. The latter doesn't work with new Linux header files
|
||||
where only utmpx.ut_user is declared.
|
||||
|
||||
* readutmp.h (UT_USER): Define.
|
||||
|
||||
2000-01-23 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
|
||||
obstack.c.
|
||||
|
||||
2000-01-22 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
|
||||
[! HAVE_DECL_STRTOULL]: Declare strtoull.
|
||||
Required for some AIX systems. Reported by Christian Krackowizer.
|
||||
[TESTING] (main): New function.
|
||||
|
||||
1997-10-17 Eli Zaretskii <eliz@is.elta.co.il>
|
||||
* dirname.c (dir_name): Support for DOS-style file names with drive
|
||||
letters.
|
||||
|
||||
* quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
|
||||
|
||||
* strverscmp.c (ISDIGIT): Define.
|
||||
(strverscmp): Use ISDIGIT, not isdigit.
|
||||
|
||||
2000-01-17 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* nanosleep.c (nanosleep):
|
||||
Don't use SA_INTERRUPT to decide whether to call sigaction, as
|
||||
POSIX.1 doesn't require SA_INTERRUPT and some systems
|
||||
(e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
|
||||
it's been part of POSIX.1 since day 1 (in 1988).
|
||||
|
||||
2000-01-17 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* interlock: Remove unused file. Reported by François Pinard.
|
||||
|
||||
2000-01-16 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* lib/quotearg.c (quotearg_buffer_restyled): Do not quote
|
||||
alert, backslash, formfeed, and vertical tab unnecessarily in
|
||||
shell quoting style.
|
||||
|
||||
Local Variables:
|
||||
version-control: never
|
||||
End:
|
||||
@@ -2,30 +2,32 @@
|
||||
|
||||
AUTOMAKE_OPTIONS = ../src/ansi2knr
|
||||
|
||||
noinst_LIBRARIES = libfu.a
|
||||
noinst_LIBRARIES = libfetish.a
|
||||
|
||||
INCLUDES = -I.. -I$(srcdir) -I../intl
|
||||
|
||||
libfu_a_SOURCES = getdate.y posixtm.c getopt.c getopt1.c \
|
||||
addext.c argmatch.c backupfile.c basename.c \
|
||||
closeout.c dirname.c exclude.c filemode.c \
|
||||
full-write.c human.c idcache.c \
|
||||
isdir.c long-options.c makepath.c modechange.c hash.c path-concat.c \
|
||||
quotearg.c safe-read.c same.c save-cwd.c savedir.c stripslash.c userspec.c \
|
||||
version-etc.c xgetcwd.c xmalloc.c xstrdup.c \
|
||||
xstrtol.c xstrtoul.c xstrtoumax.c yesno.c
|
||||
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 \
|
||||
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 \
|
||||
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
|
||||
|
||||
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
|
||||
libfetish_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
|
||||
|
||||
noinst_HEADERS = argmatch.h backupfile.h closeout.h \
|
||||
dirname.h error.h exclude.h filemode.h fnmatch.h fsusage.h \
|
||||
getdate.h getline.h getopt.h getpagesize.h \
|
||||
group-member.h human.h lchown.h long-options.h \
|
||||
makepath.h modechange.h mountlist.h hash.h path-concat.h pathmax.h \
|
||||
posixtm.h quotearg.h regex.h safe-read.h same.h save-cwd.h \
|
||||
savedir.h strverscmp.h \
|
||||
version-etc.h xalloc.h xstrtol.h
|
||||
noinst_HEADERS = \
|
||||
argmatch.h backupfile.h bumpalloc.h closeout.h diacrit.h dirname.h error.h \
|
||||
exclude.h filemode.h fnmatch.h fsusage.h getdate.h getline.h getopt.h \
|
||||
getpagesize.h group-member.h hard-locale.h hash.h human.h lchown.h \
|
||||
linebuffer.h long-options.h md5.h memcasecmp.h memcoll.h \
|
||||
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
|
||||
|
||||
BUILT_SOURCES = getdate.c lstat.c stat.c
|
||||
MAINTAINERCLEANFILES = $(BUILT_SOURCES)
|
||||
|
||||
249
lib/Makefile.in
249
lib/Makefile.in
@@ -71,8 +71,10 @@ CXXCPP = @CXXCPP@
|
||||
DATADIRNAME = @DATADIRNAME@
|
||||
DEPDIR = @DEPDIR@
|
||||
DF_PROG = @DF_PROG@
|
||||
FESETROUND_LIBM = @FESETROUND_LIBM@
|
||||
GENCAT = @GENCAT@
|
||||
GETCONF = @GETCONF@
|
||||
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
|
||||
GMOFILES = @GMOFILES@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GNU_PACKAGE = @GNU_PACKAGE@
|
||||
@@ -83,15 +85,23 @@ INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
KMEM_GROUP = @KMEM_GROUP@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIB_CRYPT = @LIB_CRYPT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MAN = @MAN@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
NEED_SETGID = @NEED_SETGID@
|
||||
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
|
||||
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
|
||||
PACKAGE = @PACKAGE@
|
||||
PERL = @PERL@
|
||||
POFILES = @POFILES@
|
||||
POSUB = @POSUB@
|
||||
POW_LIBM = @POW_LIBM@
|
||||
RANLIB = @RANLIB@
|
||||
SQRT_LIBM = @SQRT_LIBM@
|
||||
U = @U@
|
||||
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||
USE_NLS = @USE_NLS@
|
||||
@@ -103,31 +113,33 @@ l = @l@
|
||||
|
||||
AUTOMAKE_OPTIONS = ../src/ansi2knr
|
||||
|
||||
noinst_LIBRARIES = libfu.a
|
||||
noinst_LIBRARIES = libfetish.a
|
||||
|
||||
INCLUDES = -I.. -I$(srcdir) -I../intl
|
||||
|
||||
libfu_a_SOURCES = getdate.y posixtm.c getopt.c getopt1.c \
|
||||
addext.c argmatch.c backupfile.c basename.c \
|
||||
closeout.c dirname.c exclude.c filemode.c \
|
||||
full-write.c human.c idcache.c \
|
||||
isdir.c long-options.c makepath.c modechange.c hash.c path-concat.c \
|
||||
quotearg.c safe-read.c same.c save-cwd.c savedir.c stripslash.c userspec.c \
|
||||
version-etc.c xgetcwd.c xmalloc.c xstrdup.c \
|
||||
xstrtol.c xstrtoul.c xstrtoumax.c yesno.c
|
||||
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 \
|
||||
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 \
|
||||
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
|
||||
|
||||
|
||||
libfu_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
libfu_a_DEPENDENCIES = $(libfu_a_LIBADD)
|
||||
libfetish_a_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
libfetish_a_DEPENDENCIES = $(libfetish_a_LIBADD)
|
||||
|
||||
noinst_HEADERS = argmatch.h backupfile.h closeout.h \
|
||||
dirname.h error.h exclude.h filemode.h fnmatch.h fsusage.h \
|
||||
getdate.h getline.h getopt.h getpagesize.h \
|
||||
group-member.h human.h lchown.h long-options.h \
|
||||
makepath.h modechange.h mountlist.h hash.h path-concat.h pathmax.h \
|
||||
posixtm.h quotearg.h regex.h safe-read.h same.h save-cwd.h \
|
||||
savedir.h strverscmp.h \
|
||||
version-etc.h xalloc.h xstrtol.h
|
||||
noinst_HEADERS = \
|
||||
argmatch.h backupfile.h bumpalloc.h closeout.h diacrit.h dirname.h error.h \
|
||||
exclude.h filemode.h fnmatch.h fsusage.h getdate.h getline.h getopt.h \
|
||||
getpagesize.h group-member.h hard-locale.h hash.h human.h lchown.h \
|
||||
linebuffer.h long-options.h md5.h memcasecmp.h memcoll.h \
|
||||
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
|
||||
|
||||
|
||||
BUILT_SOURCES = getdate.c lstat.c stat.c
|
||||
@@ -147,32 +159,35 @@ CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
ANSI2KNR = ../src/ansi2knr
|
||||
libfu_a_AR = $(AR) cru
|
||||
am_libfu_a_OBJECTS = getdate$U.o posixtm$U.o getopt$U.o getopt1$U.o \
|
||||
addext$U.o argmatch$U.o backupfile$U.o basename$U.o closeout$U.o \
|
||||
dirname$U.o exclude$U.o filemode$U.o full-write$U.o human$U.o \
|
||||
idcache$U.o isdir$U.o long-options$U.o makepath$U.o modechange$U.o \
|
||||
hash$U.o path-concat$U.o quotearg$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 xmalloc$U.o xstrdup$U.o xstrtol$U.o xstrtoul$U.o \
|
||||
xstrtoumax$U.o yesno$U.o
|
||||
libfu_a_OBJECTS = $(am_libfu_a_OBJECTS)
|
||||
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 \
|
||||
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
|
||||
libfetish_a_OBJECTS = $(am_libfetish_a_OBJECTS)
|
||||
AR = ar
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CFLAGS = @CFLAGS@
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_SOURCES = $(libfu_a_SOURCES)
|
||||
DIST_SOURCES = $(libfetish_a_SOURCES)
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
|
||||
DIST_COMMON = $(noinst_HEADERS) 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 getline.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 realloc.c regex.c \
|
||||
rmdir.c rpmatch.c stpcpy.c strcasecmp.c strdup.c strftime.c \
|
||||
strncasecmp.c strndup.c strstr.c strtol.c strtoul.c strtoull.c \
|
||||
strtoumax.c strverscmp.c utime.c
|
||||
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)
|
||||
@@ -181,33 +196,41 @@ 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)/basename$U.Po $(DEPDIR)/chown.Po $(DEPDIR)/closeout$U.Po \
|
||||
$(DEPDIR)/dirname$U.Po $(DEPDIR)/dup2.Po $(DEPDIR)/error.Po \
|
||||
$(DEPDIR)/euidaccess.Po $(DEPDIR)/exclude$U.Po $(DEPDIR)/fileblocks.Po \
|
||||
$(DEPDIR)/filemode$U.Po $(DEPDIR)/fnmatch.Po $(DEPDIR)/fsusage.Po \
|
||||
$(DEPDIR)/ftruncate.Po $(DEPDIR)/full-write$U.Po $(DEPDIR)/getdate$U.Po \
|
||||
$(DEPDIR)/getgroups.Po $(DEPDIR)/getline.Po $(DEPDIR)/getopt$U.Po \
|
||||
$(DEPDIR)/getopt1$U.Po $(DEPDIR)/group-member.Po $(DEPDIR)/hash$U.Po \
|
||||
$(DEPDIR)/human$U.Po $(DEPDIR)/idcache$U.Po $(DEPDIR)/isdir$U.Po \
|
||||
$(DEPDIR)/lchown.Po $(DEPDIR)/long-options$U.Po $(DEPDIR)/lstat.Po \
|
||||
$(DEPDIR)/makepath$U.Po $(DEPDIR)/malloc.Po $(DEPDIR)/memchr.Po \
|
||||
$(DEPDIR)/memcmp.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)/quotearg$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)/stpcpy.Po $(DEPDIR)/strcasecmp.Po \
|
||||
$(DEPDIR)/basename$U.Po $(DEPDIR)/canon-host$U.Po $(DEPDIR)/chown.Po \
|
||||
$(DEPDIR)/closeout$U.Po $(DEPDIR)/diacrit$U.Po $(DEPDIR)/dirname$U.Po \
|
||||
$(DEPDIR)/dup2.Po $(DEPDIR)/error.Po $(DEPDIR)/euidaccess.Po \
|
||||
$(DEPDIR)/exclude$U.Po $(DEPDIR)/fileblocks.Po $(DEPDIR)/filemode$U.Po \
|
||||
$(DEPDIR)/fnmatch.Po $(DEPDIR)/fsusage.Po $(DEPDIR)/ftruncate.Po \
|
||||
$(DEPDIR)/full-write$U.Po $(DEPDIR)/getdate$U.Po $(DEPDIR)/getgroups.Po \
|
||||
$(DEPDIR)/gethostname.Po $(DEPDIR)/getline.Po $(DEPDIR)/getloadavg.Po \
|
||||
$(DEPDIR)/getopt$U.Po $(DEPDIR)/getopt1$U.Po $(DEPDIR)/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)/strstr.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)/xmalloc$U.Po $(DEPDIR)/xstrdup$U.Po $(DEPDIR)/xstrtol$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
|
||||
SOURCES = $(libfu_a_SOURCES)
|
||||
OBJECTS = $(am_libfu_a_OBJECTS)
|
||||
SOURCES = $(libfetish_a_SOURCES)
|
||||
OBJECTS = $(am_libfetish_a_OBJECTS)
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
@@ -254,10 +277,10 @@ distclean-kr:
|
||||
|
||||
maintainer-clean-kr:
|
||||
|
||||
libfu.a: $(libfu_a_OBJECTS) $(libfu_a_DEPENDENCIES)
|
||||
-rm -f libfu.a
|
||||
$(libfu_a_AR) libfu.a $(libfu_a_OBJECTS) $(libfu_a_LIBADD)
|
||||
$(RANLIB) libfu.a
|
||||
libfetish.a: $(libfetish_a_OBJECTS) $(libfetish_a_DEPENDENCIES)
|
||||
-rm -f libfetish.a
|
||||
$(libfetish_a_AR) libfetish.a $(libfetish_a_OBJECTS) $(libfetish_a_LIBADD)
|
||||
$(RANLIB) libfetish.a
|
||||
addext_.c: addext.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/addext.c; then echo $(srcdir)/addext.c; else echo addext.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > addext_.c
|
||||
alloca_.c: alloca.c $(ANSI2KNR)
|
||||
@@ -268,10 +291,14 @@ 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)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/basename.c; then echo $(srcdir)/basename.c; else echo basename.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > basename_.c
|
||||
canon-host_.c: canon-host.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/canon-host.c; then echo $(srcdir)/canon-host.c; else echo canon-host.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > canon-host_.c
|
||||
chown_.c: chown.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/chown.c; then echo $(srcdir)/chown.c; else echo chown.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > chown_.c
|
||||
closeout_.c: closeout.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/closeout.c; then echo $(srcdir)/closeout.c; else echo closeout.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > closeout_.c
|
||||
diacrit_.c: diacrit.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/diacrit.c; then echo $(srcdir)/diacrit.c; else echo diacrit.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > diacrit_.c
|
||||
dirname_.c: dirname.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/dirname.c; then echo $(srcdir)/dirname.c; else echo dirname.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > dirname_.c
|
||||
dup2_.c: dup2.c $(ANSI2KNR)
|
||||
@@ -298,14 +325,24 @@ getdate_.c: getdate.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getdate.c; then echo $(srcdir)/getdate.c; else echo getdate.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getdate_.c
|
||||
getgroups_.c: getgroups.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getgroups.c; then echo $(srcdir)/getgroups.c; else echo getgroups.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getgroups_.c
|
||||
gethostname_.c: gethostname.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/gethostname.c; then echo $(srcdir)/gethostname.c; else echo gethostname.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > gethostname_.c
|
||||
getline_.c: getline.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getline.c; then echo $(srcdir)/getline.c; else echo getline.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getline_.c
|
||||
getloadavg_.c: getloadavg.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getloadavg.c; then echo $(srcdir)/getloadavg.c; else echo getloadavg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getloadavg_.c
|
||||
getopt_.c: getopt.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt_.c
|
||||
getopt1_.c: getopt1.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt1_.c
|
||||
getugroups_.c: getugroups.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getugroups.c; then echo $(srcdir)/getugroups.c; else echo getugroups.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getugroups_.c
|
||||
getusershell_.c: getusershell.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getusershell.c; then echo $(srcdir)/getusershell.c; else echo getusershell.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getusershell_.c
|
||||
group-member_.c: group-member.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/group-member.c; then echo $(srcdir)/group-member.c; else echo group-member.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > group-member_.c
|
||||
hard-locale_.c: hard-locale.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/hard-locale.c; then echo $(srcdir)/hard-locale.c; else echo hard-locale.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > hard-locale_.c
|
||||
hash_.c: hash.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/hash.c; then echo $(srcdir)/hash.c; else echo hash.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > hash_.c
|
||||
human_.c: human.c $(ANSI2KNR)
|
||||
@@ -316,6 +353,8 @@ isdir_.c: isdir.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/isdir.c; then echo $(srcdir)/isdir.c; else echo isdir.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > isdir_.c
|
||||
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
|
||||
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)
|
||||
@@ -324,10 +363,16 @@ makepath_.c: makepath.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/makepath.c; then echo $(srcdir)/makepath.c; else echo makepath.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > makepath_.c
|
||||
malloc_.c: malloc.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/malloc.c; then echo $(srcdir)/malloc.c; else echo malloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > malloc_.c
|
||||
md5_.c: md5.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/md5.c; then echo $(srcdir)/md5.c; else echo md5.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > md5_.c
|
||||
memcasecmp_.c: memcasecmp.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcasecmp.c; then echo $(srcdir)/memcasecmp.c; else echo memcasecmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcasecmp_.c
|
||||
memchr_.c: memchr.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memchr.c; then echo $(srcdir)/memchr.c; else echo memchr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memchr_.c
|
||||
memcmp_.c: memcmp.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcmp.c; then echo $(srcdir)/memcmp.c; else echo memcmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcmp_.c
|
||||
memcoll_.c: memcoll.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcoll.c; then echo $(srcdir)/memcoll.c; else echo memcoll.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcoll_.c
|
||||
memcpy_.c: memcpy.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/memcpy.c; then echo $(srcdir)/memcpy.c; else echo memcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > memcpy_.c
|
||||
memmove_.c: memmove.c $(ANSI2KNR)
|
||||
@@ -350,8 +395,14 @@ path-concat_.c: path-concat.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/path-concat.c; then echo $(srcdir)/path-concat.c; else echo path-concat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > path-concat_.c
|
||||
posixtm_.c: posixtm.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/posixtm.c; then echo $(srcdir)/posixtm.c; else echo posixtm.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > posixtm_.c
|
||||
putenv_.c: putenv.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/putenv.c; then echo $(srcdir)/putenv.c; else echo putenv.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > putenv_.c
|
||||
quotearg_.c: quotearg.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/quotearg.c; then echo $(srcdir)/quotearg.c; else echo quotearg.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > quotearg_.c
|
||||
readtokens_.c: readtokens.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/readtokens.c; then echo $(srcdir)/readtokens.c; else echo readtokens.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > readtokens_.c
|
||||
readutmp_.c: readutmp.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/readutmp.c; then echo $(srcdir)/readutmp.c; else echo readutmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > readutmp_.c
|
||||
realloc_.c: realloc.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/realloc.c; then echo $(srcdir)/realloc.c; else echo realloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > realloc_.c
|
||||
regex_.c: regex.c $(ANSI2KNR)
|
||||
@@ -370,10 +421,14 @@ savedir_.c: savedir.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/savedir.c; then echo $(srcdir)/savedir.c; else echo savedir.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > savedir_.c
|
||||
stat_.c: stat.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stat.c; then echo $(srcdir)/stat.c; else echo stat.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stat_.c
|
||||
stime_.c: stime.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stime.c; then echo $(srcdir)/stime.c; else echo stime.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stime_.c
|
||||
stpcpy_.c: stpcpy.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/stpcpy.c; then echo $(srcdir)/stpcpy.c; else echo stpcpy.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > stpcpy_.c
|
||||
strcasecmp_.c: strcasecmp.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strcasecmp.c; then echo $(srcdir)/strcasecmp.c; else echo strcasecmp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strcasecmp_.c
|
||||
strcspn_.c: strcspn.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strcspn.c; then echo $(srcdir)/strcspn.c; else echo strcspn.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strcspn_.c
|
||||
strdup_.c: strdup.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strdup.c; then echo $(srcdir)/strdup.c; else echo strdup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strdup_.c
|
||||
strftime_.c: strftime.c $(ANSI2KNR)
|
||||
@@ -384,8 +439,12 @@ 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
|
||||
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)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strstr.c; then echo $(srcdir)/strstr.c; else echo strstr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strstr_.c
|
||||
strtod_.c: strtod.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtod.c; then echo $(srcdir)/strtod.c; else echo strtod.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtod_.c
|
||||
strtol_.c: strtol.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/strtol.c; then echo $(srcdir)/strtol.c; else echo strtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > strtol_.c
|
||||
strtoul_.c: strtoul.c $(ANSI2KNR)
|
||||
@@ -404,10 +463,14 @@ version-etc_.c: version-etc.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/version-etc.c; then echo $(srcdir)/version-etc.c; else echo version-etc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > version-etc_.c
|
||||
xgetcwd_.c: xgetcwd.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xgetcwd.c; then echo $(srcdir)/xgetcwd.c; else echo xgetcwd.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xgetcwd_.c
|
||||
xgethostname_.c: xgethostname.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xgethostname.c; then echo $(srcdir)/xgethostname.c; else echo xgethostname.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xgethostname_.c
|
||||
xmalloc_.c: xmalloc.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xmalloc.c; then echo $(srcdir)/xmalloc.c; else echo xmalloc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xmalloc_.c
|
||||
xstrdup_.c: xstrdup.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrdup.c; then echo $(srcdir)/xstrdup.c; else echo xstrdup.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrdup_.c
|
||||
xstrtod_.c: xstrtod.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtod.c; then echo $(srcdir)/xstrtod.c; else echo xstrtod.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtod_.c
|
||||
xstrtol_.c: xstrtol.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtol.c; then echo $(srcdir)/xstrtol.c; else echo xstrtol.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtol_.c
|
||||
xstrtoul_.c: xstrtoul.c $(ANSI2KNR)
|
||||
@@ -416,19 +479,23 @@ xstrtoumax_.c: xstrtoumax.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/xstrtoumax.c; then echo $(srcdir)/xstrtoumax.c; else echo xstrtoumax.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > xstrtoumax_.c
|
||||
yesno_.c: yesno.c $(ANSI2KNR)
|
||||
$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/yesno.c; then echo $(srcdir)/yesno.c; else echo yesno.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > yesno_.c
|
||||
addext_.o alloca_.o argmatch_.o backupfile_.o basename_.o chown_.o \
|
||||
closeout_.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 getline_.o getopt_.o getopt1_.o \
|
||||
group-member_.o hash_.o human_.o idcache_.o isdir_.o lchown_.o \
|
||||
long-options_.o lstat_.o makepath_.o malloc_.o memchr_.o memcmp_.o \
|
||||
memcpy_.o memmove_.o memset_.o mkdir_.o mktime_.o modechange_.o \
|
||||
mountlist_.o nanosleep_.o obstack_.o path-concat_.o posixtm_.o \
|
||||
quotearg_.o realloc_.o regex_.o rmdir_.o rpmatch_.o safe-read_.o \
|
||||
same_.o save-cwd_.o savedir_.o stat_.o stpcpy_.o strcasecmp_.o \
|
||||
strdup_.o strftime_.o stripslash_.o strncasecmp_.o strndup_.o strstr_.o \
|
||||
strtol_.o strtoul_.o strtoull_.o strtoumax_.o strverscmp_.o userspec_.o \
|
||||
utime_.o version-etc_.o xgetcwd_.o xmalloc_.o xstrdup_.o xstrtol_.o \
|
||||
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 \
|
||||
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)
|
||||
.y.c:
|
||||
$(YACC) $(AM_YFLAGS) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
@@ -489,8 +556,10 @@ distdir: $(DISTFILES)
|
||||
@AMDEP@include $(DEPDIR)/argmatch$U.Po
|
||||
@AMDEP@include $(DEPDIR)/backupfile$U.Po
|
||||
@AMDEP@include $(DEPDIR)/basename$U.Po
|
||||
@AMDEP@include $(DEPDIR)/canon-host$U.Po
|
||||
@AMDEP@include $(DEPDIR)/chown.Po
|
||||
@AMDEP@include $(DEPDIR)/closeout$U.Po
|
||||
@AMDEP@include $(DEPDIR)/diacrit$U.Po
|
||||
@AMDEP@include $(DEPDIR)/dirname$U.Po
|
||||
@AMDEP@include $(DEPDIR)/dup2.Po
|
||||
@AMDEP@include $(DEPDIR)/error.Po
|
||||
@@ -504,21 +573,30 @@ distdir: $(DISTFILES)
|
||||
@AMDEP@include $(DEPDIR)/full-write$U.Po
|
||||
@AMDEP@include $(DEPDIR)/getdate$U.Po
|
||||
@AMDEP@include $(DEPDIR)/getgroups.Po
|
||||
@AMDEP@include $(DEPDIR)/gethostname.Po
|
||||
@AMDEP@include $(DEPDIR)/getline.Po
|
||||
@AMDEP@include $(DEPDIR)/getloadavg.Po
|
||||
@AMDEP@include $(DEPDIR)/getopt$U.Po
|
||||
@AMDEP@include $(DEPDIR)/getopt1$U.Po
|
||||
@AMDEP@include $(DEPDIR)/getugroups$U.Po
|
||||
@AMDEP@include $(DEPDIR)/getusershell.Po
|
||||
@AMDEP@include $(DEPDIR)/group-member.Po
|
||||
@AMDEP@include $(DEPDIR)/hard-locale$U.Po
|
||||
@AMDEP@include $(DEPDIR)/hash$U.Po
|
||||
@AMDEP@include $(DEPDIR)/human$U.Po
|
||||
@AMDEP@include $(DEPDIR)/idcache$U.Po
|
||||
@AMDEP@include $(DEPDIR)/isdir$U.Po
|
||||
@AMDEP@include $(DEPDIR)/lchown.Po
|
||||
@AMDEP@include $(DEPDIR)/linebuffer$U.Po
|
||||
@AMDEP@include $(DEPDIR)/long-options$U.Po
|
||||
@AMDEP@include $(DEPDIR)/lstat.Po
|
||||
@AMDEP@include $(DEPDIR)/makepath$U.Po
|
||||
@AMDEP@include $(DEPDIR)/malloc.Po
|
||||
@AMDEP@include $(DEPDIR)/md5$U.Po
|
||||
@AMDEP@include $(DEPDIR)/memcasecmp$U.Po
|
||||
@AMDEP@include $(DEPDIR)/memchr.Po
|
||||
@AMDEP@include $(DEPDIR)/memcmp.Po
|
||||
@AMDEP@include $(DEPDIR)/memcoll$U.Po
|
||||
@AMDEP@include $(DEPDIR)/memcpy.Po
|
||||
@AMDEP@include $(DEPDIR)/memmove.Po
|
||||
@AMDEP@include $(DEPDIR)/memset.Po
|
||||
@@ -530,7 +608,10 @@ distdir: $(DISTFILES)
|
||||
@AMDEP@include $(DEPDIR)/obstack.Po
|
||||
@AMDEP@include $(DEPDIR)/path-concat$U.Po
|
||||
@AMDEP@include $(DEPDIR)/posixtm$U.Po
|
||||
@AMDEP@include $(DEPDIR)/putenv.Po
|
||||
@AMDEP@include $(DEPDIR)/quotearg$U.Po
|
||||
@AMDEP@include $(DEPDIR)/readtokens$U.Po
|
||||
@AMDEP@include $(DEPDIR)/readutmp$U.Po
|
||||
@AMDEP@include $(DEPDIR)/realloc.Po
|
||||
@AMDEP@include $(DEPDIR)/regex.Po
|
||||
@AMDEP@include $(DEPDIR)/rmdir.Po
|
||||
@@ -540,14 +621,18 @@ distdir: $(DISTFILES)
|
||||
@AMDEP@include $(DEPDIR)/save-cwd$U.Po
|
||||
@AMDEP@include $(DEPDIR)/savedir$U.Po
|
||||
@AMDEP@include $(DEPDIR)/stat.Po
|
||||
@AMDEP@include $(DEPDIR)/stime.Po
|
||||
@AMDEP@include $(DEPDIR)/stpcpy.Po
|
||||
@AMDEP@include $(DEPDIR)/strcasecmp.Po
|
||||
@AMDEP@include $(DEPDIR)/strcspn.Po
|
||||
@AMDEP@include $(DEPDIR)/strdup.Po
|
||||
@AMDEP@include $(DEPDIR)/strftime.Po
|
||||
@AMDEP@include $(DEPDIR)/stripslash$U.Po
|
||||
@AMDEP@include $(DEPDIR)/strncasecmp.Po
|
||||
@AMDEP@include $(DEPDIR)/strndup.Po
|
||||
@AMDEP@include $(DEPDIR)/strpbrk.Po
|
||||
@AMDEP@include $(DEPDIR)/strstr.Po
|
||||
@AMDEP@include $(DEPDIR)/strtod.Po
|
||||
@AMDEP@include $(DEPDIR)/strtol.Po
|
||||
@AMDEP@include $(DEPDIR)/strtoul.Po
|
||||
@AMDEP@include $(DEPDIR)/strtoull.Po
|
||||
@@ -557,8 +642,10 @@ distdir: $(DISTFILES)
|
||||
@AMDEP@include $(DEPDIR)/utime.Po
|
||||
@AMDEP@include $(DEPDIR)/version-etc$U.Po
|
||||
@AMDEP@include $(DEPDIR)/xgetcwd$U.Po
|
||||
@AMDEP@include $(DEPDIR)/xgethostname$U.Po
|
||||
@AMDEP@include $(DEPDIR)/xmalloc$U.Po
|
||||
@AMDEP@include $(DEPDIR)/xstrdup$U.Po
|
||||
@AMDEP@include $(DEPDIR)/xstrtod$U.Po
|
||||
@AMDEP@include $(DEPDIR)/xstrtol$U.Po
|
||||
@AMDEP@include $(DEPDIR)/xstrtoul$U.Po
|
||||
@AMDEP@include $(DEPDIR)/xstrtoumax$U.Po
|
||||
@@ -576,7 +663,7 @@ maintainer-clean-depend:
|
||||
@AMDEP@CCDEPMODE = @CCDEPMODE@
|
||||
|
||||
.c.o:
|
||||
@AMDEP@ source='$<' object='$@' @AMDEPBACKSLASH@
|
||||
@AMDEP@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
$(COMPILE) -c -o $@ $<
|
||||
|
||||
10
lib/alloca.c
10
lib/alloca.c
@@ -25,6 +25,13 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef emacs
|
||||
# include "blockinput.h"
|
||||
#endif
|
||||
@@ -210,6 +217,9 @@ alloca (unsigned size)
|
||||
register pointer new = malloc (sizeof (header) + size);
|
||||
/* Address of header. */
|
||||
|
||||
if (new == 0)
|
||||
abort();
|
||||
|
||||
((header *) new)->h.next = last_alloca_header;
|
||||
((header *) new)->h.deep = depth;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* backupfile.c -- make Emacs style backup file names
|
||||
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
|
||||
@@ -58,16 +58,24 @@
|
||||
# define CLOSEDIR(d) closedir (d)
|
||||
#endif
|
||||
|
||||
#if STDC_HEADERS
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
char *malloc ();
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_GETENV
|
||||
"this configure-time declaration test was not run"
|
||||
#endif
|
||||
#if !HAVE_DECL_GETENV
|
||||
char *getenv ();
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_MALLOC
|
||||
"this configure-time declaration test was not run"
|
||||
#endif
|
||||
#if !HAVE_DECL_MALLOC
|
||||
char *malloc ();
|
||||
#endif
|
||||
|
||||
char *base_name PARAMS ((char const *));
|
||||
|
||||
#if HAVE_DIRENT_H || HAVE_NDIR_H || HAVE_SYS_DIR_H || HAVE_SYS_NDIR_H
|
||||
|
||||
@@ -57,8 +57,17 @@ dir_name (const char *path)
|
||||
else
|
||||
{
|
||||
/* Remove any trailing slashes from the result. */
|
||||
#ifdef MSDOS
|
||||
char *lim = (path[0] >= 'A' && path[0] <= 'z' && path[1] == ':')
|
||||
? path + 2 : path;
|
||||
|
||||
/* If canonicalized "d:/path", leave alone the root case "d:/". */
|
||||
while (slash > lim && *slash == '/')
|
||||
--slash;
|
||||
#else
|
||||
while (slash > path && *slash == '/')
|
||||
--slash;
|
||||
#endif
|
||||
|
||||
length = slash - path + 1;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* exclude.c -- exclude file names
|
||||
Copyright 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
|
||||
Copyright 1992, 1993, 1994, 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
|
||||
@@ -54,14 +54,14 @@ new_exclude (void)
|
||||
}
|
||||
|
||||
int
|
||||
excluded_filename (struct exclude const *ex, char const *f)
|
||||
excluded_filename (struct exclude const *ex, char const *f, int options)
|
||||
{
|
||||
char const * const *exclude = ex->exclude;
|
||||
int exclude_count = ex->exclude_count;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < exclude_count; i++)
|
||||
if (fnmatch (exclude[i], f, 0) == 0)
|
||||
if (fnmatch (exclude[i], f, options) == 0)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
@@ -79,7 +79,8 @@ add_exclude (struct exclude *ex, char const *pattern)
|
||||
}
|
||||
|
||||
int
|
||||
add_exclude_file (struct exclude *ex, char const *filename, char line_end)
|
||||
add_exclude_file (void (*add_func) PARAMS ((struct exclude *, char const *)),
|
||||
struct exclude *ex, char const *filename, char line_end)
|
||||
{
|
||||
int use_stdin = filename[0] == '-' && !filename[1];
|
||||
FILE *in;
|
||||
@@ -118,7 +119,7 @@ add_exclude_file (struct exclude *ex, char const *filename, char line_end)
|
||||
if (p < lim ? *p == line_end : buf < p && p[-1])
|
||||
{
|
||||
*p = '\0';
|
||||
add_exclude (ex, pattern);
|
||||
(*add_func) (ex, pattern);
|
||||
pattern = p + 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* exclude.h -- declarations for excluding file names
|
||||
Copyright 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
|
||||
Copyright 1992, 1993, 1994, 1997, 1999 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -30,5 +30,6 @@ struct exclude;
|
||||
|
||||
struct exclude *new_exclude PARAMS ((void));
|
||||
void add_exclude PARAMS ((struct exclude *, char const *));
|
||||
int add_exclude_file PARAMS ((struct exclude *, char const *, char));
|
||||
int excluded_filename PARAMS ((struct exclude const *, char const *));
|
||||
int add_exclude_file PARAMS ((void (*) (struct exclude *, char const *),
|
||||
struct exclude *, char const *, char));
|
||||
int excluded_filename PARAMS ((struct exclude const *, char const *, int));
|
||||
|
||||
194
lib/getdate.y
194
lib/getdate.y
@@ -1,6 +1,6 @@
|
||||
%{
|
||||
/* Parse a string into an internal time stamp.
|
||||
Copyright 1999 Free Software Foundation, Inc.
|
||||
Copyright 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,14 @@
|
||||
#define TM_YEAR_BASE 1900
|
||||
|
||||
#define HOUR(x) ((x) * 60)
|
||||
|
||||
/* An integer value, and the number of digits in its textual
|
||||
representation. */
|
||||
typedef struct
|
||||
{
|
||||
int value;
|
||||
int digits;
|
||||
} textint;
|
||||
|
||||
/* An entry in the lexical lookup table. */
|
||||
typedef struct
|
||||
@@ -98,7 +106,7 @@ typedef struct
|
||||
enum { MERam, MERpm, MER24 };
|
||||
|
||||
/* Information passed to and from the parser. */
|
||||
struct parser_control
|
||||
typedef struct
|
||||
{
|
||||
/* The input string remaining to be parsed. */
|
||||
const char *input;
|
||||
@@ -119,7 +127,7 @@ struct parser_control
|
||||
int meridian;
|
||||
|
||||
/* Gregorian year, month, day, hour, minutes, and seconds. */
|
||||
int year;
|
||||
textint year;
|
||||
int month;
|
||||
int day;
|
||||
int hour;
|
||||
@@ -144,12 +152,11 @@ struct parser_control
|
||||
|
||||
/* Table of local time zone abbrevations, terminated by a null entry. */
|
||||
table local_time_zone_table[3];
|
||||
};
|
||||
} parser_control;
|
||||
|
||||
#define PC (* (struct parser_control *) parm)
|
||||
#define PC (* (parser_control *) parm)
|
||||
#define YYLEX_PARAM parm
|
||||
#define YYPARSE_PARAM parm
|
||||
#define YYSTYPE int
|
||||
|
||||
static int yyerror ();
|
||||
static int yylex ();
|
||||
@@ -161,10 +168,21 @@ static int yylex ();
|
||||
|
||||
/* This grammar has 13 shift/reduce conflicts. */
|
||||
%expect 13
|
||||
|
||||
%union
|
||||
{
|
||||
int intval;
|
||||
textint textintval;
|
||||
}
|
||||
|
||||
%token tAGO tDAY tDAY_UNIT tDAYZONE tDST tHOUR_UNIT tID
|
||||
%token tLOCAL_ZONE tMERIDIAN tMINUTE_UNIT tMONTH tMONTH_UNIT
|
||||
%token tSEC_UNIT tSNUMBER tUNUMBER tYEAR_UNIT tZONE
|
||||
%token tAGO tDST
|
||||
|
||||
%token <intval> tDAY tDAY_UNIT tDAYZONE tHOUR_UNIT tLOCAL_ZONE tMERIDIAN
|
||||
%token <intval> tMINUTE_UNIT tMONTH tMONTH_UNIT tSEC_UNIT tYEAR_UNIT tZONE
|
||||
|
||||
%token <textintval> tSNUMBER tUNUMBER
|
||||
|
||||
%type <intval> o_merid
|
||||
|
||||
%%
|
||||
|
||||
@@ -192,41 +210,41 @@ item:
|
||||
time:
|
||||
tUNUMBER tMERIDIAN
|
||||
{
|
||||
PC.hour = $1;
|
||||
PC.hour = $1.value;
|
||||
PC.minutes = 0;
|
||||
PC.seconds = 0;
|
||||
PC.meridian = $2;
|
||||
}
|
||||
| tUNUMBER ':' tUNUMBER o_merid
|
||||
{
|
||||
PC.hour = $1;
|
||||
PC.minutes = $3;
|
||||
PC.hour = $1.value;
|
||||
PC.minutes = $3.value;
|
||||
PC.seconds = 0;
|
||||
PC.meridian = $4;
|
||||
}
|
||||
| tUNUMBER ':' tUNUMBER tSNUMBER
|
||||
{
|
||||
PC.hour = $1;
|
||||
PC.minutes = $3;
|
||||
PC.hour = $1.value;
|
||||
PC.minutes = $3.value;
|
||||
PC.meridian = MER24;
|
||||
PC.zones_seen++;
|
||||
PC.time_zone = $4 % 100 + ($4 / 100) * 60;
|
||||
PC.time_zone = $4.value % 100 + ($4.value / 100) * 60;
|
||||
}
|
||||
| tUNUMBER ':' tUNUMBER ':' tUNUMBER o_merid
|
||||
{
|
||||
PC.hour = $1;
|
||||
PC.minutes = $3;
|
||||
PC.seconds = $5;
|
||||
PC.hour = $1.value;
|
||||
PC.minutes = $3.value;
|
||||
PC.seconds = $5.value;
|
||||
PC.meridian = $6;
|
||||
}
|
||||
| tUNUMBER ':' tUNUMBER ':' tUNUMBER tSNUMBER
|
||||
{
|
||||
PC.hour = $1;
|
||||
PC.minutes = $3;
|
||||
PC.seconds = $5;
|
||||
PC.hour = $1.value;
|
||||
PC.minutes = $3.value;
|
||||
PC.seconds = $5.value;
|
||||
PC.meridian = MER24;
|
||||
PC.zones_seen++;
|
||||
PC.time_zone = $6 % 100 + ($6 / 100) * 60;
|
||||
PC.time_zone = $6.value % 100 + ($6.value / 100) * 60;
|
||||
}
|
||||
;
|
||||
|
||||
@@ -259,7 +277,7 @@ day:
|
||||
}
|
||||
| tUNUMBER tDAY
|
||||
{
|
||||
PC.day_ordinal = $1;
|
||||
PC.day_ordinal = $1.value;
|
||||
PC.day_number = $2;
|
||||
}
|
||||
;
|
||||
@@ -267,25 +285,26 @@ day:
|
||||
date:
|
||||
tUNUMBER '/' tUNUMBER
|
||||
{
|
||||
PC.month = $1;
|
||||
PC.day = $3;
|
||||
PC.month = $1.value;
|
||||
PC.day = $3.value;
|
||||
}
|
||||
| tUNUMBER '/' tUNUMBER '/' tUNUMBER
|
||||
{
|
||||
/* Interpret as YYYY/MM/DD if 1000 <= $1, otherwise as MM/DD/YY.
|
||||
/* Interpret as YYYY/MM/DD if the first value has 4 or more digits,
|
||||
otherwise as MM/DD/YY.
|
||||
The goal in recognizing YYYY/MM/DD is solely to support legacy
|
||||
machine-generated dates like those in an RCS log listing. If
|
||||
you want portability, use the ISO 8601 format. */
|
||||
if (1000 <= $1)
|
||||
if (4 <= $1.digits)
|
||||
{
|
||||
PC.year = $1;
|
||||
PC.month = $3;
|
||||
PC.day = $5;
|
||||
PC.month = $3.value;
|
||||
PC.day = $5.value;
|
||||
}
|
||||
else
|
||||
{
|
||||
PC.month = $1;
|
||||
PC.day = $3;
|
||||
PC.month = $1.value;
|
||||
PC.day = $3.value;
|
||||
PC.year = $5;
|
||||
}
|
||||
}
|
||||
@@ -293,36 +312,37 @@ date:
|
||||
{
|
||||
/* ISO 8601 format. YYYY-MM-DD. */
|
||||
PC.year = $1;
|
||||
PC.month = -$2;
|
||||
PC.day = -$3;
|
||||
PC.month = -$2.value;
|
||||
PC.day = -$3.value;
|
||||
}
|
||||
| tUNUMBER tMONTH tSNUMBER
|
||||
{
|
||||
/* e.g. 17-JUN-1992. */
|
||||
PC.day = $1;
|
||||
PC.day = $1.value;
|
||||
PC.month = $2;
|
||||
PC.year = -$3;
|
||||
PC.year.value = -$3.value;
|
||||
PC.year.digits = $3.digits;
|
||||
}
|
||||
| tMONTH tUNUMBER
|
||||
{
|
||||
PC.month = $1;
|
||||
PC.day = $2;
|
||||
PC.day = $2.value;
|
||||
}
|
||||
| tMONTH tUNUMBER ',' tUNUMBER
|
||||
{
|
||||
PC.month = $1;
|
||||
PC.day = $2;
|
||||
PC.day = $2.value;
|
||||
PC.year = $4;
|
||||
}
|
||||
| tUNUMBER tMONTH
|
||||
{
|
||||
PC.day = $1.value;
|
||||
PC.month = $2;
|
||||
PC.day = $1;
|
||||
}
|
||||
| tUNUMBER tMONTH tUNUMBER
|
||||
{
|
||||
PC.day = $1.value;
|
||||
PC.month = $2;
|
||||
PC.day = $1;
|
||||
PC.year = $3;
|
||||
}
|
||||
;
|
||||
@@ -342,39 +362,39 @@ rel:
|
||||
|
||||
relunit:
|
||||
tUNUMBER tYEAR_UNIT
|
||||
{ PC.rel_year += $1 * $2; }
|
||||
{ PC.rel_year += $1.value * $2; }
|
||||
| tSNUMBER tYEAR_UNIT
|
||||
{ PC.rel_year += $1 * $2; }
|
||||
{ PC.rel_year += $1.value * $2; }
|
||||
| tYEAR_UNIT
|
||||
{ PC.rel_year += $1; }
|
||||
| tUNUMBER tMONTH_UNIT
|
||||
{ PC.rel_month += $1 * $2; }
|
||||
{ PC.rel_month += $1.value * $2; }
|
||||
| tSNUMBER tMONTH_UNIT
|
||||
{ PC.rel_month += $1 * $2; }
|
||||
{ PC.rel_month += $1.value * $2; }
|
||||
| tMONTH_UNIT
|
||||
{ PC.rel_month += $1; }
|
||||
| tUNUMBER tDAY_UNIT
|
||||
{ PC.rel_day += $1 * $2; }
|
||||
{ PC.rel_day += $1.value * $2; }
|
||||
| tSNUMBER tDAY_UNIT
|
||||
{ PC.rel_day += $1 * $2; }
|
||||
{ PC.rel_day += $1.value * $2; }
|
||||
| tDAY_UNIT
|
||||
{ PC.rel_day += $1; }
|
||||
{ PC.rel_day += $1 }
|
||||
| tUNUMBER tHOUR_UNIT
|
||||
{ PC.rel_hour += $1 * $2; }
|
||||
{ PC.rel_hour += $1.value * $2; }
|
||||
| tSNUMBER tHOUR_UNIT
|
||||
{ PC.rel_hour += $1 * $2; }
|
||||
{ PC.rel_hour += $1.value * $2; }
|
||||
| tHOUR_UNIT
|
||||
{ PC.rel_hour += $1; }
|
||||
{ PC.rel_hour += $1 }
|
||||
| tUNUMBER tMINUTE_UNIT
|
||||
{ PC.rel_minutes += $1 * $2; }
|
||||
{ PC.rel_minutes += $1.value * $2; }
|
||||
| tSNUMBER tMINUTE_UNIT
|
||||
{ PC.rel_minutes += $1 * $2; }
|
||||
{ PC.rel_minutes += $1.value * $2; }
|
||||
| tMINUTE_UNIT
|
||||
{ PC.rel_minutes += $1; }
|
||||
{ PC.rel_minutes += $1 }
|
||||
| tUNUMBER tSEC_UNIT
|
||||
{ PC.rel_seconds += $1 * $2; }
|
||||
{ PC.rel_seconds += $1.value * $2; }
|
||||
| tSNUMBER tSEC_UNIT
|
||||
{ PC.rel_seconds += $1 * $2; }
|
||||
{ PC.rel_seconds += $1.value * $2; }
|
||||
| tSEC_UNIT
|
||||
{ PC.rel_seconds += $1; }
|
||||
;
|
||||
@@ -382,29 +402,31 @@ relunit:
|
||||
number:
|
||||
tUNUMBER
|
||||
{
|
||||
if (PC.dates_seen && ! PC.rels_seen && (PC.times_seen || 100 <= $1))
|
||||
if (PC.dates_seen
|
||||
&& ! PC.rels_seen && (PC.times_seen || 2 < $1.digits))
|
||||
PC.year = $1;
|
||||
else
|
||||
{
|
||||
if (10000 < $1)
|
||||
if (4 < $1.digits)
|
||||
{
|
||||
PC.dates_seen++;
|
||||
PC.day = $1 % 100;
|
||||
PC.month = ($1 / 100) % 100;
|
||||
PC.year = $1 / 10000;
|
||||
PC.day = $1.value % 100;
|
||||
PC.month = ($1.value / 100) % 100;
|
||||
PC.year.value = $1.value / 10000;
|
||||
PC.year.digits = $1.digits - 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
PC.times_seen++;
|
||||
if ($1 < 100)
|
||||
if ($1.digits <= 2)
|
||||
{
|
||||
PC.hour = $1;
|
||||
PC.hour = $1.value;
|
||||
PC.minutes = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
PC.hour = $1 / 100;
|
||||
PC.minutes = $1 % 100;
|
||||
PC.hour = $1.value / 100;
|
||||
PC.minutes = $1.value % 100;
|
||||
}
|
||||
PC.seconds = 0;
|
||||
PC.meridian = MER24;
|
||||
@@ -632,23 +654,23 @@ to_hour (int hours, int meridian)
|
||||
}
|
||||
|
||||
static int
|
||||
to_year (int year)
|
||||
to_year (textint textyear)
|
||||
{
|
||||
int year = textyear.value;
|
||||
|
||||
if (year < 0)
|
||||
year = -year;
|
||||
|
||||
/* XPG4 suggests that years 00-68 map to 2000-2068, and
|
||||
years 69-99 map to 1969-1999. */
|
||||
if (year < 69)
|
||||
year += 2000;
|
||||
else if (year < 100)
|
||||
year += 1900;
|
||||
if (textyear.digits == 2)
|
||||
year += year < 69 ? 2000 : 1900;
|
||||
|
||||
return year;
|
||||
}
|
||||
|
||||
static table const *
|
||||
lookup_zone (struct parser_control const *pc, char const *name)
|
||||
lookup_zone (parser_control const *pc, char const *name)
|
||||
{
|
||||
table const *tp;
|
||||
|
||||
@@ -692,7 +714,7 @@ tm_diff (struct tm const *a, struct tm const *b)
|
||||
#endif /* ! HAVE_TM_GMTOFF */
|
||||
|
||||
static table const *
|
||||
lookup_word (struct parser_control const *pc, char *word)
|
||||
lookup_word (parser_control const *pc, char *word)
|
||||
{
|
||||
char *p;
|
||||
char *q;
|
||||
@@ -761,7 +783,7 @@ lookup_word (struct parser_control const *pc, char *word)
|
||||
}
|
||||
|
||||
static int
|
||||
yylex (YYSTYPE *lvalp, struct parser_control *pc)
|
||||
yylex (YYSTYPE *lvalp, parser_control *pc)
|
||||
{
|
||||
unsigned char c;
|
||||
int count;
|
||||
@@ -773,21 +795,30 @@ yylex (YYSTYPE *lvalp, struct parser_control *pc)
|
||||
|
||||
if (ISDIGIT (c) || c == '-' || c == '+')
|
||||
{
|
||||
char const *p;
|
||||
int sign;
|
||||
int value;
|
||||
if (c == '-' || c == '+')
|
||||
{
|
||||
sign = c == '-' ? -1 : 1;
|
||||
if (! ISDIGIT (*++pc->input))
|
||||
c = *++pc->input;
|
||||
if (! ISDIGIT (c))
|
||||
/* skip the '-' sign */
|
||||
continue;
|
||||
}
|
||||
else
|
||||
sign = 0;
|
||||
for (*lvalp = 0; ISDIGIT (c = *pc->input++);)
|
||||
*lvalp = 10 * *lvalp + (c - '0');
|
||||
pc->input--;
|
||||
if (sign < 0)
|
||||
*lvalp = - *lvalp;
|
||||
p = pc->input;
|
||||
value = 0;
|
||||
do
|
||||
{
|
||||
value = 10 * value + c - '0';
|
||||
c = *++p;
|
||||
}
|
||||
while (ISDIGIT (c));
|
||||
lvalp->textintval.value = sign < 0 ? -value : value;
|
||||
lvalp->textintval.digits = p - pc->input;
|
||||
pc->input = p;
|
||||
return sign ? tSNUMBER : tUNUMBER;
|
||||
}
|
||||
|
||||
@@ -808,8 +839,8 @@ yylex (YYSTYPE *lvalp, struct parser_control *pc)
|
||||
*p = '\0';
|
||||
tp = lookup_word (pc, buff);
|
||||
if (! tp)
|
||||
return tID;
|
||||
*lvalp = tp->value;
|
||||
return '?';
|
||||
lvalp->intval = tp->value;
|
||||
return tp->type;
|
||||
}
|
||||
|
||||
@@ -848,13 +879,14 @@ get_date (const char *p, const time_t *now)
|
||||
struct tm *tmp = localtime (&Start);
|
||||
struct tm tm;
|
||||
struct tm tm0;
|
||||
struct parser_control pc;
|
||||
parser_control pc;
|
||||
|
||||
if (! tmp)
|
||||
return -1;
|
||||
|
||||
pc.input = p;
|
||||
pc.year = tmp->tm_year + TM_YEAR_BASE;
|
||||
pc.year.value = tmp->tm_year + TM_YEAR_BASE;
|
||||
pc.year.digits = 4;
|
||||
pc.month = tmp->tm_mon + 1;
|
||||
pc.day = tmp->tm_mday;
|
||||
pc.hour = tmp->tm_hour;
|
||||
|
||||
@@ -2,34 +2,40 @@
|
||||
|
||||
#ifndef HAVE_GETPAGESIZE
|
||||
|
||||
#ifdef VMS
|
||||
#define getpagesize() 512
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef _SC_PAGESIZE
|
||||
#define getpagesize() sysconf(_SC_PAGESIZE)
|
||||
#else
|
||||
#if !defined getpagesize && defined _SC_PAGESIZE
|
||||
# if !(defined VMS && __VMS_VER < 70000000)
|
||||
# define getpagesize() sysconf (_SC_PAGESIZE)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
#if !defined getpagesize && defined VMS
|
||||
# ifdef __ALPHA
|
||||
# define getpagesize() 8192
|
||||
# else
|
||||
# define getpagesize() 512
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef EXEC_PAGESIZE
|
||||
#define getpagesize() EXEC_PAGESIZE
|
||||
#else
|
||||
#ifdef NBPG
|
||||
#define getpagesize() NBPG * CLSIZE
|
||||
#ifndef CLSIZE
|
||||
#define CLSIZE 1
|
||||
#endif /* no CLSIZE */
|
||||
#else /* no NBPG */
|
||||
#ifdef NBPC
|
||||
#define getpagesize() NBPC
|
||||
#endif /* NBPC */
|
||||
#endif /* no NBPG */
|
||||
#endif /* no EXEC_PAGESIZE */
|
||||
#endif /* no _SC_PAGESIZE */
|
||||
#ifndef getpagesize
|
||||
# include <sys/param.h>
|
||||
# ifdef EXEC_PAGESIZE
|
||||
# define getpagesize() EXEC_PAGESIZE
|
||||
# else
|
||||
# ifdef NBPG
|
||||
# ifndef CLSIZE
|
||||
# define CLSIZE 1
|
||||
# endif
|
||||
# define getpagesize() (NBPG * CLSIZE)
|
||||
# else
|
||||
# ifdef NBPC
|
||||
# define getpagesize() NBPC
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* not HAVE_GETPAGESIZE */
|
||||
|
||||
34
lib/hash.c
34
lib/hash.c
@@ -1,5 +1,5 @@
|
||||
/* hash - hashing table processing.
|
||||
Copyright (C) 1998, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
Written by Jim Meyering, 1992.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -35,9 +35,16 @@ typedef enum {false = 0, true = 1} bool;
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifndef HAVE_DECL_FREE
|
||||
"this configure-time declaration test was not run"
|
||||
#endif
|
||||
#if !HAVE_DECL_FREE
|
||||
void free ();
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_MALLOC
|
||||
"this configure-time declaration test was not run"
|
||||
#endif
|
||||
#if !HAVE_DECL_MALLOC
|
||||
char *malloc ();
|
||||
#endif
|
||||
@@ -445,8 +452,8 @@ hash_reset_tuning (Hash_tuning *tuning)
|
||||
|
||||
/* For the given hash TABLE, check the user supplied tuning structure for
|
||||
reasonable values, and return true if there is no gross error with it.
|
||||
Otherwise, definitvely reset the TUNING field to some acceptable default in
|
||||
the hash table (that is, the user loses the right of further modifying
|
||||
Otherwise, definitively reset the TUNING field to some acceptable default
|
||||
in the hash table (that is, the user loses the right of further modifying
|
||||
tuning arguments), and return false. */
|
||||
|
||||
static bool
|
||||
@@ -468,15 +475,14 @@ check_tuning (Hash_table *table)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Allocate and return a new hash table, or NULL upon failure. The
|
||||
initial number of buckets is automatically selected so as to _guarantee_ that
|
||||
you may insert at least CANDIDATE different user entries before any growth
|
||||
of the hash table size occurs. So, if have a reasonably tight a-priori
|
||||
upper bound on the
|
||||
number of entries you intend to insert in the hash table, you may save some
|
||||
table memory and insertion time, by specifying it here. If the
|
||||
IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE argument
|
||||
has its meaning changed to the wanted number of buckets.
|
||||
/* Allocate and return a new hash table, or NULL upon failure. The initial
|
||||
number of buckets is automatically selected so as to _guarantee_ that you
|
||||
may insert at least CANDIDATE different user entries before any growth of
|
||||
the hash table size occurs. So, if have a reasonably tight a-priori upper
|
||||
bound on the number of entries you intend to insert in the hash table, you
|
||||
may save some table memory and insertion time, by specifying it here. If
|
||||
the IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE
|
||||
argument has its meaning changed to the wanted number of buckets.
|
||||
|
||||
TUNING points to a structure of user-supplied values, in case some fine
|
||||
tuning is wanted over the default behavior of the hasher. If TUNING is
|
||||
@@ -769,8 +775,8 @@ hash_find_entry (Hash_table *table, const void *entry,
|
||||
|
||||
/* For an already existing hash table, change the number of buckets through
|
||||
specifying CANDIDATE. The contents of the hash table are preserved. The
|
||||
new number of buckets is automatically selected so as to _guarantee_ that the
|
||||
table may receive at least CANDIDATE different user entries, including
|
||||
new number of buckets is automatically selected so as to _guarantee_ that
|
||||
the table may receive at least CANDIDATE different user entries, including
|
||||
those already in the table, before any other growth of the hash table size
|
||||
occurs. If TUNING->IS_N_BUCKETS is true, then CANDIDATE specifies the
|
||||
exact number of buckets desired. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* human.c -- print human readable file size
|
||||
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
|
||||
@@ -44,6 +44,9 @@
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_GETENV
|
||||
"this configure-time declaration test was not run"
|
||||
#endif
|
||||
#if !HAVE_DECL_GETENV
|
||||
char *getenv ();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
# interlock - wrap program invocation in lock to allow
|
||||
# parallel builds to work.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>, Aug 10 1996
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Usage:
|
||||
# interlock lock-dir-name program args-to-program...
|
||||
|
||||
dirname="$1"
|
||||
program="$2"
|
||||
|
||||
shift
|
||||
shift
|
||||
|
||||
while (mkdir $dirname > /dev/null 2>&1 && exit 1 || exit 0); do
|
||||
# Wait a bit.
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# Race condition here: if interrupted after the loop but before this
|
||||
# trap, the lock can be left around.
|
||||
trap "rmdir $dirname > /dev/null 2>&1" 1 2 3 15
|
||||
|
||||
# We have the lock, so run the program.
|
||||
$program ${1+"$@"}
|
||||
ret=$?
|
||||
|
||||
# Release the lock.
|
||||
rmdir $dirname > /dev/null 2>&1
|
||||
|
||||
exit $ret
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995, 1997, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -25,10 +25,7 @@
|
||||
Return DESTADDR. */
|
||||
|
||||
char *
|
||||
memcpy (destaddr, srcaddr, len)
|
||||
char *destaddr;
|
||||
const char *srcaddr;
|
||||
int len;
|
||||
memcpy (char *destaddr, const char *srcaddr, int len)
|
||||
{
|
||||
char *dest = destaddr;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* modechange.c -- file mode manipulation
|
||||
Copyright (C) 1989, 1990, 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989, 1990, 1997-2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -157,7 +157,7 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
|
||||
{
|
||||
struct mode_change *head; /* First element of the linked list. */
|
||||
struct mode_change *tail; /* An element of the linked list. */
|
||||
unsigned long mode_value; /* The mode value, if octal. */
|
||||
uintmax_t mode_value; /* The mode value, if octal. */
|
||||
char *string_end; /* Pointer to end of parsed value. */
|
||||
mode_t umask_value; /* The umask value (surprise). */
|
||||
|
||||
@@ -166,10 +166,10 @@ mode_compile (const char *mode_string, unsigned int masked_ops)
|
||||
tail = NULL;
|
||||
#endif
|
||||
|
||||
if (xstrtoul (mode_string, &string_end, 8, &mode_value, "") == LONGINT_OK)
|
||||
if (xstrtoumax (mode_string, &string_end, 8, &mode_value, "") == LONGINT_OK)
|
||||
{
|
||||
struct mode_change *p;
|
||||
if (mode_value > CHMOD_MODE_BITS)
|
||||
if (mode_value != (mode_value & CHMOD_MODE_BITS))
|
||||
return MODE_INVALID;
|
||||
p = make_node_op_equals ((mode_t) mode_value);
|
||||
if (p == NULL)
|
||||
|
||||
@@ -18,6 +18,11 @@
|
||||
/* written by Jim Meyering */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Undefine nanosleep here so any prototype is not redefined to be a
|
||||
prototype for rpl_nanosleep. (they'd conflict e.g., on alpha-dec-osf3.2) */
|
||||
#undef nanosleep
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
@@ -58,10 +63,10 @@ my_usleep (const struct timespec *ts_delay)
|
||||
/* FIXME: comment */
|
||||
|
||||
int
|
||||
nanosleep (const struct timespec *requested_delay,
|
||||
rpl_nanosleep (const struct timespec *requested_delay,
|
||||
struct timespec *remaining_delay)
|
||||
{
|
||||
#ifdef SA_INTERRUPT
|
||||
#ifdef SA_NOCLDSTOP
|
||||
struct sigaction oldact, newact;
|
||||
#endif
|
||||
|
||||
@@ -70,7 +75,7 @@ nanosleep (const struct timespec *requested_delay,
|
||||
/* set up sig handler */
|
||||
if (first_call)
|
||||
{
|
||||
#ifdef SA_INTERRUPT
|
||||
#ifdef SA_NOCLDSTOP
|
||||
newact.sa_handler = sighandler;
|
||||
sigemptyset (&newact.sa_mask);
|
||||
newact.sa_flags = 0;
|
||||
|
||||
@@ -17,17 +17,7 @@
|
||||
#if ! defined NANOSLEEP_H
|
||||
# define NANOSLEEP_H
|
||||
|
||||
# if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
# endif
|
||||
|
||||
# ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
# endif
|
||||
/* You must include config.h before including this file. */
|
||||
|
||||
# include <sys/types.h>
|
||||
# if TIME_WITH_SYS_TIME
|
||||
@@ -50,8 +40,10 @@ struct timespec
|
||||
};
|
||||
# endif
|
||||
|
||||
int
|
||||
nanosleep PARAMS ((const struct timespec *requested_delay,
|
||||
struct timespec *remaining_delay));
|
||||
# if ! HAVE_DECL_NANOSLEEP
|
||||
/* Don't specify a prototype here. Some systems (e.g., OSF) declare
|
||||
nanosleep with a conflicting one (const-less first parameter). */
|
||||
int nanosleep ();
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
485
lib/quotearg.c
485
lib/quotearg.c
@@ -1,5 +1,5 @@
|
||||
/* quotearg.c - quote arguments for 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
|
||||
@@ -17,8 +17,6 @@
|
||||
|
||||
/* Written by Paul Eggert <eggert@twinsun.com> */
|
||||
|
||||
/* FIXME: Multibyte characters are not supported yet. */
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
@@ -28,16 +26,6 @@
|
||||
#include <xalloc.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
|
||||
# define ISASCII(c) 1
|
||||
#else
|
||||
# define ISASCII(c) isascii (c)
|
||||
#endif
|
||||
#ifdef isgraph
|
||||
# define ISGRAPH(c) (ISASCII (c) && isgraph (c))
|
||||
#else
|
||||
# define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
|
||||
#endif
|
||||
|
||||
#if ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
@@ -64,14 +52,38 @@
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_WCTYPE_H
|
||||
# include <wctype.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_MBRTOWC && HAVE_WCHAR_H
|
||||
# include <wchar.h>
|
||||
#else
|
||||
# define iswprint(wc) 1
|
||||
# define mbrtowc(pwc, s, n, ps) 1
|
||||
# define mbsinit(ps) 1
|
||||
# define mbstate_t int
|
||||
#endif
|
||||
|
||||
#define INT_BITS (sizeof (int) * CHAR_BIT)
|
||||
|
||||
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
|
||||
/* Undefine to protect against the definition in wctype.h of solaris2.6. */
|
||||
# undef ISASCII
|
||||
# define ISASCII(c) 1
|
||||
#else
|
||||
# define ISASCII(c) isascii (c)
|
||||
#endif
|
||||
/* Undefine to protect against the definition in wctype.h of solaris2.6. */
|
||||
#undef ISPRINT
|
||||
#define ISPRINT(c) (ISASCII (c) && isprint (c))
|
||||
|
||||
struct quoting_options
|
||||
{
|
||||
/* Basic quoting style. */
|
||||
enum quoting_style style;
|
||||
|
||||
/* Quote the chararacters indicated by this bit vector even if the
|
||||
/* Quote the characters indicated by this bit vector even if the
|
||||
quoting style would not normally require them to be quoted. */
|
||||
int quote_these_too[((UCHAR_MAX + 1) / INT_BITS
|
||||
+ ((UCHAR_MAX + 1) % INT_BITS != 0))];
|
||||
@@ -89,7 +101,7 @@ char const *const quoting_style_args[] =
|
||||
0
|
||||
};
|
||||
|
||||
/* Correspondances to quoting style names. */
|
||||
/* Correspondences to quoting style names. */
|
||||
enum quoting_style const quoting_style_vals[] =
|
||||
{
|
||||
literal_quoting_style,
|
||||
@@ -146,6 +158,293 @@ set_char_quoting (struct quoting_options *o, char c, int i)
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
|
||||
argument ARG (of size ARGSIZE), using QUOTING_STYLE and the
|
||||
non-quoting-style part of O to control quoting.
|
||||
Terminate the output with a null character, and return the written
|
||||
size of the output, not counting the terminating null.
|
||||
If BUFFERSIZE is too small to store the output string, return the
|
||||
value that would have been returned had BUFFERSIZE been large enough.
|
||||
If ARGSIZE is -1, use the string length of the argument for ARGSIZE.
|
||||
|
||||
This function acts like quotearg_buffer (BUFFER, BUFFERSIZE, ARG,
|
||||
ARGSIZE, O), except it uses QUOTING_STYLE instead of the quoting
|
||||
style specified by O, and O may not be null. */
|
||||
|
||||
static size_t
|
||||
quotearg_buffer_restyled (char *buffer, size_t buffersize,
|
||||
char const *arg, size_t argsize,
|
||||
enum quoting_style quoting_style,
|
||||
struct quoting_options const *o)
|
||||
{
|
||||
size_t i;
|
||||
size_t len = 0;
|
||||
char const *quote_string = 0;
|
||||
size_t quote_string_len = 0;
|
||||
int backslash_escapes = 0;
|
||||
|
||||
#define STORE(c) \
|
||||
do \
|
||||
{ \
|
||||
if (len < buffersize) \
|
||||
buffer[len] = (c); \
|
||||
len++; \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
switch (quoting_style)
|
||||
{
|
||||
case c_quoting_style:
|
||||
STORE ('"');
|
||||
backslash_escapes = 1;
|
||||
quote_string = "\"";
|
||||
quote_string_len = 1;
|
||||
break;
|
||||
|
||||
case escape_quoting_style:
|
||||
backslash_escapes = 1;
|
||||
break;
|
||||
|
||||
case locale_quoting_style:
|
||||
for (quote_string = _("`"); *quote_string; quote_string++)
|
||||
STORE (*quote_string);
|
||||
backslash_escapes = 1;
|
||||
quote_string = _("'");
|
||||
quote_string_len = strlen (quote_string);
|
||||
break;
|
||||
|
||||
case shell_always_quoting_style:
|
||||
STORE ('\'');
|
||||
quote_string = "'";
|
||||
quote_string_len = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; ! (argsize == (size_t) -1 ? arg[i] == '\0' : i == argsize); i++)
|
||||
{
|
||||
unsigned char c;
|
||||
unsigned char esc;
|
||||
|
||||
if (backslash_escapes
|
||||
&& quote_string_len
|
||||
&& i + quote_string_len <= argsize
|
||||
&& memcmp (arg + i, quote_string, quote_string_len) == 0)
|
||||
STORE ('\\');
|
||||
|
||||
c = arg[i];
|
||||
switch (c)
|
||||
{
|
||||
case '?':
|
||||
switch (quoting_style)
|
||||
{
|
||||
case shell_quoting_style:
|
||||
goto use_shell_always_quoting_style;
|
||||
|
||||
case c_quoting_style:
|
||||
if (i + 2 < argsize && arg[i + 1] == '?')
|
||||
switch (arg[i + 2])
|
||||
{
|
||||
case '!': case '\'':
|
||||
case '(': case ')': case '-': case '/':
|
||||
case '<': case '=': case '>':
|
||||
/* Escape the second '?' in what would otherwise be
|
||||
a trigraph. */
|
||||
i += 2;
|
||||
c = arg[i + 2];
|
||||
STORE ('?');
|
||||
STORE ('\\');
|
||||
STORE ('?');
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
#if HAVE_C_BACKSLASH_A
|
||||
case '\a': esc = 'a'; goto c_escape;
|
||||
#endif
|
||||
case '\b': esc = 'b'; goto c_escape;
|
||||
case '\f': esc = 'f'; goto c_escape;
|
||||
case '\n': esc = 'n'; goto c_and_shell_escape;
|
||||
case '\r': esc = 'r'; goto c_and_shell_escape;
|
||||
case '\t': esc = 't'; goto c_and_shell_escape;
|
||||
case '\v': esc = 'v'; goto c_escape;
|
||||
case '\\': esc = c; goto c_and_shell_escape;
|
||||
|
||||
c_and_shell_escape:
|
||||
if (quoting_style == shell_quoting_style)
|
||||
goto use_shell_always_quoting_style;
|
||||
c_escape:
|
||||
if (backslash_escapes)
|
||||
{
|
||||
c = esc;
|
||||
goto store_escape;
|
||||
}
|
||||
break;
|
||||
|
||||
case '#': case '~':
|
||||
if (i != 0)
|
||||
break;
|
||||
/* Fall through. */
|
||||
case ' ':
|
||||
case '!': /* special in bash */
|
||||
case '"': case '$': case '&':
|
||||
case '(': case ')': case '*': case ';':
|
||||
case '<': case '>': case '[':
|
||||
case '^': /* special in old /bin/sh, e.g. SunOS 4.1.4 */
|
||||
case '`': case '|':
|
||||
/* A shell special character. In theory, '$' and '`' could
|
||||
be the first bytes of multibyte characters, which means
|
||||
we should check them with mbrtowc, but in practice this
|
||||
doesn't happen so it's not worth worrying about. */
|
||||
if (quoting_style == shell_quoting_style)
|
||||
goto use_shell_always_quoting_style;
|
||||
break;
|
||||
|
||||
case '\'':
|
||||
switch (quoting_style)
|
||||
{
|
||||
case shell_quoting_style:
|
||||
goto use_shell_always_quoting_style;
|
||||
|
||||
case shell_always_quoting_style:
|
||||
STORE ('\'');
|
||||
STORE ('\\');
|
||||
STORE ('\'');
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case '%': case '+': case ',': case '-': case '.': case '/':
|
||||
case '0': case '1': case '2': case '3': case '4': case '5':
|
||||
case '6': case '7': case '8': case '9': case ':': case '=':
|
||||
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
|
||||
case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
|
||||
case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
|
||||
case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
|
||||
case 'Y': case 'Z': case ']': case '_': case 'a': case 'b':
|
||||
case 'c': case 'd': case 'e': case 'f': case 'g': case 'h':
|
||||
case 'i': case 'j': case 'k': case 'l': case 'm': case 'n':
|
||||
case 'o': case 'p': case 'q': case 'r': case 's': case 't':
|
||||
case 'u': case 'v': case 'w': case 'x': case 'y': case 'z':
|
||||
case '{': case '}':
|
||||
/* These characters don't cause problems, no matter what the
|
||||
quoting style is. They cannot start multibyte sequences. */
|
||||
break;
|
||||
|
||||
default:
|
||||
/* If we have a multibyte sequence, copy it until we reach
|
||||
its end, find an error, or come back to the initial shift
|
||||
state. For C-like styles, if the sequence has
|
||||
unprintable characters, escape the whole sequence, since
|
||||
we can't easily escape single characters within it. */
|
||||
{
|
||||
/* Length of multibyte sequence found so far. */
|
||||
size_t m = 0;
|
||||
|
||||
int printable = 1;
|
||||
mbstate_t mbstate;
|
||||
memset (&mbstate, 0, sizeof mbstate);
|
||||
|
||||
if (argsize == (size_t) -1)
|
||||
argsize = strlen (arg);
|
||||
|
||||
do
|
||||
{
|
||||
wchar_t w;
|
||||
size_t bytes = mbrtowc (&w, &arg[i + m],
|
||||
argsize - (i + m), &mbstate);
|
||||
if (bytes == 0)
|
||||
break;
|
||||
else if (bytes == (size_t) -1)
|
||||
{
|
||||
printable = 0;
|
||||
break;
|
||||
}
|
||||
else if (bytes == (size_t) -2)
|
||||
{
|
||||
printable = 0;
|
||||
while (i + m < argsize && arg[i + m])
|
||||
m++;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! iswprint (w))
|
||||
printable = 0;
|
||||
m += bytes;
|
||||
}
|
||||
}
|
||||
while (! mbsinit (&mbstate));
|
||||
|
||||
if (m <= 1)
|
||||
{
|
||||
/* Escape a unibyte character like a multibyte
|
||||
sequence if using backslash escapes, and if the
|
||||
character is not printable. */
|
||||
m = backslash_escapes && ! ISPRINT (c);
|
||||
printable = 0;
|
||||
}
|
||||
|
||||
if (m)
|
||||
{
|
||||
/* Output a multibyte sequence, or an escaped
|
||||
unprintable unibyte character. */
|
||||
size_t imax = i + m - 1;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (backslash_escapes && ! printable)
|
||||
{
|
||||
STORE ('\\');
|
||||
STORE ('0' + (c >> 6));
|
||||
STORE ('0' + ((c >> 3) & 7));
|
||||
c = '0' + (c & 7);
|
||||
}
|
||||
if (i == imax)
|
||||
break;
|
||||
STORE (c);
|
||||
c = arg[++i];
|
||||
}
|
||||
|
||||
goto store_c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! (backslash_escapes
|
||||
&& o->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS))))
|
||||
goto store_c;
|
||||
|
||||
store_escape:
|
||||
STORE ('\\');
|
||||
|
||||
store_c:
|
||||
STORE (c);
|
||||
}
|
||||
|
||||
if (quote_string)
|
||||
for (; *quote_string; quote_string++)
|
||||
STORE (*quote_string);
|
||||
|
||||
if (len < buffersize)
|
||||
buffer[len] = '\0';
|
||||
return len;
|
||||
|
||||
use_shell_always_quoting_style:
|
||||
return quotearg_buffer_restyled (buffer, buffersize, arg, argsize,
|
||||
shell_always_quoting_style, o);
|
||||
}
|
||||
|
||||
/* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
|
||||
argument ARG (of size ARGSIZE), using O to control quoting.
|
||||
If O is null, use the default.
|
||||
@@ -159,161 +458,9 @@ quotearg_buffer (char *buffer, size_t buffersize,
|
||||
char const *arg, size_t argsize,
|
||||
struct quoting_options const *o)
|
||||
{
|
||||
unsigned char c;
|
||||
size_t i;
|
||||
size_t len = 0;
|
||||
char const *quote_string;
|
||||
size_t quote_string_len;
|
||||
struct quoting_options const *p = o ? o : &default_quoting_options;
|
||||
enum quoting_style quoting_style = p->style;
|
||||
#define STORE(c) \
|
||||
do \
|
||||
{ \
|
||||
if (len < buffersize) \
|
||||
buffer[len] = (c); \
|
||||
len++; \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
switch (quoting_style)
|
||||
{
|
||||
case shell_quoting_style:
|
||||
if (! (argsize == (size_t) -1 ? arg[0] == '\0' : argsize == 0))
|
||||
{
|
||||
switch (arg[0])
|
||||
{
|
||||
case '#': case '~':
|
||||
break;
|
||||
|
||||
default:
|
||||
for (i = 0; ; i++)
|
||||
{
|
||||
if (argsize == (size_t) -1 ? arg[i] == '\0' : i == argsize)
|
||||
goto done;
|
||||
|
||||
c = arg[i];
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '\t': case '\n': case ' ':
|
||||
case '!': /* special in csh */
|
||||
case '"': case '$': case '&': case '\'':
|
||||
case '(': case ')': case '*': case ';':
|
||||
case '<': case '>': case '?': case '[': case '\\':
|
||||
case '^': /* special in old /bin/sh, e.g. SunOS 4.1.4 */
|
||||
case '`': case '|':
|
||||
goto needs_quoting;
|
||||
}
|
||||
|
||||
if (p->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS)))
|
||||
goto needs_quoting;
|
||||
|
||||
STORE (c);
|
||||
}
|
||||
needs_quoting:;
|
||||
|
||||
len = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* Fall through. */
|
||||
|
||||
case shell_always_quoting_style:
|
||||
STORE ('\'');
|
||||
quote_string = "'";
|
||||
quote_string_len = 1;
|
||||
break;
|
||||
|
||||
case c_quoting_style:
|
||||
STORE ('"');
|
||||
quote_string = "\"";
|
||||
quote_string_len = 1;
|
||||
break;
|
||||
|
||||
case locale_quoting_style:
|
||||
for (quote_string = _("`"); *quote_string; quote_string++)
|
||||
STORE (*quote_string);
|
||||
quote_string = _("'");
|
||||
quote_string_len = strlen (quote_string);
|
||||
break;
|
||||
|
||||
default:
|
||||
quote_string = 0;
|
||||
quote_string_len = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; ! (argsize == (size_t) -1 ? arg[i] == '\0' : i == argsize); i++)
|
||||
{
|
||||
c = arg[i];
|
||||
|
||||
switch (quoting_style)
|
||||
{
|
||||
case literal_quoting_style:
|
||||
break;
|
||||
|
||||
case shell_quoting_style:
|
||||
case shell_always_quoting_style:
|
||||
if (c == '\'')
|
||||
{
|
||||
STORE ('\'');
|
||||
STORE ('\\');
|
||||
STORE ('\'');
|
||||
}
|
||||
break;
|
||||
|
||||
case c_quoting_style:
|
||||
case escape_quoting_style:
|
||||
case locale_quoting_style:
|
||||
switch (c)
|
||||
{
|
||||
case '?': /* Do not generate trigraphs. */
|
||||
case '\\': goto store_escape;
|
||||
/* Not all C compilers know what \a means. */
|
||||
case 7 : c = 'a'; goto store_escape;
|
||||
case '\b': c = 'b'; goto store_escape;
|
||||
case '\f': c = 'f'; goto store_escape;
|
||||
case '\n': c = 'n'; goto store_escape;
|
||||
case '\r': c = 'r'; goto store_escape;
|
||||
case '\t': c = 't'; goto store_escape;
|
||||
case '\v': c = 'v'; goto store_escape;
|
||||
|
||||
case ' ': break;
|
||||
|
||||
default:
|
||||
if (quote_string_len
|
||||
&& strncmp (arg + i, quote_string, quote_string_len) == 0)
|
||||
goto store_escape;
|
||||
if (!ISGRAPH (c))
|
||||
{
|
||||
STORE ('\\');
|
||||
STORE ('0' + (c >> 6));
|
||||
STORE ('0' + ((c >> 3) & 7));
|
||||
c = '0' + (c & 7);
|
||||
goto store_c;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (! (p->quote_these_too[c / INT_BITS] & (1 << (c % INT_BITS))))
|
||||
goto store_c;
|
||||
|
||||
store_escape:
|
||||
STORE ('\\');
|
||||
}
|
||||
|
||||
store_c:
|
||||
STORE (c);
|
||||
}
|
||||
|
||||
if (quote_string)
|
||||
for (; *quote_string; quote_string++)
|
||||
STORE (*quote_string);
|
||||
|
||||
done:
|
||||
if (len < buffersize)
|
||||
buffer[len] = '\0';
|
||||
return len;
|
||||
return quotearg_buffer_restyled (buffer, buffersize, arg, argsize,
|
||||
p->style, p);
|
||||
}
|
||||
|
||||
/* Use storage slot N to return a quoted version of the string ARG.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* GNU's read utmp module.
|
||||
Copyright (C) 1992-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992-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
|
||||
@@ -41,11 +41,11 @@ extract_trimmed_name (const STRUCT_UTMP *ut)
|
||||
{
|
||||
char *p, *trimmed_name;
|
||||
|
||||
trimmed_name = xmalloc (sizeof (ut->ut_name) + 1);
|
||||
strncpy (trimmed_name, ut->ut_name, sizeof (ut->ut_name));
|
||||
trimmed_name = xmalloc (sizeof (UT_USER (ut)) + 1);
|
||||
strncpy (trimmed_name, UT_USER (ut), sizeof (UT_USER (ut)));
|
||||
/* Append a trailing space character. Some systems pad names shorter than
|
||||
the maximum with spaces, others pad with NULs. Remove any spaces. */
|
||||
trimmed_name[sizeof (ut->ut_name)] = ' ';
|
||||
trimmed_name[sizeof (UT_USER (ut))] = ' ';
|
||||
p = strchr (trimmed_name, ' ');
|
||||
if (p != NULL)
|
||||
*p = '\0';
|
||||
@@ -57,7 +57,7 @@ extract_trimmed_name (const STRUCT_UTMP *ut)
|
||||
the number of entries, and return zero. If there is any error,
|
||||
return non-zero and don't modify the parameters. */
|
||||
|
||||
#if HAVE_UTMPNAME
|
||||
#ifdef UTMP_NAME_FUNCTION
|
||||
|
||||
int
|
||||
read_utmp (const char *filename, int *n_entries, STRUCT_UTMP **utmp_buf)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Declarations for GNU's read utmp module.
|
||||
Copyright (C) 1992-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992-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,7 +37,9 @@
|
||||
# define SET_UTMP_ENT setutxent
|
||||
# define GET_UTMP_ENT getutxent
|
||||
# define END_UTMP_ENT endutxent
|
||||
# define UTMP_NAME_FUNCTION utmpxname
|
||||
# ifdef HAVE_UTMPXNAME
|
||||
# define UTMP_NAME_FUNCTION utmpxname
|
||||
# endif
|
||||
# else
|
||||
# include <utmp.h>
|
||||
# define UTMP_STRUCT_NAME utmp
|
||||
@@ -45,7 +47,32 @@
|
||||
# define SET_UTMP_ENT setutent
|
||||
# define GET_UTMP_ENT getutent
|
||||
# define END_UTMP_ENT endutent
|
||||
# define UTMP_NAME_FUNCTION utmpname
|
||||
# ifdef HAVE_UTMPNAME
|
||||
# define UTMP_NAME_FUNCTION utmpname
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* Accessor macro for the member named ut_user or ut_name. */
|
||||
# ifdef HAVE_UTMPX_H
|
||||
|
||||
# if HAVE_STRUCT_UTMPX_UT_USER
|
||||
# define UT_USER(Utmp) ((Utmp)->ut_user)
|
||||
# endif
|
||||
# if HAVE_STRUCT_UTMPX_UT_NAME
|
||||
# undef UT_USER
|
||||
# define UT_USER(Utmp) ((Utmp)->ut_name)
|
||||
# endif
|
||||
|
||||
# else
|
||||
|
||||
# if HAVE_STRUCT_UTMP_UT_USER
|
||||
# define UT_USER(Utmp) Utmp->ut_user
|
||||
# endif
|
||||
# if HAVE_STRUCT_UTMP_UT_NAME
|
||||
# undef UT_USER
|
||||
# define UT_USER(Utmp) Utmp->ut_name
|
||||
# endif
|
||||
|
||||
# endif
|
||||
|
||||
typedef struct UTMP_STRUCT_NAME STRUCT_UTMP;
|
||||
|
||||
@@ -50,6 +50,9 @@ extern int errno;
|
||||
#define STREQ(a, b) (strcmp ((a), (b)) == 0)
|
||||
|
||||
#ifndef HAVE_DECL_FREE
|
||||
"this configure-time declaration test was not run"
|
||||
#endif
|
||||
#if !HAVE_DECL_FREE
|
||||
void free ();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -37,8 +37,18 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if HAVE_UNSIGNED_LONG_LONG && ! HAVE_STRTOULL
|
||||
unsigned long long strtoull PARAMS ((char const *, char **, int));
|
||||
#ifndef HAVE_DECL_STRTOUL
|
||||
"this configure-time declaration test was not run"
|
||||
#endif
|
||||
#if !HAVE_DECL_STRTOUL
|
||||
unsigned long strtoul PARAMS ((char const *, char **, int));
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_STRTOULL
|
||||
"this configure-time declaration test was not run"
|
||||
#endif
|
||||
#if !HAVE_DECL_STRTOULL && HAVE_UNSIGNED_LONG_LONG
|
||||
unsigned long long strtoull PARAMS ((char const *, char **, int));
|
||||
#endif
|
||||
|
||||
uintmax_t
|
||||
@@ -56,3 +66,16 @@ strtoumax (char const *ptr, char **endptr, int base)
|
||||
|
||||
abort ();
|
||||
}
|
||||
|
||||
#ifdef TESTING
|
||||
# include <stdio.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
char *p, *endptr;
|
||||
printf ("sizeof uintmax_t: %d\n", sizeof (uintmax_t));
|
||||
printf ("sizeof strtoull(): %d\n", sizeof strtoull(p, &endptr, 10));
|
||||
printf ("sizeof strtoul(): %d\n", sizeof strtoul(p, &endptr, 10));
|
||||
exit (0);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Compare strings while treating digits characters numerically.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 2000 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Jean-Francois Bignolles <bignolle@ecoledoc.ibp.fr>, 1997.
|
||||
Contributed by Jean-François Bignolles <bignolle@ecoledoc.ibp.fr>, 1997.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
@@ -36,6 +36,15 @@
|
||||
#define CMP 2
|
||||
#define LEN 3
|
||||
|
||||
/* ISDIGIT differs from isdigit, as follows:
|
||||
- Its arg may be any int or unsigned int; it need not be an unsigned char.
|
||||
- It's guaranteed to evaluate its argument exactly once.
|
||||
- It's typically faster.
|
||||
Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
|
||||
only '0' through '9' are digits. Prefer ISDIGIT to isdigit unless
|
||||
it's important to use the locale's definition of `digit' even when the
|
||||
host does not conform to Posix. */
|
||||
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
|
||||
|
||||
/* Compare S1 and S2 as strings holding indices/version numbers,
|
||||
returning less than, equal to or greater than zero if S1 is less than,
|
||||
@@ -83,17 +92,17 @@ strverscmp (const char *s1, const char *s2)
|
||||
c1 = *p1++;
|
||||
c2 = *p2++;
|
||||
/* Hint: '0' is a digit too. */
|
||||
state = S_N | ((c1 == '0') + (isdigit (c1) != 0));
|
||||
state = S_N | ((c1 == '0') + (ISDIGIT (c1) != 0));
|
||||
|
||||
while ((diff = c1 - c2) == 0 && c1 != '\0')
|
||||
{
|
||||
state = next_state[state];
|
||||
c1 = *p1++;
|
||||
c2 = *p2++;
|
||||
state |= (c1 == '0') + (isdigit (c1) != 0);
|
||||
state |= (c1 == '0') + (ISDIGIT (c1) != 0);
|
||||
}
|
||||
|
||||
state = result_type[state << 2 | ((c2 == '0') + (isdigit (c2) != 0))];
|
||||
state = result_type[state << 2 | ((c2 == '0') + (ISDIGIT (c2) != 0))];
|
||||
|
||||
switch (state)
|
||||
{
|
||||
@@ -101,11 +110,11 @@ strverscmp (const char *s1, const char *s2)
|
||||
return diff;
|
||||
|
||||
case LEN:
|
||||
while (isdigit (*p1++))
|
||||
if (!isdigit (*p2++))
|
||||
while (ISDIGIT (*p1++))
|
||||
if (!ISDIGIT (*p2++))
|
||||
return 1;
|
||||
|
||||
return isdigit (*p2) ? -1 : diff;
|
||||
return ISDIGIT (*p2) ? -1 : diff;
|
||||
|
||||
default:
|
||||
return state;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* userspec.c -- Parse a user and group string.
|
||||
Copyright (C) 1989-1992, 1997, 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989-1992, 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
|
||||
@@ -57,6 +57,14 @@ char *alloca ();
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
# define _(Text) gettext (Text)
|
||||
#else
|
||||
# define _(Text) Text
|
||||
#endif
|
||||
#define N_(Text) Text
|
||||
|
||||
#ifndef _POSIX_VERSION
|
||||
struct passwd *getpwnam ();
|
||||
struct group *getgrnam ();
|
||||
@@ -83,7 +91,15 @@ struct group *getgrgid ();
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define isdigit(c) ((c) >= '0' && (c) <= '9')
|
||||
/* ISDIGIT differs from isdigit, as follows:
|
||||
- Its arg may be any int or unsigned int; it need not be an unsigned char.
|
||||
- It's guaranteed to evaluate its argument exactly once.
|
||||
- It's typically faster.
|
||||
Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
|
||||
only '0' through '9' are digits. Prefer ISDIGIT to isdigit unless
|
||||
it's important to use the locale's definition of `digit' even when the
|
||||
host does not conform to Posix. */
|
||||
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
|
||||
|
||||
#ifndef strdup
|
||||
char *strdup ();
|
||||
@@ -96,7 +112,7 @@ static int
|
||||
is_number (const char *str)
|
||||
{
|
||||
for (; *str; str++)
|
||||
if (!isdigit (*str))
|
||||
if (!ISDIGIT (*str))
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
@@ -104,8 +120,12 @@ is_number (const char *str)
|
||||
/* Extract from NAME, which has the form "[user][:.][group]",
|
||||
a USERNAME, UID U, GROUPNAME, and GID G.
|
||||
Either user or group, or both, must be present.
|
||||
If the group is omitted but the ":" or "." separator is given,
|
||||
If the group is omitted but the ":" separator is given,
|
||||
use the given user's login group.
|
||||
If SPEC_ARG contains a `:', then use that as the separator, ignoring
|
||||
any `.'s. If there is no `:', but there is a `.', then first look
|
||||
up SPEC_ARG as a login name. If that look-up fails, then try again
|
||||
interpreting the `.' as a separator.
|
||||
|
||||
USERNAME and GROUPNAME will be in newly malloc'd memory.
|
||||
Either one might be NULL instead, indicating that it was not
|
||||
@@ -117,13 +137,22 @@ const char *
|
||||
parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid,
|
||||
char **username_arg, char **groupname_arg)
|
||||
{
|
||||
static const char *tired = "virtual memory exhausted";
|
||||
static const char *E_no_memory = N_("virtual memory exhausted");
|
||||
static const char *E_invalid_user = N_("invalid user");
|
||||
static const char *E_invalid_group = N_("invalid group");
|
||||
static const char *E_bad_spec =
|
||||
N_("cannot get the login group of a numeric UID");
|
||||
static const char *E_cannot_omit_both =
|
||||
N_("cannot omit both user and group");
|
||||
|
||||
const char *error_msg;
|
||||
char *spec; /* A copy we can write on. */
|
||||
struct passwd *pwd;
|
||||
struct group *grp;
|
||||
char *g, *u, *separator;
|
||||
char *groupname;
|
||||
int maybe_retry = 0;
|
||||
char *dot = NULL;
|
||||
|
||||
error_msg = NULL;
|
||||
*username_arg = *groupname_arg = NULL;
|
||||
@@ -131,10 +160,24 @@ parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid,
|
||||
|
||||
V_STRDUP (spec, spec_arg);
|
||||
|
||||
/* Find the separator if there is one. */
|
||||
/* Find the POSIX `:' separator if there is one. */
|
||||
separator = strchr (spec, ':');
|
||||
|
||||
/* If there is no colon, then see if there's a `.'. */
|
||||
if (separator == NULL)
|
||||
separator = strchr (spec, '.');
|
||||
{
|
||||
dot = strchr (spec, '.');
|
||||
/* If there's no colon but there is a `.', then first look up the
|
||||
whole spec, in case it's an OWNER name that includes a dot.
|
||||
If that fails, then we'll try again, but interpreting the `.'
|
||||
as a separator. */
|
||||
/* FIXME: accepting `.' as the separator is contrary to POSIX.
|
||||
someday we should drop support for this. */
|
||||
if (dot)
|
||||
maybe_retry = 1;
|
||||
}
|
||||
|
||||
retry:
|
||||
|
||||
/* Replace separator with a NUL. */
|
||||
if (separator != NULL)
|
||||
@@ -149,7 +192,7 @@ parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid,
|
||||
: separator + 1);
|
||||
|
||||
if (u == NULL && g == NULL)
|
||||
return "can not omit both user and group";
|
||||
return _(E_cannot_omit_both);
|
||||
|
||||
#ifdef __DJGPP__
|
||||
/* Pretend that we are the user U whose group is G. This makes
|
||||
@@ -167,15 +210,18 @@ parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid,
|
||||
{
|
||||
|
||||
if (!is_number (u))
|
||||
error_msg = "invalid user";
|
||||
error_msg = _(E_invalid_user);
|
||||
else
|
||||
{
|
||||
int use_login_group;
|
||||
use_login_group = (separator != NULL && g == NULL);
|
||||
if (use_login_group)
|
||||
error_msg = "cannot get the login group of a numeric UID";
|
||||
error_msg = _(E_bad_spec);
|
||||
else
|
||||
*uid = atoi (u);
|
||||
{
|
||||
/* FIXME: don't use atoi! */
|
||||
*uid = atoi (u);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -213,9 +259,12 @@ parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid,
|
||||
if (grp == NULL)
|
||||
{
|
||||
if (!is_number (g))
|
||||
error_msg = "invalid group";
|
||||
error_msg = _(E_invalid_group);
|
||||
else
|
||||
*gid = atoi (g);
|
||||
{
|
||||
/* FIXME: don't use atoi! */
|
||||
*gid = atoi (g);
|
||||
}
|
||||
}
|
||||
else
|
||||
*gid = grp->gr_gid;
|
||||
@@ -231,7 +280,7 @@ parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid,
|
||||
{
|
||||
*username_arg = strdup (u);
|
||||
if (*username_arg == NULL)
|
||||
error_msg = tired;
|
||||
error_msg = _(E_no_memory);
|
||||
}
|
||||
|
||||
if (groupname != NULL && error_msg == NULL)
|
||||
@@ -244,11 +293,19 @@ parse_user_spec (const char *spec_arg, uid_t *uid, gid_t *gid,
|
||||
free (*username_arg);
|
||||
*username_arg = NULL;
|
||||
}
|
||||
error_msg = tired;
|
||||
error_msg = _(E_no_memory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (error_msg && maybe_retry)
|
||||
{
|
||||
maybe_retry = 0;
|
||||
separator = dot;
|
||||
error_msg = NULL;
|
||||
goto retry;
|
||||
}
|
||||
|
||||
return error_msg;
|
||||
}
|
||||
|
||||
|
||||
180
m4/ChangeLog
180
m4/ChangeLog
@@ -1,3 +1,183 @@
|
||||
2000-02-27 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* check-decl.m4: Add getenv to the list.
|
||||
|
||||
2000-02-23 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* check-decl.m4: Now that we have the new AC_CHECK_DECLS, use it
|
||||
in place of my hack.
|
||||
|
||||
2000-02-10 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* nanosleep.m4 (jm_FUNC_NANOSLEEP): Rename replacement function from
|
||||
gnu_nanosleep to rpl_nanosleep.
|
||||
|
||||
2000-02-09 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* lib-check.m4 (jm_LIB_CHECK): Fix typo: check for sp_pwdp in
|
||||
struct spwd, rather than in struct passwd. Reported by Gaël Quéri.
|
||||
|
||||
2000-02-08 Akim Demaille <akim@epita.fr>
|
||||
|
||||
* largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Quote square brackets with
|
||||
`[' and `]' and remove uses of `changequote'.
|
||||
(AC_SYS_LARGEFILE_MACRO_VALUE): Likewise.
|
||||
(AC_SYS_LARGEFILE): Likewise.
|
||||
* gettext.m4 (AM_GNU_GETTEXT): Likewise.
|
||||
* strftime.m4 (jm_FUNC_GNU_STRFTIME): Remove now-unnecessary use
|
||||
of changequote.
|
||||
* regex.m4 (jm_INCLUDED_REGEX): Likewise.
|
||||
* readdir.m4 (jm_FUNC_READDIR): Likewise
|
||||
* memcmp.m4 (jm_AC_FUNC_MEMCMP): Likewise, and add `int' for main.
|
||||
* getloadavg.m4 (AM_FUNC_GETLOADAVG): Likewise.
|
||||
|
||||
2000-02-05 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* jm-macros.m4: (jm_CHECK_ALL_TYPES): Require most macros.
|
||||
Remove explicit use of AC_HEADER_TIME. It is required by
|
||||
jm_CHECK_TYPE_STRUCT_TIMESPEC. Using AC_HEADER_TIME and
|
||||
`AC_REQUIRE'ing jm_CHECK_TYPE_STRUCT_TIMESPEC provoked a but
|
||||
in autoconf whereby the expansion of the latter ended up preceding
|
||||
the expansion of its prerequisite, AC_HEADER_TIME.
|
||||
Reported by Volker Borchert.
|
||||
|
||||
2000-02-03 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* prereq.m4 (jm_PREREQ_READUTMP): Check for utmpxname.
|
||||
|
||||
2000-02-02 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* prereq.m4 (jm_PREREQ_ADDEXT): Fix typo that resulted in no
|
||||
definition of HAVE_PATHCONF: s/AC_CHECK_FUNC/AC_CHECK_FUNCS/.
|
||||
Reported by Eli Zaretskii.
|
||||
|
||||
2000-01-31 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* check-decl.m4 (jm_CHECK_DECLS): Add nanosleep to the list of
|
||||
functions. Add the time.h and sys/time.h headers along with the
|
||||
AC_REQUIRE'ment of AC_HEADER_TIME.
|
||||
|
||||
2000-01-30 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* lib-check.m4: Clean up some kludgy old shadow password tests.
|
||||
|
||||
* prereq.m4 (utmp_includes): Define.
|
||||
Check for ut_user and ut_name members in both struct utmpx
|
||||
and struct utmp.
|
||||
|
||||
2000-01-29 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* lib-check.m4: New file containing library-related checks from
|
||||
fileutils and sh-utils (textutils had none).
|
||||
|
||||
2000-01-28 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* perl.m4: Change format of warning message to look more like that
|
||||
from the missing script. Suggestion from François Pinard.
|
||||
|
||||
2000-01-25 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* timespec.m4: Require AC_HEADER_TIME, and include sys/time.h as well
|
||||
as time.h in the compile check.
|
||||
* nanosleep.m4: Require AC_HEADER_TIME rather than simply using it.
|
||||
Fix typo in cross-compiling case: s/yes/no/.
|
||||
|
||||
2000-01-23 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* jm-macros.m4: Move df-related tests here from fileutils/configure.in
|
||||
|
||||
* ls-mntd-fs.m4: s/list_mounted_fs/ac_list_mounted_fs/
|
||||
(jm_LIST_MOUNTED_FILESYSTEMS): Take two parameters.
|
||||
|
||||
* fsusage.m4: New file. Extracted from fileutils/configure.in.
|
||||
s/space/ac_fsusage_space/.
|
||||
(jm_FILE_SYSTEM_USAGE): Take two parameters.
|
||||
|
||||
* ftruncate.m4: New file (derived from part of fileutils/configure.in).
|
||||
* jm-macros.m4: (jm_FUNC_FTRUNCATE): AC_REQUIRE it.
|
||||
(jm_CHECK_ALL_TYPES): Require AC_HEADER_MAJOR and AC_HEADER_DIRENT.
|
||||
|
||||
* jm-macros.m4: (OPTIONAL_BIN_PROGS, OPTIONAL_BIN_ZCRIPTS, MAN):
|
||||
AC_SUBST these here, rather than just in sh-util/configure.in, so
|
||||
that the now-shared-by-fileutils-and-textutils lib/Makefile.am are
|
||||
all the same.
|
||||
(AM_FUNC_OBSTACK): Add (from fileutils/configure.in).
|
||||
(AC_CHECK_FUNCS): Merge all checks from fileutils, textutils, sh-utils.
|
||||
(AM_FUNC_STRTOD): Added (from textutils', sh-utils' configure.in).
|
||||
(AC_SUBST(POW_LIBM)): Likewise.
|
||||
(AC_SUBST(DF_PROG)): Moved from fileutils/configure.in.
|
||||
|
||||
2000-01-22 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* jm-macros.m4: Call AC_PROG_CC_STDC just before AC_C_CONST.
|
||||
|
||||
* prereq.m4 (jm_PREREQ_QUOTEARG): Add wctype.h.
|
||||
|
||||
* jm-macros.m4 (AC_CHECK_HEADERS): Add checks from fileutils'
|
||||
configure.in
|
||||
(AC_CHECK_HEADERS): Likewise for sh-utils.
|
||||
(AC_CHECK_HEADERS): Likewise for textutils.
|
||||
Merge the three lists of headers.
|
||||
|
||||
* prereq.m4 (jm_PREREQ_ADDEXT): New macro. Parts moved here
|
||||
from fileutils' configure.in.
|
||||
|
||||
* decl.m4: Remove kludgy `test -z $ac_...AC_CHECK_HEADERS(...)' code.
|
||||
Moved tests into their own function (_jm_DECL_HEADERS) in check-decl.m4.
|
||||
|
||||
* check-decl.m4: Use #if rather than #ifdef.
|
||||
Add HAVE_DECL_STRTOUL and HAVE_DECL_STRTOULL.
|
||||
(jm_CHECK_DECLARATIONS): Add strtoul strtoull.
|
||||
(_jm_DECL_HEADERS): Define new function.
|
||||
(jm_CHECK_DECLARATIONS): Require it.
|
||||
|
||||
2000-01-19 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* nanosleep.m4 (jm_FUNC_NANOSLEEP): Include <sys/time.h>, too.
|
||||
Use AC_HEADER_TIME. Volker Borchert reported that OpenBSD-2.3/sparc
|
||||
defines `struct timespec' in <sys/time.h>
|
||||
|
||||
* c-bs-a.m4: Remove uses of changequote altogether.
|
||||
Thanks to Akim for explaining.
|
||||
|
||||
2000-01-16 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* jm-macros.m4: Require jm_FUNC_GROUP_MEMBER, jm_FUNC_PUTENV,
|
||||
AM_FUNC_ERROR_AT_LINE, jm_FUNC_GNU_STRFTIME, jm_FUNC_MKTIME,
|
||||
jm_FUNC_GETGROUPS AC_FUNC_VPRINTF, AC_FUNC_ALLOCA,
|
||||
AM_FUNC_GETLOADAVG, and jm_SYS_PROC_UPTIME.
|
||||
|
||||
2000-01-16 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* c-bs-a.m4: Use `changequote(<<,>>)', rather than `changequote(, )'
|
||||
because the latter didn't work.
|
||||
|
||||
2000-01-15 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* jm-macros.m4 (AC_REPLACE_FUNCS): Add gethostname and getusershell.
|
||||
(AC_REPLACE_FUNCS): Add memcpy and memset.
|
||||
Add these, too: stime strcspn stpcpy strstr strtol strtoul.
|
||||
Add strpbrk.
|
||||
Add these: euidaccess memcmp mkdir rmdir rpmatch strndup strverscmp.
|
||||
|
||||
2000-01-12 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* prereq.m4 (jm_PREREQ_CANON_HOST): New macro.
|
||||
(jm_PREREQ): Use it.
|
||||
(jm_PREREQ_READUTMP): New macro.
|
||||
(jm_PREREQ): Use it.
|
||||
|
||||
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.
|
||||
(jm_PREREQ): Use it.
|
||||
|
||||
2000-01-11 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* m4/uintmax_t.m4: Port to autoconf 2.13.
|
||||
|
||||
2000-01-08 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* strerror_r.m4 (jm_FUNC_STRERROR_R): New file/macro.
|
||||
|
||||
@@ -5,6 +5,7 @@ EXTRA_DIST = README Makefile.am.in \
|
||||
afs.m4 \
|
||||
assert.m4 \
|
||||
bison.m4 \
|
||||
c-bs-a.m4 \
|
||||
check-decl.m4 \
|
||||
chown.m4 \
|
||||
d-ino.m4 \
|
||||
@@ -13,6 +14,8 @@ decl.m4 \
|
||||
error.m4 \
|
||||
fnmatch.m4 \
|
||||
fstypename.m4 \
|
||||
fsusage.m4 \
|
||||
ftruncate.m4 \
|
||||
getgroups.m4 \
|
||||
getline.m4 \
|
||||
getloadavg.m4 \
|
||||
@@ -29,6 +32,7 @@ jm-winsz2.m4 \
|
||||
largefile.m4 \
|
||||
lchown.m4 \
|
||||
lcmessage.m4 \
|
||||
lib-check.m4 \
|
||||
link-follow.m4 \
|
||||
ls-mntd-fs.m4 \
|
||||
lstat-slash.m4 \
|
||||
|
||||
@@ -71,8 +71,10 @@ CXXCPP = @CXXCPP@
|
||||
DATADIRNAME = @DATADIRNAME@
|
||||
DEPDIR = @DEPDIR@
|
||||
DF_PROG = @DF_PROG@
|
||||
FESETROUND_LIBM = @FESETROUND_LIBM@
|
||||
GENCAT = @GENCAT@
|
||||
GETCONF = @GETCONF@
|
||||
GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
|
||||
GMOFILES = @GMOFILES@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GNU_PACKAGE = @GNU_PACKAGE@
|
||||
@@ -83,15 +85,23 @@ INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
KMEM_GROUP = @KMEM_GROUP@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIB_CRYPT = @LIB_CRYPT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MAN = @MAN@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
NEED_SETGID = @NEED_SETGID@
|
||||
OPTIONAL_BIN_PROGS = @OPTIONAL_BIN_PROGS@
|
||||
OPTIONAL_BIN_ZCRIPTS = @OPTIONAL_BIN_ZCRIPTS@
|
||||
PACKAGE = @PACKAGE@
|
||||
PERL = @PERL@
|
||||
POFILES = @POFILES@
|
||||
POSUB = @POSUB@
|
||||
POW_LIBM = @POW_LIBM@
|
||||
RANLIB = @RANLIB@
|
||||
SQRT_LIBM = @SQRT_LIBM@
|
||||
U = @U@
|
||||
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||
USE_NLS = @USE_NLS@
|
||||
@@ -105,6 +115,7 @@ EXTRA_DIST = README Makefile.am.in \
|
||||
afs.m4 \
|
||||
assert.m4 \
|
||||
bison.m4 \
|
||||
c-bs-a.m4 \
|
||||
check-decl.m4 \
|
||||
chown.m4 \
|
||||
d-ino.m4 \
|
||||
@@ -113,6 +124,8 @@ decl.m4 \
|
||||
error.m4 \
|
||||
fnmatch.m4 \
|
||||
fstypename.m4 \
|
||||
fsusage.m4 \
|
||||
ftruncate.m4 \
|
||||
getgroups.m4 \
|
||||
getline.m4 \
|
||||
getloadavg.m4 \
|
||||
@@ -129,6 +142,7 @@ jm-winsz2.m4 \
|
||||
largefile.m4 \
|
||||
lchown.m4 \
|
||||
lcmessage.m4 \
|
||||
lib-check.m4 \
|
||||
link-follow.m4 \
|
||||
ls-mntd-fs.m4 \
|
||||
lstat-slash.m4 \
|
||||
|
||||
23
m4/c-bs-a.m4
Normal file
23
m4/c-bs-a.m4
Normal file
@@ -0,0 +1,23 @@
|
||||
#serial 3
|
||||
|
||||
dnl From Paul Eggert.
|
||||
|
||||
AC_DEFUN(AC_C_BACKSLASH_A,
|
||||
[
|
||||
AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a,
|
||||
[AC_TRY_COMPILE([],
|
||||
[
|
||||
#if '\a' == 'a'
|
||||
syntax error;
|
||||
#endif
|
||||
char buf['\a' == 'a' ? -1 : 1];
|
||||
buf[0] = '\a';
|
||||
return buf[0] != "\a"[0];
|
||||
],
|
||||
ac_cv_c_backslash_a=yes,
|
||||
ac_cv_c_backslash_a=no)])
|
||||
if test $ac_cv_c_backslash_a = yes; then
|
||||
AC_DEFINE(HAVE_C_BACKSLASH_A, 1,
|
||||
[Define if backslash-a works in C strings.])
|
||||
fi
|
||||
])
|
||||
@@ -1,45 +1,53 @@
|
||||
#serial 5
|
||||
#serial 8
|
||||
|
||||
dnl This is just a wrapper function to encapsulate this kludge.
|
||||
dnl Putting it in a separate file like this helps share it between
|
||||
dnl different packages.
|
||||
AC_DEFUN(jm_CHECK_DECLS,
|
||||
[
|
||||
AC_REQUIRE([_jm_DECL_HEADERS])
|
||||
AC_REQUIRE([AC_HEADER_TIME])
|
||||
headers='
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_STRING_H
|
||||
#if HAVE_STRING_H
|
||||
# if !STDC_HEADERS && HAVE_MEMORY_H
|
||||
# include <memory.h>
|
||||
# endif
|
||||
# include <string.h>
|
||||
#else
|
||||
# ifdef HAVE_STRINGS_H
|
||||
# if HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
# endif
|
||||
#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#if HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
'
|
||||
|
||||
if test x = y; then
|
||||
dnl This code is deliberately never run via ./configure.
|
||||
dnl FIXME: this is a gross hack to make autoheader put entries
|
||||
dnl for each of these symbols in the config.h.in.
|
||||
dnl Otherwise, I'd have to update acconfig.h every time I change
|
||||
dnl this list of functions.
|
||||
AC_DEFINE(HAVE_DECL_FREE, 1, [Define if this function is declared.])
|
||||
AC_DEFINE(HAVE_DECL_LSEEK, 1, [Define if this function is declared.])
|
||||
AC_DEFINE(HAVE_DECL_MALLOC, 1, [Define if this function is declared.])
|
||||
AC_DEFINE(HAVE_DECL_MEMCHR, 1, [Define if this function is declared.])
|
||||
AC_DEFINE(HAVE_DECL_REALLOC, 1, [Define if this function is declared.])
|
||||
AC_DEFINE(HAVE_DECL_STPCPY, 1, [Define if this function is declared.])
|
||||
AC_DEFINE(HAVE_DECL_STRSTR, 1, [Define if this function is declared.])
|
||||
fi
|
||||
|
||||
jm_CHECK_DECLARATIONS($headers, free lseek malloc \
|
||||
memchr realloc stpcpy strstr)
|
||||
AC_CHECK_DECLS((free, getenv, lseek, malloc, memchr, nanosleep,
|
||||
realloc, stpcpy, strstr, strtoul, strtoull),
|
||||
, , $headers)
|
||||
])
|
||||
|
||||
dnl FIXME: when autoconf has support for it.
|
||||
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)
|
||||
])
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
#serial 3
|
||||
#serial 5
|
||||
|
||||
AC_DEFUN(jm_CHECK_DECLARATION,
|
||||
[
|
||||
AC_REQUIRE([AC_HEADER_STDC])dnl
|
||||
test -z "$ac_cv_header_memory_h" && AC_CHECK_HEADERS(memory.h)
|
||||
test -z "$ac_cv_header_string_h" && AC_CHECK_HEADERS(string.h)
|
||||
test -z "$ac_cv_header_strings_h" && AC_CHECK_HEADERS(strings.h)
|
||||
test -z "$ac_cv_header_stdlib_h" && AC_CHECK_HEADERS(stdlib.h)
|
||||
test -z "$ac_cv_header_unistd_h" && AC_CHECK_HEADERS(unistd.h)
|
||||
AC_MSG_CHECKING([whether $1 is declared])
|
||||
AC_CACHE_VAL(jm_cv_func_decl_$1,
|
||||
[AC_TRY_COMPILE($2,
|
||||
|
||||
192
m4/fsusage.m4
Normal file
192
m4/fsusage.m4
Normal file
@@ -0,0 +1,192 @@
|
||||
#serial 1
|
||||
|
||||
# From fileutils/configure.in
|
||||
|
||||
# Try to determine how a program can obtain filesystem usage information.
|
||||
# If successful, define the appropriate symbol (see fsusage.c) and
|
||||
# execute ACTION-IF-FOUND. Otherwise, execute ACTION-IF-NOT-FOUND.
|
||||
#
|
||||
# jm_FILE_SYSTEM_USAGE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
|
||||
AC_DEFUN(jm_FILE_SYSTEM_USAGE,
|
||||
[
|
||||
|
||||
AC_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
|
||||
# statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
|
||||
# because that got a false positive on SCO OSR5. Adding the declaration
|
||||
# of a `struct statvfs' causes this test to fail (as it should) on such
|
||||
# systems. That system is reported to work fine with STAT_STATFS4 which
|
||||
# is what it gets when this test fails.
|
||||
if test $ac_fsusage_space = no; then
|
||||
# SVR4
|
||||
AC_CACHE_CHECK([for statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
|
||||
[AC_TRY_LINK([#include <sys/types.h>
|
||||
#include <sys/statvfs.h>],
|
||||
[struct statvfs fsd; statvfs (0, &fsd);],
|
||||
fu_cv_sys_stat_statvfs=yes,
|
||||
fu_cv_sys_stat_statvfs=no)])
|
||||
if test $fu_cv_sys_stat_statvfs = yes; then
|
||||
ac_fsusage_space=yes
|
||||
AC_DEFINE(STAT_STATVFS, 1,
|
||||
[ Define if there is a function named statvfs. (SVR4)])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $ac_fsusage_space = no; then
|
||||
# DEC Alpha running OSF/1
|
||||
AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
|
||||
AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
|
||||
[AC_TRY_RUN([
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mount.h>
|
||||
main ()
|
||||
{
|
||||
struct statfs fsd;
|
||||
fsd.f_fsize = 0;
|
||||
exit (statfs (".", &fsd, sizeof (struct statfs)));
|
||||
}],
|
||||
fu_cv_sys_stat_statfs3_osf1=yes,
|
||||
fu_cv_sys_stat_statfs3_osf1=no,
|
||||
fu_cv_sys_stat_statfs3_osf1=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
|
||||
if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
|
||||
ac_fsusage_space=yes
|
||||
AC_DEFINE(STAT_STATFS3_OSF1, 1,
|
||||
[ Define if statfs takes 3 args. (DEC Alpha running OSF/1)])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $ac_fsusage_space = no; then
|
||||
# AIX
|
||||
AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
|
||||
member (AIX, 4.3BSD)])
|
||||
AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
|
||||
[AC_TRY_RUN([
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_MOUNT_H
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_VFS_H
|
||||
#include <sys/vfs.h>
|
||||
#endif
|
||||
main ()
|
||||
{
|
||||
struct statfs fsd;
|
||||
fsd.f_bsize = 0;
|
||||
exit (statfs (".", &fsd));
|
||||
}],
|
||||
fu_cv_sys_stat_statfs2_bsize=yes,
|
||||
fu_cv_sys_stat_statfs2_bsize=no,
|
||||
fu_cv_sys_stat_statfs2_bsize=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
|
||||
if test $fu_cv_sys_stat_statfs2_bsize = yes; then
|
||||
ac_fsusage_space=yes
|
||||
AC_DEFINE(STAT_STATFS2_BSIZE, 1,
|
||||
[ Define if statfs takes 2 args and struct statfs has a field named f_bsize.
|
||||
(4.3BSD, SunOS 4, HP-UX, AIX PS/2)])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $ac_fsusage_space = no; then
|
||||
# SVR3
|
||||
AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
|
||||
AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
|
||||
[AC_TRY_RUN([#include <sys/types.h>
|
||||
#include <sys/statfs.h>
|
||||
main ()
|
||||
{
|
||||
struct statfs fsd;
|
||||
exit (statfs (".", &fsd, sizeof fsd, 0));
|
||||
}],
|
||||
fu_cv_sys_stat_statfs4=yes,
|
||||
fu_cv_sys_stat_statfs4=no,
|
||||
fu_cv_sys_stat_statfs4=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
|
||||
if test $fu_cv_sys_stat_statfs4 = yes; then
|
||||
ac_fsusage_space=yes
|
||||
AC_DEFINE(STAT_STATFS4, 1,
|
||||
[ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $ac_fsusage_space = no; then
|
||||
# 4.4BSD and NetBSD
|
||||
AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
|
||||
member (4.4BSD and NetBSD)])
|
||||
AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
|
||||
[AC_TRY_RUN([#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_MOUNT_H
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
main ()
|
||||
{
|
||||
struct statfs fsd;
|
||||
fsd.f_fsize = 0;
|
||||
exit (statfs (".", &fsd));
|
||||
}],
|
||||
fu_cv_sys_stat_statfs2_fsize=yes,
|
||||
fu_cv_sys_stat_statfs2_fsize=no,
|
||||
fu_cv_sys_stat_statfs2_fsize=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
|
||||
if test $fu_cv_sys_stat_statfs2_fsize = yes; then
|
||||
ac_fsusage_space=yes
|
||||
AC_DEFINE(STAT_STATFS2_FSIZE, 1,
|
||||
[ Define if statfs takes 2 args and struct statfs has a field named f_fsize.
|
||||
(4.4BSD, NetBSD)])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $ac_fsusage_space = no; then
|
||||
# Ultrix
|
||||
AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
|
||||
AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
|
||||
[AC_TRY_RUN([#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_MOUNT_H
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_FS_TYPES_H
|
||||
#include <sys/fs_types.h>
|
||||
#endif
|
||||
main ()
|
||||
{
|
||||
struct fs_data fsd;
|
||||
/* Ultrix's statfs returns 1 for success,
|
||||
0 for not mounted, -1 for failure. */
|
||||
exit (statfs (".", &fsd) != 1);
|
||||
}],
|
||||
fu_cv_sys_stat_fs_data=yes,
|
||||
fu_cv_sys_stat_fs_data=no,
|
||||
fu_cv_sys_stat_fs_data=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
|
||||
if test $fu_cv_sys_stat_fs_data = yes; then
|
||||
ac_fsusage_space=yes
|
||||
AC_DEFINE(STAT_STATFS2_FS_DATA, 1,
|
||||
[ Define if statfs takes 2 args and the second argument has
|
||||
type struct fs_data. (Ultrix)])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $ac_fsusage_space = no; then
|
||||
# SVR2
|
||||
AC_TRY_CPP([#include <sys/filsys.h>],
|
||||
AC_DEFINE(STAT_READ_FILSYS, 1,
|
||||
[ Define if there is no specific function for reading filesystems usage
|
||||
information and you have the <sys/filsys.h> header file. (SVR2)])
|
||||
ac_fsusage_space=yes)
|
||||
fi
|
||||
|
||||
AC_SHELL_IFELSE([test $ac_fsusage_space = yes], [$1], [$2])dnl
|
||||
|
||||
])
|
||||
27
m4/ftruncate.m4
Normal file
27
m4/ftruncate.m4
Normal file
@@ -0,0 +1,27 @@
|
||||
#serial 1
|
||||
|
||||
# See if we need to emulate a missing ftruncate function using fcntl.
|
||||
|
||||
AC_DEFUN(jm_FUNC_FTRUNCATE,
|
||||
[
|
||||
AC_CHECK_FUNCS(ftruncate, , [ftruncate_missing=yes])
|
||||
|
||||
if test "$ftruncate_missing" = yes; then
|
||||
AC_CHECK_HEADERS(unistd.h)
|
||||
AC_MSG_CHECKING([fcntl emulation of ftruncate])
|
||||
AC_CACHE_VAL(fu_cv_sys_ftruncate_emulation,
|
||||
[AC_TRY_LINK([
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>], [
|
||||
#if !defined(F_CHSIZE) && !defined(F_FREESP)
|
||||
chsize();
|
||||
#endif
|
||||
],
|
||||
fu_cv_sys_ftruncate_emulation=yes,
|
||||
fu_cv_sys_ftruncate_emulation=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_ftruncate_emulation)
|
||||
if test $fu_cv_sys_ftruncate_emulation = yes; then
|
||||
LIBOBJS="$LIBOBJS ftruncate.$ac_objext"
|
||||
fi
|
||||
fi
|
||||
])
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 4
|
||||
#serial 5
|
||||
|
||||
AC_DEFUN(AM_FUNC_GETLOADAVG,
|
||||
[ac_have_func=no # yes means we've found a way to get the load average.
|
||||
@@ -103,9 +103,7 @@ AC_SUBST(NEED_SETGID)dnl
|
||||
|
||||
if test $ac_cv_func_getloadavg_setgid = yes; then
|
||||
AC_CACHE_CHECK(group of /dev/kmem, ac_cv_group_kmem,
|
||||
changequote(<<, >>)dnl
|
||||
<<
|
||||
# On Solaris, /dev/kmem is a symlink. Get info on the real file.
|
||||
[ # On Solaris, /dev/kmem is a symlink. Get info on the real file.
|
||||
ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null`
|
||||
# If we got an error (system does not support symlinks), try without -L.
|
||||
test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem`
|
||||
@@ -113,8 +111,7 @@ changequote(<<, >>)dnl
|
||||
| sed -ne 's/[ ][ ]*/ /g;
|
||||
s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/;
|
||||
/ /s/.* //;p;'`
|
||||
>>
|
||||
changequote([, ])dnl
|
||||
]
|
||||
)
|
||||
KMEM_GROUP=$ac_cv_group_kmem
|
||||
fi
|
||||
|
||||
@@ -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 107
|
||||
# serial 108
|
||||
|
||||
AC_PREREQ(2.13) dnl Minimum Autoconf version required.
|
||||
|
||||
@@ -303,16 +303,14 @@ strdup __argz_count __argz_stringify __argz_next])
|
||||
dnl Generate list of files to be processed by xgettext which will
|
||||
dnl be included in po/Makefile.
|
||||
test -d po || mkdir po
|
||||
changequote(, )dnl
|
||||
case "$srcdir" in
|
||||
.)
|
||||
posrcprefix="../" ;;
|
||||
/* | [A-Za-z]:*)
|
||||
/* | [[A-Za-z]]:*)
|
||||
posrcprefix="$srcdir/" ;;
|
||||
*)
|
||||
posrcprefix="../$srcdir/" ;;
|
||||
esac
|
||||
changequote([, ])dnl
|
||||
rm -f po/POTFILES
|
||||
sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
|
||||
< $srcdir/po/POTFILES.in > po/POTFILES
|
||||
|
||||
158
m4/jm-macros.m4
158
m4/jm-macros.m4
@@ -1,4 +1,4 @@
|
||||
#serial 12
|
||||
#serial 13
|
||||
|
||||
dnl Misc type-related macros for fileutils, sh-utils, textutils.
|
||||
|
||||
@@ -11,9 +11,51 @@ AC_DEFUN(jm_MACROS,
|
||||
[The concatenation of the strings `GNU ', and PACKAGE.])
|
||||
AC_SUBST(GNU_PACKAGE)
|
||||
|
||||
AC_SUBST(OPTIONAL_BIN_PROGS)
|
||||
AC_SUBST(OPTIONAL_BIN_ZCRIPTS)
|
||||
AC_SUBST(MAN)
|
||||
AC_SUBST(DF_PROG)
|
||||
|
||||
dnl This macro actually runs replacement code. See isc-posix.m4.
|
||||
AC_REQUIRE([AC_ISC_POSIX])dnl
|
||||
|
||||
AC_CHECK_HEADERS( \
|
||||
errno.h \
|
||||
fcntl.h \
|
||||
fenv.h \
|
||||
float.h \
|
||||
limits.h \
|
||||
memory.h \
|
||||
mntent.h \
|
||||
mnttab.h \
|
||||
netdb.h \
|
||||
paths.h \
|
||||
stdlib.h \
|
||||
string.h \
|
||||
sys/acl.h \
|
||||
sys/filsys.h \
|
||||
sys/fs/s5param.h \
|
||||
sys/fs_types.h \
|
||||
sys/fstyp.h \
|
||||
sys/ioctl.h \
|
||||
sys/mntent.h \
|
||||
sys/mount.h \
|
||||
sys/param.h \
|
||||
sys/socket.h \
|
||||
sys/statfs.h \
|
||||
sys/statvfs.h \
|
||||
sys/systeminfo.h \
|
||||
sys/time.h \
|
||||
sys/timeb.h \
|
||||
sys/vfs.h \
|
||||
sys/wait.h \
|
||||
syslog.h \
|
||||
termios.h \
|
||||
unistd.h \
|
||||
utime.h \
|
||||
values.h \
|
||||
)
|
||||
|
||||
jm_INCLUDED_REGEX([lib/regex.c])
|
||||
|
||||
AC_REQUIRE([jm_BISON])
|
||||
@@ -40,18 +82,35 @@ AC_DEFUN(jm_MACROS,
|
||||
AC_REQUIRE([jm_FUNC_MEMCMP])
|
||||
AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
|
||||
AC_REQUIRE([jm_FUNC_FNMATCH])
|
||||
AC_REQUIRE([jm_FUNC_GROUP_MEMBER])
|
||||
AC_REQUIRE([jm_FUNC_PUTENV])
|
||||
AC_REQUIRE([jm_AFS])
|
||||
AC_REQUIRE([jm_AC_PREREQ_XSTRTOUMAX])
|
||||
AC_REQUIRE([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK])
|
||||
AC_REQUIRE([AM_FUNC_ERROR_AT_LINE])
|
||||
AC_REQUIRE([jm_FUNC_GNU_STRFTIME])
|
||||
AC_REQUIRE([jm_FUNC_MKTIME])
|
||||
|
||||
AC_REQUIRE([jm_FUNC_GETGROUPS])
|
||||
test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
|
||||
|
||||
AC_REQUIRE([AC_FUNC_VPRINTF])
|
||||
AC_REQUIRE([AC_FUNC_ALLOCA])
|
||||
AC_REQUIRE([AM_FUNC_GETLOADAVG])
|
||||
AC_REQUIRE([jm_SYS_PROC_UPTIME])
|
||||
AC_REQUIRE([jm_FUNC_FTRUNCATE])
|
||||
|
||||
AC_REPLACE_FUNCS(strcasecmp strncasecmp)
|
||||
AC_REPLACE_FUNCS(dup2)
|
||||
AC_REPLACE_FUNCS(gethostname getusershell)
|
||||
AC_REPLACE_FUNCS(stime strcspn stpcpy strstr strtol strtoul)
|
||||
AC_REPLACE_FUNCS(strpbrk)
|
||||
AC_REPLACE_FUNCS(euidaccess memcmp mkdir rmdir rpmatch strndup strverscmp)
|
||||
|
||||
dnl used by e.g. intl/*domain.c and lib/canon-host.c
|
||||
AC_REPLACE_FUNCS(strdup)
|
||||
|
||||
AC_REPLACE_FUNCS(memchr)
|
||||
AC_REPLACE_FUNCS(memmove)
|
||||
AC_REPLACE_FUNCS(memchr memmove memcpy memset)
|
||||
AC_CHECK_FUNCS(getpagesize)
|
||||
|
||||
# By default, argmatch should fail calling usage (1).
|
||||
@@ -72,41 +131,90 @@ AC_DEFUN(jm_MACROS,
|
||||
AC_CHECK_FUNCS(clock_gettime)
|
||||
AC_CHECK_FUNCS(gettimeofday)
|
||||
|
||||
AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
|
||||
AC_REQUIRE([jm_FUNC_UTIME])
|
||||
|
||||
AC_CHECK_FUNCS( \
|
||||
acl \
|
||||
bcopy \
|
||||
endgrent \
|
||||
endpwent \
|
||||
fchdir \
|
||||
fdatasync \
|
||||
fseeko \
|
||||
ftime \
|
||||
ftruncate \
|
||||
getcwd \
|
||||
gethrtime \
|
||||
getmntinfo \
|
||||
hasmntopt \
|
||||
isascii \
|
||||
lchown \
|
||||
listmntent \
|
||||
localeconv \
|
||||
memcpy \
|
||||
mempcpy \
|
||||
mkfifo \
|
||||
realpath \
|
||||
resolvepath \
|
||||
sethostname \
|
||||
strchr \
|
||||
strerror \
|
||||
strrchr \
|
||||
sysinfo \
|
||||
tzset \
|
||||
)
|
||||
|
||||
AM_FUNC_GETLINE
|
||||
if test $am_cv_func_working_getline != yes; then
|
||||
AC_CHECK_FUNCS(getdelim)
|
||||
fi
|
||||
AM_FUNC_OBSTACK
|
||||
|
||||
AM_FUNC_STRTOD
|
||||
AC_SUBST(POW_LIBM)
|
||||
test $am_cv_func_strtod_needs_libm = yes && POW_LIBM=-lm
|
||||
|
||||
# These tests are for df.
|
||||
jm_LIST_MOUNTED_FILESYSTEMS([list_mounted_fs=yes], [list_mounted_fs=no])
|
||||
jm_FSTYPENAME
|
||||
jm_FILE_SYSTEM_USAGE([space=yes], [space=no])
|
||||
if test $list_mounted_fs = yes && test $space = yes; then
|
||||
DF_PROG="df"
|
||||
LIBOBJS="$LIBOBJS fsusage.$ac_objext"
|
||||
LIBOBJS="$LIBOBJS mountlist.$ac_objext"
|
||||
fi
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN(jm_CHECK_ALL_TYPES,
|
||||
[
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_BIGENDIAN
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
AC_C_LONG_DOUBLE
|
||||
AC_REQUIRE([AC_C_BIGENDIAN])
|
||||
AC_REQUIRE([AC_PROG_CC_STDC])
|
||||
AC_REQUIRE([AC_C_CONST])
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
AC_REQUIRE([AC_C_LONG_DOUBLE])
|
||||
|
||||
AC_HEADER_DIRENT
|
||||
AC_HEADER_STDC
|
||||
AC_REQUIRE([AC_HEADER_DIRENT])
|
||||
AC_REQUIRE([AC_HEADER_STDC])
|
||||
AC_CHECK_MEMBERS((struct stat.st_blksize))
|
||||
AC_STRUCT_ST_BLOCKS
|
||||
AC_REQUIRE([AC_STRUCT_ST_BLOCKS])
|
||||
|
||||
AC_STRUCT_TM
|
||||
AC_HEADER_TIME
|
||||
AC_STRUCT_TIMEZONE
|
||||
AC_HEADER_STAT
|
||||
AC_STRUCT_ST_MTIM_NSEC
|
||||
AC_STRUCT_ST_DM_MODE
|
||||
AC_REQUIRE([AC_STRUCT_TM])
|
||||
AC_REQUIRE([AC_STRUCT_TIMEZONE])
|
||||
AC_REQUIRE([AC_HEADER_STAT])
|
||||
AC_REQUIRE([AC_STRUCT_ST_MTIM_NSEC])
|
||||
AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
|
||||
AC_REQUIRE([jm_CHECK_TYPE_STRUCT_TIMESPEC])
|
||||
|
||||
AC_TYPE_GETGROUPS
|
||||
AC_TYPE_MODE_T
|
||||
AC_TYPE_OFF_T
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_SIGNAL
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_UID_T
|
||||
AC_REQUIRE([AC_TYPE_GETGROUPS])
|
||||
AC_REQUIRE([AC_TYPE_MODE_T])
|
||||
AC_REQUIRE([AC_TYPE_OFF_T])
|
||||
AC_REQUIRE([AC_TYPE_PID_T])
|
||||
AC_REQUIRE([AC_TYPE_SIGNAL])
|
||||
AC_REQUIRE([AC_TYPE_SIZE_T])
|
||||
AC_REQUIRE([AC_TYPE_UID_T])
|
||||
AC_CHECK_TYPE(ino_t, unsigned long)
|
||||
|
||||
dnl This relies on the fact that autoconf 2.14a's implementation of
|
||||
@@ -115,4 +223,8 @@ AC_DEFUN(jm_CHECK_ALL_TYPES,
|
||||
|
||||
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
|
||||
AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
|
||||
|
||||
AC_REQUIRE([AC_HEADER_MAJOR])
|
||||
AC_REQUIRE([AC_HEADER_DIRENT])
|
||||
|
||||
])
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 7
|
||||
#serial 8
|
||||
|
||||
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.
|
||||
@@ -20,17 +20,13 @@ AC_DEFUN(AC_SYS_LARGEFILE_FLAGS,
|
||||
ifelse($1, CFLAGS,
|
||||
[case "$host_os" in
|
||||
# HP-UX 10.20 requires -D__STDC_EXT__ with gcc 2.95.1.
|
||||
changequote(, )dnl
|
||||
hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
|
||||
changequote([, ])dnl
|
||||
[ hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)]
|
||||
if test "$GCC" = yes; then
|
||||
ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__
|
||||
fi
|
||||
;;
|
||||
# IRIX 6.2 and later require cc -n32.
|
||||
changequote(, )dnl
|
||||
irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
|
||||
changequote([, ])dnl
|
||||
[ 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
|
||||
fi
|
||||
@@ -61,17 +57,15 @@ dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAUL
|
||||
AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
|
||||
[AC_CACHE_CHECK([for $1], $2,
|
||||
[$2=no
|
||||
changequote(, )dnl
|
||||
$4
|
||||
for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
|
||||
case "$ac_flag" in
|
||||
-D$1)
|
||||
$2=1 ;;
|
||||
-D$1=*)
|
||||
$2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
|
||||
$2=`expr " $ac_flag" : '[[^=]]*=\(.*\)'` ;;
|
||||
esac
|
||||
done
|
||||
changequote([, ])dnl
|
||||
])
|
||||
if test "[$]$2" != no; then
|
||||
AC_DEFINE_UNQUOTED([$1], [$]$2, [$3])
|
||||
@@ -106,7 +100,7 @@ AC_DEFUN(AC_SYS_LARGEFILE,
|
||||
[Number of bits in a file offset, on hosts where this is settable.],
|
||||
[case "$host_os" in
|
||||
# HP-UX 10.20 and later
|
||||
hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
|
||||
[ hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)]
|
||||
ac_cv_sys_file_offset_bits=64 ;;
|
||||
esac])
|
||||
AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
|
||||
@@ -114,7 +108,7 @@ AC_DEFUN(AC_SYS_LARGEFILE,
|
||||
[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]*)
|
||||
[ hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)]
|
||||
ac_cv_sys_largefile_source=1 ;;
|
||||
esac])
|
||||
AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
|
||||
@@ -122,7 +116,7 @@ AC_DEFUN(AC_SYS_LARGEFILE,
|
||||
[Define for large files, on AIX-style hosts.],
|
||||
[case "$host_os" in
|
||||
# AIX 4.2 and later
|
||||
aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
|
||||
[ aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)]
|
||||
ac_cv_sys_large_files=1 ;;
|
||||
esac])
|
||||
fi
|
||||
|
||||
56
m4/lib-check.m4
Normal file
56
m4/lib-check.m4
Normal file
@@ -0,0 +1,56 @@
|
||||
#serial 2
|
||||
|
||||
dnl Misc lib-related macros for fileutils, sh-utils, textutils.
|
||||
|
||||
AC_DEFUN(jm_LIB_CHECK,
|
||||
[
|
||||
|
||||
# Check for libypsec.a on Dolphin M88K machines.
|
||||
AC_CHECK_LIB(ypsec, main)
|
||||
|
||||
# m88k running dgux 5.4 needs this
|
||||
AC_CHECK_LIB(ldgc, main)
|
||||
|
||||
# Some programs need to link with -lm. printf does if it uses
|
||||
# lib/strtod.c which uses pow. And seq uses the math functions,
|
||||
# floor, modf, rint. And factor uses sqrt. And sleep uses fesetround.
|
||||
|
||||
# Save a copy of $LIBS and add $FLOOR_LIBM before these tests
|
||||
# Check for these math functions used by seq.
|
||||
ac_su_saved_lib="$LIBS"
|
||||
LIBS="$LIBS -lm"
|
||||
AC_CHECK_FUNCS(floor modf rint)
|
||||
LIBS="$ac_su_saved_lib"
|
||||
|
||||
AC_SUBST(SQRT_LIBM)
|
||||
AC_CHECK_FUNCS(sqrt)
|
||||
if test $ac_cv_func_sqrt = no; then
|
||||
AC_CHECK_LIB(m, sqrt, [SQRT_LIBM=-lm])
|
||||
fi
|
||||
|
||||
AC_SUBST(FESETROUND_LIBM)
|
||||
AC_CHECK_FUNCS(fesetround)
|
||||
if test $ac_cv_func_fesetround = no; then
|
||||
AC_CHECK_LIB(m, fesetround, [FESETROUND_LIBM=-lm])
|
||||
fi
|
||||
|
||||
# The -lsun library is required for YP support on Irix-4.0.5 systems.
|
||||
# m88k/svr3 DolphinOS systems using YP need -lypsec for id.
|
||||
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])
|
||||
|
||||
# Requirements for su.c.
|
||||
AC_CHECK_MEMBERS((struct spwd.sp_pwdp))
|
||||
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.
|
||||
ac_su_saved_lib="$LIBS"
|
||||
AC_SEARCH_LIBS(crypt, [ufc crypt], [LIB_CRYPT="$ac_cv_search_crypt"])
|
||||
LIBS="$ac_su_saved_lib"
|
||||
AC_SUBST(LIB_CRYPT)
|
||||
])
|
||||
@@ -13,10 +13,11 @@ dnl
|
||||
|
||||
AC_PREREQ(2.14a)
|
||||
|
||||
# jm_LIST_MOUNTED_FILESYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
|
||||
AC_DEFUN(jm_LIST_MOUNTED_FILESYSTEMS,
|
||||
[
|
||||
# Determine how to get the list of mounted filesystems.
|
||||
list_mounted_fs=
|
||||
ac_list_mounted_fs=
|
||||
|
||||
# If the getmntent function is available but not in the standard library,
|
||||
# make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
|
||||
@@ -31,7 +32,7 @@ AC_FUNC_GETMNTENT
|
||||
# I think there is too great a chance that some non-Cray system has a
|
||||
# function named listmntent to risk the false positive.
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
if test -z "$ac_list_mounted_fs"; then
|
||||
# Cray UNICOS 9
|
||||
AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent,
|
||||
@@ -47,7 +48,7 @@ yes
|
||||
)
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
|
||||
if test $fu_cv_sys_mounted_cray_listmntent = yes; then
|
||||
list_mounted_fs=found
|
||||
ac_list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_LISTMNTENT, 1,
|
||||
[Define if there is a function named listmntent that can be used to
|
||||
list all mounted filesystems. (UNICOS)])
|
||||
@@ -59,7 +60,7 @@ if test $ac_cv_func_getmntent = yes; then
|
||||
# This system has the getmntent function.
|
||||
# Determine whether it's the one-argument variant or the two-argument one.
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
if test -z "$ac_list_mounted_fs"; then
|
||||
# 4.3BSD, SunOS, HP-UX, Dynix, Irix
|
||||
AC_MSG_CHECKING([for one-argument getmntent function])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
|
||||
@@ -68,7 +69,7 @@ if test $ac_cv_func_getmntent = yes; then
|
||||
|| fu_cv_sys_mounted_getmntent1=no])
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
|
||||
if test $fu_cv_sys_mounted_getmntent1 = yes; then
|
||||
list_mounted_fs=found
|
||||
ac_list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_GETMNTENT1, 1,
|
||||
[Define if there is a function named getmntent for reading the list
|
||||
of mounted filesystems, and that function takes a single argument.
|
||||
@@ -76,7 +77,7 @@ if test $ac_cv_func_getmntent = yes; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
if test -z "$ac_list_mounted_fs"; then
|
||||
# SVR4
|
||||
AC_MSG_CHECKING([for two-argument getmntent function])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
|
||||
@@ -85,20 +86,20 @@ if test $ac_cv_func_getmntent = yes; then
|
||||
fu_cv_sys_mounted_getmntent2=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
|
||||
if test $fu_cv_sys_mounted_getmntent2 = yes; then
|
||||
list_mounted_fs=found
|
||||
ac_list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_GETMNTENT2, 1,
|
||||
[Define if there is a function named getmntent for reading the list of
|
||||
mounted filesystems, and that function takes two arguments. (SVR4)])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
if test -z "$ac_list_mounted_fs"; then
|
||||
AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
if test -z "$ac_list_mounted_fs"; then
|
||||
# DEC Alpha running OSF/1.
|
||||
AC_MSG_CHECKING([for getfsstat function])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_getsstat,
|
||||
@@ -112,14 +113,14 @@ if test -z "$list_mounted_fs"; then
|
||||
fu_cv_sys_mounted_getsstat=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_getsstat)
|
||||
if test $fu_cv_sys_mounted_getsstat = yes; then
|
||||
list_mounted_fs=found
|
||||
ac_list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_GETFSSTAT, 1,
|
||||
[Define if there is a function named getfsstat for reading the
|
||||
list of mounted filesystems. (DEC Alpha running OSF/1)])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
if test -z "$ac_list_mounted_fs"; then
|
||||
# AIX.
|
||||
AC_MSG_CHECKING([for mntctl function and struct vmount])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
|
||||
@@ -128,7 +129,7 @@ if test -z "$list_mounted_fs"; then
|
||||
fu_cv_sys_mounted_vmount=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
|
||||
if test $fu_cv_sys_mounted_vmount = yes; then
|
||||
list_mounted_fs=found
|
||||
ac_list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_VMOUNT, 1,
|
||||
[Define if there is a function named mntctl that can be used to read
|
||||
the list of mounted filesystems, and there is a system header file
|
||||
@@ -136,7 +137,7 @@ if test -z "$list_mounted_fs"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
if test -z "$ac_list_mounted_fs"; then
|
||||
# SVR3
|
||||
AC_MSG_CHECKING([for FIXME existence of three headers])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
|
||||
@@ -148,7 +149,7 @@ if test -z "$list_mounted_fs"; then
|
||||
fu_cv_sys_mounted_fread_fstyp=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
|
||||
if test $fu_cv_sys_mounted_fread_fstyp = yes; then
|
||||
list_mounted_fs=found
|
||||
ac_list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
|
||||
[Define if (like SVR2) there is no specific function for reading the
|
||||
list of mounted filesystems, and your system has these header files:
|
||||
@@ -156,7 +157,7 @@ if test -z "$list_mounted_fs"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
if test -z "$ac_list_mounted_fs"; then
|
||||
# 4.4BSD and DEC OSF/1.
|
||||
AC_MSG_CHECKING([for getmntinfo function])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
|
||||
@@ -172,7 +173,7 @@ if test -z "$list_mounted_fs"; then
|
||||
])
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
|
||||
if test $fu_cv_sys_mounted_getmntinfo = yes; then
|
||||
list_mounted_fs=found
|
||||
ac_list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_GETMNTINFO, 1,
|
||||
[Define if there is a function named getmntinfo for reading the
|
||||
list of mounted filesystems. (4.4BSD)])
|
||||
@@ -181,7 +182,7 @@ fi
|
||||
|
||||
# FIXME: add a test for netbsd-1.1 here
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
if test -z "$ac_list_mounted_fs"; then
|
||||
# Ultrix
|
||||
AC_MSG_CHECKING([for getmnt function])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
|
||||
@@ -192,14 +193,14 @@ if test -z "$list_mounted_fs"; then
|
||||
fu_cv_sys_mounted_getmnt=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
|
||||
if test $fu_cv_sys_mounted_getmnt = yes; then
|
||||
list_mounted_fs=found
|
||||
ac_list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_GETMNT, 1,
|
||||
[Define if there is a function named getmnt for reading the list of
|
||||
mounted filesystems. (Ultrix)])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
if test -z "$ac_list_mounted_fs"; then
|
||||
# SVR2
|
||||
AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
|
||||
AC_CACHE_VAL(fu_cv_sys_mounted_fread,
|
||||
@@ -208,17 +209,19 @@ if test -z "$list_mounted_fs"; then
|
||||
fu_cv_sys_mounted_fread=no)])
|
||||
AC_MSG_RESULT($fu_cv_sys_mounted_fread)
|
||||
if test $fu_cv_sys_mounted_fread = yes; then
|
||||
list_mounted_fs=found
|
||||
ac_list_mounted_fs=found
|
||||
AC_DEFINE(MOUNTED_FREAD, 1,
|
||||
[Define if there is no specific function for reading the list of
|
||||
mounted filesystems. fread will be used to read /etc/mnttab. (SVR2) ])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$list_mounted_fs"; then
|
||||
if test -z "$ac_list_mounted_fs"; then
|
||||
AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
|
||||
# FIXME -- no need to abort building the whole package
|
||||
# Can't build mountlist.c or anything that needs its functions
|
||||
fi
|
||||
|
||||
AC_SHELL_IFELSE([test $ac_list_mounted_fs = found], [$1], [$2])dnl
|
||||
|
||||
])
|
||||
|
||||
11
m4/memcmp.m4
11
m4/memcmp.m4
@@ -1,13 +1,12 @@
|
||||
#serial 3
|
||||
#serial 4
|
||||
|
||||
dnl A replacement for autoconf's AC_FUNC_MEMCMP that detects
|
||||
dnl the losing memcmp on some x86 Next systems.
|
||||
AC_DEFUN(jm_AC_FUNC_MEMCMP,
|
||||
[AC_CACHE_CHECK([for working memcmp], jm_cv_func_memcmp_working,
|
||||
[AC_TRY_RUN(
|
||||
changequote(<<, >>)dnl
|
||||
<<
|
||||
main()
|
||||
[int
|
||||
main ()
|
||||
{
|
||||
/* Some versions of memcmp are not 8-bit clean. */
|
||||
char c0 = 0x40, c1 = 0x80, c2 = 0x81;
|
||||
@@ -32,9 +31,7 @@ main()
|
||||
}
|
||||
exit (0);
|
||||
}
|
||||
}
|
||||
>>,
|
||||
changequote([, ])dnl
|
||||
}],
|
||||
jm_cv_func_memcmp_working=yes,
|
||||
jm_cv_func_memcmp_working=no,
|
||||
jm_cv_func_memcmp_working=no)])
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 2
|
||||
#serial 5
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl Check for the nanosleep function.
|
||||
@@ -13,8 +13,19 @@ AC_DEFUN(jm_FUNC_NANOSLEEP,
|
||||
|
||||
AC_CACHE_CHECK([whether nanosleep works],
|
||||
jm_cv_func_nanosleep_works,
|
||||
[AC_TRY_RUN([
|
||||
# include <time.h>
|
||||
[
|
||||
AC_REQUIRE([AC_HEADER_TIME])
|
||||
AC_TRY_RUN([
|
||||
# if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
# else
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
# endif
|
||||
|
||||
int
|
||||
main ()
|
||||
@@ -28,12 +39,12 @@ AC_DEFUN(jm_FUNC_NANOSLEEP,
|
||||
jm_cv_func_nanosleep_works=yes,
|
||||
jm_cv_func_nanosleep_works=no,
|
||||
dnl When crosscompiling, assume the worst.
|
||||
jm_cv_func_nanosleep_works=yes)
|
||||
jm_cv_func_nanosleep_works=no)
|
||||
])
|
||||
if test $jm_cv_func_nanosleep_works = no; then
|
||||
AC_SUBST(LIBOBJS)
|
||||
LIBOBJS="$LIBOBJS nanosleep.$ac_objext"
|
||||
AC_DEFINE_UNQUOTED(nanosleep, gnu_nanosleep,
|
||||
[Define to gnu_nanosleep if the replacement function should be used.])
|
||||
AC_DEFINE_UNQUOTED(nanosleep, rpl_nanosleep,
|
||||
[Define to rpl_nanosleep if the replacement function should be used.])
|
||||
fi
|
||||
])
|
||||
|
||||
10
m4/perl.m4
10
m4/perl.m4
@@ -1,4 +1,4 @@
|
||||
#serial 2
|
||||
#serial 3
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl Find a new-enough version of Perl.
|
||||
@@ -33,9 +33,9 @@ AC_DEFUN(jm_PERL,
|
||||
|
||||
AC_MSG_RESULT($found)
|
||||
test $found = no && AC_MSG_WARN([
|
||||
*** You don't seem to have perl5.003 or newer installed, or you lack
|
||||
*** a usable version of the Perl File::Compare module. As a result,
|
||||
*** you may be unable to run a few tests or to regenerate certain
|
||||
*** files if you modify the sources from which they are derived.
|
||||
WARNING: You don't seem to have perl5.003 or newer installed, or you lack
|
||||
a usable version of the Perl File::Compare module. As a result,
|
||||
you may be unable to run a few tests or to regenerate certain
|
||||
files if you modify the sources from which they are derived.
|
||||
] )
|
||||
])
|
||||
|
||||
61
m4/prereq.m4
61
m4/prereq.m4
@@ -1,15 +1,72 @@
|
||||
#serial 2
|
||||
#serial 5
|
||||
|
||||
dnl These are the prerequisite macros for files in the lib/
|
||||
dnl directories of the fileutils, sh-utils, and textutils packages.
|
||||
|
||||
AC_DEFUN(jm_PREREQ,
|
||||
[
|
||||
jm_PREREQ_ADDEXT
|
||||
jm_PREREQ_CANON_HOST
|
||||
jm_PREREQ_ERROR
|
||||
jm_PREREQ_QUOTEARG
|
||||
jm_PREREQ_READUTMP
|
||||
jm_PREREQ_REGEX
|
||||
])
|
||||
|
||||
dnl FIXME: maybe put this in a separate file
|
||||
AC_DEFUN(jm_PREREQ_ADDEXT,
|
||||
[
|
||||
dnl For addext.c.
|
||||
AC_SYS_LONG_FILE_NAMES
|
||||
AC_CHECK_FUNCS(pathconf)
|
||||
AC_CHECK_HEADERS(limits.h string.h unistd.h)
|
||||
])
|
||||
|
||||
AC_DEFUN(jm_PREREQ_CANON_HOST,
|
||||
[
|
||||
dnl Add any libraries as early as possible.
|
||||
dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1,
|
||||
dnl so we have to add -lnsl to LIBS before checking for that function.
|
||||
AC_SEARCH_LIBS(gethostbyname, [inet nsl])
|
||||
|
||||
dnl These come from -lnsl on Solaris5.5.1.
|
||||
AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
|
||||
|
||||
AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
|
||||
AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
|
||||
netinet/in.h arpa/inet.h)
|
||||
])
|
||||
|
||||
AC_DEFUN(jm_PREREQ_QUOTEARG,
|
||||
[
|
||||
AC_CHECK_FUNCS(isascii mbrtowc)
|
||||
AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
|
||||
AC_HEADER_STDC
|
||||
AC_C_BACKSLASH_A
|
||||
AM_C_PROTOTYPES
|
||||
])
|
||||
|
||||
AC_DEFUN(jm_PREREQ_READUTMP,
|
||||
[
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(string.h utmpx.h sys/param.h)
|
||||
AC_CHECK_FUNCS(utmpname)
|
||||
AC_CHECK_FUNCS(utmpxname)
|
||||
AM_C_PROTOTYPES
|
||||
|
||||
utmp_includes="\
|
||||
$ac_includes_default
|
||||
#ifdef HAVE_UTMPX_H
|
||||
# include <utmpx.h>
|
||||
#else
|
||||
# include <utmp.h>
|
||||
#endif
|
||||
"
|
||||
AC_CHECK_MEMBERS((struct utmpx.ut_user),,,[$utmp_includes])
|
||||
AC_CHECK_MEMBERS((struct utmp.ut_user),,,[$utmp_includes])
|
||||
AC_CHECK_MEMBERS((struct utmpx.ut_name),,,[$utmp_includes])
|
||||
AC_CHECK_MEMBERS((struct utmp.ut_name),,,[$utmp_includes])
|
||||
])
|
||||
|
||||
AC_DEFUN(jm_PREREQ_REGEX,
|
||||
[
|
||||
dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks it.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 2
|
||||
#serial 3
|
||||
|
||||
dnl SunOS's readdir is broken in such a way that rm.c has to add extra code
|
||||
dnl to test whether a NULL return value really means there are no more files
|
||||
@@ -23,9 +23,7 @@ AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir,
|
||||
ac_clean_files="$ac_clean_files conf-dir"
|
||||
|
||||
AC_TRY_RUN(
|
||||
changequote(<<, >>)dnl
|
||||
<<
|
||||
# include <stdio.h>
|
||||
[# include <stdio.h>
|
||||
# include <sys/types.h>
|
||||
# if HAVE_STRING_H
|
||||
# include <string.h>
|
||||
@@ -119,9 +117,7 @@ AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir,
|
||||
create_300_file_dir (dir);
|
||||
remove_dir (dir);
|
||||
exit (0);
|
||||
}
|
||||
>>,
|
||||
changequote([, ])dnl
|
||||
}],
|
||||
jm_cv_func_working_readdir=yes,
|
||||
jm_cv_func_working_readdir=no,
|
||||
jm_cv_func_working_readdir=no)])
|
||||
|
||||
10
m4/regex.m4
10
m4/regex.m4
@@ -1,4 +1,4 @@
|
||||
#serial 5
|
||||
#serial 6
|
||||
|
||||
dnl Initially derived from code in GNU grep.
|
||||
dnl Mostly written by Jim Meyering.
|
||||
@@ -21,9 +21,7 @@ AC_DEFUN(jm_INCLUDED_REGEX,
|
||||
AC_CACHE_CHECK([for working re_compile_pattern],
|
||||
jm_cv_func_working_re_compile_pattern,
|
||||
AC_TRY_RUN(
|
||||
changequote(<<, >>)dnl
|
||||
<<
|
||||
#include <stdio.h>
|
||||
[#include <stdio.h>
|
||||
#include <regex.h>
|
||||
int
|
||||
main ()
|
||||
@@ -37,9 +35,7 @@ AC_DEFUN(jm_INCLUDED_REGEX,
|
||||
/* This should fail with _Invalid character class name_ error. */
|
||||
exit (s ? 0 : 1);
|
||||
}
|
||||
>>,
|
||||
changequote([, ])dnl
|
||||
|
||||
],
|
||||
jm_cv_func_working_re_compile_pattern=yes,
|
||||
jm_cv_func_working_re_compile_pattern=no,
|
||||
dnl When crosscompiling, assume it's broken.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#serial 1
|
||||
#serial 2
|
||||
|
||||
dnl From Jim Meyering.
|
||||
dnl Determine whether the strerror_r implementation is one of
|
||||
dnl the broken ones that returns `int' rather than `char*'.
|
||||
dnl Actually, this tests only whether it returns a scalar
|
||||
dnl or an array, but that should be enough.
|
||||
dnl On at least DEC UNIX 4.0[A-D], strerror_r returns `int'.
|
||||
dnl This is used by lib/error.c.
|
||||
dnl On at least DEC UNIX 4.0[A-D] and HP-UX B.10.20, strerror_r
|
||||
dnl returns `int'. This is used by lib/error.c.
|
||||
|
||||
AC_DEFUN(jm_FUNC_STRERROR_R,
|
||||
[
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 8
|
||||
#serial 9
|
||||
|
||||
dnl This macro is intended to be used solely in this file.
|
||||
dnl These are the prerequisite macros for GNU's strftime.c replacement.
|
||||
@@ -36,8 +36,7 @@ AC_DEFUN(jm_FUNC_GNU_STRFTIME,
|
||||
AC_CHECK_HEADERS(sys/time.h)
|
||||
AC_CACHE_CHECK([for working GNU strftime], jm_cv_func_working_gnu_strftime,
|
||||
[AC_TRY_RUN(
|
||||
changequote(<<, >>)dnl
|
||||
<< /* Ulrich Drepper provided parts of the test program. */
|
||||
[ /* Ulrich Drepper provided parts of the test program. */
|
||||
#if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
@@ -134,9 +133,7 @@ main ()
|
||||
CMP ("%z", "+0000"); /* GNU */
|
||||
|
||||
exit (n_fail ? 1 : 0);
|
||||
}
|
||||
>>,
|
||||
changequote([, ])dnl
|
||||
}],
|
||||
jm_cv_func_working_gnu_strftime=yes,
|
||||
jm_cv_func_working_gnu_strftime=no,
|
||||
dnl When crosscompiling, assume strftime is missing or broken.
|
||||
|
||||
@@ -1,15 +1,26 @@
|
||||
#serial 1
|
||||
#serial 3
|
||||
|
||||
dnl From Jim Meyering
|
||||
|
||||
dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared in time.h.
|
||||
dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
|
||||
dnl in time.h or sys/time.h.
|
||||
|
||||
AC_DEFUN(jm_CHECK_TYPE_STRUCT_TIMESPEC,
|
||||
[
|
||||
AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
|
||||
AC_REQUIRE([AC_HEADER_TIME])
|
||||
[AC_TRY_COMPILE(
|
||||
[
|
||||
#include <time.h>
|
||||
# if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
# else
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
# endif
|
||||
],
|
||||
[static struct timespec x; x.tv_sec = x.tv_nsec;],
|
||||
fu_cv_sys_struct_timespec=yes,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#serial 4
|
||||
#serial 5
|
||||
|
||||
dnl From Paul Eggert.
|
||||
|
||||
AC_PREREQ(2.14a)
|
||||
AC_PREREQ(2.13)
|
||||
|
||||
# Define uintmax_t to `unsigned long' or `unsigned long long'
|
||||
# if <inttypes.h> does not exist.
|
||||
@@ -16,7 +16,7 @@ AC_DEFUN(jm_AC_TYPE_UINTMAX_T,
|
||||
&& ac_type='unsigned long long' \
|
||||
|| ac_type='unsigned long'
|
||||
AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
|
||||
[ Define to `unsigned long' or `unsigned long long'
|
||||
[ Define to unsigned long or unsigned long long
|
||||
if <inttypes.h> doesn't define.])
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[NAME]
|
||||
chgrp \- change group ownership
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
.\" Add any additional description here
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[NAME]
|
||||
dircolors \- color setup for ls
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
.\" Add any additional description here
|
||||
|
||||
2
man/du.x
2
man/du.x
@@ -1,4 +1,4 @@
|
||||
[NAME]
|
||||
du \- estimate file space usage
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
.\" Add any additional description here
|
||||
|
||||
2
man/ln.x
2
man/ln.x
@@ -1,4 +1,4 @@
|
||||
[NAME]
|
||||
ln \- make links between files
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
.\" Add any additional description here
|
||||
|
||||
2
man/ls.x
2
man/ls.x
@@ -1,4 +1,4 @@
|
||||
[NAME]
|
||||
ls \- list directory contents
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
.\" Add any additional description here
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[NAME]
|
||||
mkdir \- make directories
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
.\" Add any additional description here
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[NAME]
|
||||
mkfifo \- make FIFOs (named pipes)
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
.\" Add any additional description here
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[NAME]
|
||||
mknod \- make block or character special files
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
.\" Add any additional description here
|
||||
|
||||
2
man/mv.x
2
man/mv.x
@@ -1,4 +1,4 @@
|
||||
[NAME]
|
||||
mv \- move (rename) files
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
.\" Add any additional description here
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[NAME]
|
||||
rmdir \- remove empty directories
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
.\" Add any additional description here
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[NAME]
|
||||
shred \- delete a file securely, first overwriting it to hide its contents
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
.\" Add any additional description here
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[NAME]
|
||||
sync \- flush filesystem buffers
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
.\" Add any additional description here
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[NAME]
|
||||
touch \- change file timestamps
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
.\" Add any additional description here
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[NAME]
|
||||
vdir \- list directory contents
|
||||
[DESCRIPTION]
|
||||
." Add any additional description here
|
||||
.\" Add any additional description here
|
||||
|
||||
@@ -1,3 +1,233 @@
|
||||
2000-02-27 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 4.0q.
|
||||
|
||||
* src/sys2.h: Guard declaration of strtoull also with
|
||||
`&& HAVE_UNSIGNED_LONG_LONG'.
|
||||
|
||||
* src/sys2.h: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL...'
|
||||
now that autoconf always defines the HAVE_DECL_ symbols.
|
||||
|
||||
* src/install.c (install_file_to_path): Always use install_file_in_file.
|
||||
Based on a patch from Adam Klein via Michael Stone.
|
||||
|
||||
* tests/install/Makefile.am (TESTS): Add create-leading.
|
||||
* tests/install/create-leading: New file.
|
||||
|
||||
* tests/install/basic-1: Clean up.
|
||||
* tests/install/Makefile.am (TESTS_ENVIRONMENT): Add PATH. Remove cruft.
|
||||
|
||||
2000-02-26 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Tranform the generated src/Makefile.in file so it falls back on
|
||||
using /bin/rm when necessary. The old rule didn't always work.
|
||||
This is necessary only on certain losing systems, and because this
|
||||
package builds an `rm' executable and some people put `.' too
|
||||
early in their PATH.
|
||||
* Makefile.am (DISTCLEANFILES): Remove .deps and `FIXME' comment.
|
||||
(EXTRA_DIST): Add .kludge-stamp.
|
||||
(.kludge-stamp): New rule.
|
||||
* src/Makefile.am (AUTOMAKE): Remove definition.
|
||||
(Makefile.in): Remove dependency on automake-wrap script.
|
||||
(EXTRA_DIST): Remove automake-wrap.
|
||||
* src/automake-wrap: Remove file.
|
||||
|
||||
* tests/rm/r-2: Don't make the success of the test depend on the
|
||||
order in which directory entries are processed.
|
||||
Reported by Andreas Schwab.
|
||||
|
||||
2000-02-12 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* po/POTFILES.in: Add lib/userspec.c.
|
||||
|
||||
* doc/fileutils.texi (chown invocation): Deprecate use of `.'.
|
||||
|
||||
* src/chown.c (usage): Mention only `:', and not `.' as the separator,
|
||||
since POSIX allows only the former.
|
||||
Prompted by a report from Manas Garg.
|
||||
|
||||
2000-02-11 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/df.c (main): Count the stat'able arguments.
|
||||
Print the header line only if there is at least one valid argument.
|
||||
Reported by Andy Longton <alongton@metamark.com>
|
||||
|
||||
2000-02-10 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Make du work when invoked from an unreadable directory.
|
||||
|
||||
* src/du.c (pop_dir): New function.
|
||||
(count_entry): Factor out common code (pop_dir), and call the new
|
||||
function instead.
|
||||
Move declaration of global, `stat_buf' into this function.
|
||||
(du_files): Don't stat `.' or call save_cwd, since count_entry
|
||||
never returns with a changed working directory.
|
||||
|
||||
2000-02-09 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/mv/mv-special-1: Use $null and $dir in place of literals
|
||||
in `here' script.
|
||||
Exit 77 if we can't set up the framework (Volker Borchert reported
|
||||
that this test would fail because mknod failed when run on SunOS4.1.4
|
||||
using NFS-mounted disk from an OpenBSD system).
|
||||
|
||||
2000-02-05 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/copy.c (copy_internal): Don't allow mv to move a directory onto
|
||||
a non-directory. Reported by Brian Kimball via Michael Stone.
|
||||
|
||||
2000-02-03 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/mv/Makefile.am (TESTS): Add dir-file.
|
||||
(TESTS_ENVIRONMENT): Remove vestiges of old tests.
|
||||
* tests/mv/dir-file: New file.
|
||||
|
||||
2000-02-02 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/touch/Makefile.am (TESTS): Add fifo.
|
||||
* tests/touch/fifo (fail): New file.
|
||||
|
||||
2000-02-01 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/touch.c (O_NDELAY): Define to 0 if not defined.
|
||||
(O_NONBLOCK): Define to O_NDELAY if not defined.
|
||||
(touch): Open with O_NONBLOCK, so one can touch a fifo without hanging.
|
||||
Reported by Eric G. Miller via Michael Stone.
|
||||
|
||||
* man/*.x: Change ." to .\".
|
||||
Reported by Andreas Schwab and Brendan O'Dea.
|
||||
|
||||
2000-01-31 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* man/Makefile.maint (ginstall_filter): Define.
|
||||
($(man_MANS)): Use it here so that the install.1 man page refers
|
||||
to `install', not `ginstall'. Reported by Andreas Schwab.
|
||||
|
||||
2000-01-30 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 4.0p.
|
||||
|
||||
* configure.in: Move library-related tests into m4/lib-check.m4.
|
||||
|
||||
* src/system.h (ST_NBLOCKS): Use st_size only for regular files and
|
||||
for directories. From H. J. Lu.
|
||||
|
||||
* src/dd.c (main): Exit with nonzero status if ftruncate fails.
|
||||
|
||||
2000-01-24 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/ln.c (usage): Describe behavior when LINK_NAME is omitted.
|
||||
From Michael Stone.
|
||||
|
||||
* src/mv.c (main): Don't expect array index `n_files - 1' to evaluate
|
||||
to `-1' for unsigned int n_files == 0. Doing so lead to a segfault on
|
||||
alpha. From Michael Stone.
|
||||
|
||||
2000-01-23 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure.in (AM_FUNC_OBSTACK): Remove. (move to m4/.)
|
||||
Remove nearly all function checks (moved to m4/.)
|
||||
(AC_SUBST(DF_PROG)): Move this to m4/.
|
||||
(ftruncate test): Move into new file: m4/ftruncate.m4.
|
||||
(AC_HEADER_MAJOR, AC_HEADER_DIRENT): Move into m4/.
|
||||
Remove df-related tests. i.e., move jm_LIST_MOUNTED_FILESYSTEMS,
|
||||
jm_FSTYPENAME, and jm_FILE_SYSTEM_USAGE) into m4/.
|
||||
|
||||
2000-01-22 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure.in: Move addext.c prerequisites from this file into m4/.
|
||||
(AC_CHECK_HEADERS): Move these checks into m4/.
|
||||
|
||||
2000-01-17 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/dd.c (interrupt_handler): Likewise.
|
||||
(install_handler): Use SA_NOCLDSTOP, not _POSIX_VERSION,
|
||||
to decide whether to call sigaction; this fixes an old typo.
|
||||
|
||||
2000-01-16 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* lib/Makefile.am: Sync with sh-utils/lib/Makefile.am.
|
||||
|
||||
* configure.in: Remove AM_FUNC_ERROR_AT_LINE, jm_FUNC_GNU_STRFTIME,
|
||||
jm_FUNC_GROUP_MEMBER, jm_FUNC_GETGROUPS, AC_FUNC_VPRINTF, and
|
||||
AC_FUNC_ALLOCA. They're now in m4/.
|
||||
|
||||
Sync with the version from emacs-20.5.
|
||||
* lib/alloca.c
|
||||
(<string.h>): Include if HAVE_STRING_H.
|
||||
(<stdlib.h>): Include if HAVE_STDLIB_H.
|
||||
(alloca): Abort if malloc fails.
|
||||
Reported by Paul Eggert.
|
||||
|
||||
2000-01-15 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure.in (AC_REPLACE_FUNCS): Remove these: euidaccess memcpy
|
||||
memcmp memset mkdir rmdir rpmatch stpcpy strndup strstr strtol
|
||||
strtoul strverscmp. Now they're in m4/.
|
||||
|
||||
2000-01-12 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/shred/remove: Make the warning that this shred test may not
|
||||
be run as root more prominent. Suggestion from Volker Borchert.
|
||||
|
||||
2000-01-11 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
Quote multibyte characters correctly.
|
||||
|
||||
* lib/quotearg.c (ISGRAPH): Remove.
|
||||
(ISPRINT): New macro.
|
||||
(<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H.
|
||||
(isprint, mbrtowc, mbsinit, mbstate_t): New macros,
|
||||
defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
|
||||
(quotearg_buffer_restyled): New function, with most of the old
|
||||
quotearg_buffer's contents.
|
||||
Major rewrite to support multibyte characters.
|
||||
(quotearg_buffer): Now just calls quotearg_buffer_restyled.
|
||||
|
||||
* m4/c-bs-a.m4: New file.
|
||||
* m4/prereq.m4 (jm_PREREQ_QUOTEARG): New macro.
|
||||
(jm_PREREQ): Use it.
|
||||
|
||||
2000-01-11 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* lib/modechange.c (mode_compile): Use uintmax_t, not unsigned
|
||||
long, to parse numeric modes. Check for any unknown bits, not
|
||||
just unknown bits left of the leftmost known bit.
|
||||
|
||||
2000-01-11 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* lib/getdate.y: Update copyright notice.
|
||||
|
||||
2000-01-11 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* COPYING: Sync with latest FSF version (fixing a minor Y2k problem).
|
||||
|
||||
2000-01-11 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* lib/exclude.c, lib/exclude.h: Sync to the slightly more
|
||||
general version of GNU tar.
|
||||
|
||||
* src/du.c (count_entry):
|
||||
Adjust to new calling convention for excluded_filename.
|
||||
(main): Likewise, for add_exclude_file.
|
||||
|
||||
2000-01-11 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* lib/memcpy.c (memcpy): Protoize.
|
||||
|
||||
Prepare to sync lib/ directories of fileutils, sh-utils, and textutils.
|
||||
* lib/Makefile.am: s/fu/fetish/
|
||||
* src/Makefile.am: s/libfu/libfetish/
|
||||
|
||||
* lib/hash.c (hash_initialize): Fix typo in comment.
|
||||
From François Pinard.
|
||||
|
||||
2000-01-10 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 4.0o.
|
||||
|
||||
* lib/Makefile.am (noinst_HEADERS): Add nanosleep.h.
|
||||
|
||||
2000-01-09 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 4.0n.
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
Changes in release 4.1:
|
||||
[4.0q]
|
||||
* install -D bug is fixed
|
||||
* chown now works properly when the specified login name contains a period
|
||||
This is at the expense of always looking up the entire USER.GROUP string
|
||||
as a login name first, and only then (upon failure) interpreting the `.'
|
||||
as a separator and looking up `USER'. To avoid the extra getpwnam call,
|
||||
always use the POSIX-mandated `:' character as the separator.
|
||||
* `du some-other-dir' no longer fails if it can't open the current directory
|
||||
* `mv DIR EXISTING-FILE' no longer removes EXISTING-FILE. Now it gets an error
|
||||
as POSIX says it must.
|
||||
* touch no longer hangs on fifos
|
||||
[4.0p]
|
||||
* various tools: quote multibyte characters correctly in diagnostics
|
||||
* mv: portability fix for alpha
|
||||
* dd: portability fix
|
||||
* unified lib/: now that directory and most of the configuration framework
|
||||
is common between fileutils, textutils, and sh-utils
|
||||
[4.0o]
|
||||
* Include lib/nanosleep.h.
|
||||
[4.0n]
|
||||
* cp, install, ln, and mv: when making backup files in verbose mode, these
|
||||
commands now print the backup file name on the same line as the rest of the
|
||||
|
||||
@@ -1,5 +1,159 @@
|
||||
2000-02-22 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/date/Test.pm (datevtime-1): New test.
|
||||
From John Kendall.
|
||||
|
||||
2000-02-15 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* man/Makefile.maint ($(man_MANS)): Remove $@-t1.
|
||||
|
||||
2000-02-13 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/Fetish.pm (run_tests): Discard stderr.
|
||||
Reverse diff args, so `expected' is last, as in mk-script.
|
||||
|
||||
2000-02-12 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* tests/mk-script: Invoke `diff' when differences are found.
|
||||
* tests/Fetish.pm (run_tests): Likewise.
|
||||
|
||||
2000-02-09 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/su.c (correct_password): Correct HAVE_STRUCT_* name in #if guard
|
||||
to go along with corrected autoconf test: Reported by Gaël Quéri.
|
||||
|
||||
2000-02-05 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 2.0f.
|
||||
|
||||
* src/who.c: Use UT_USER in place of hard-coded `->ut_name' here, too.
|
||||
* src/pinky.c: Likewise.
|
||||
Reported by Tom Tromey and Andreas Schwab.
|
||||
* src/uptime.c (print_uptime): Likewise.
|
||||
* src/users.c (list_entries_users): Likewise.
|
||||
|
||||
2000-01-30 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 2.0e.
|
||||
|
||||
* src/su.c (correct_password): Guard with `HAVE_GETSPNAM &&
|
||||
HAVE_STRUCT_PASSWD_SP_PWDP', rather than just `#ifdef HAVE_SHADOW_H'.
|
||||
|
||||
* po/POTFILES.in: Add lib/makepath.c, lib/obstack.c, lib/rpmatch.c,
|
||||
and lib/same.c.
|
||||
|
||||
2000-01-29 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure.in: Move library-related tests into m4/lib-check.m4.
|
||||
Remove lib-check for cposix now that we use m4/isc-posix.m4.
|
||||
|
||||
* src/seq.c: Back out most of the 2000-01-21 and 01-22 changes.
|
||||
[Instead, merely give examples showing how to accomplish the same
|
||||
task with fewer limitations using existing tools. ]
|
||||
Suggestion from Bruno Haible.
|
||||
(valid_format): Rename from check_format.
|
||||
* tests/seq/basic: Remove associated tests and add two equal-width ones.
|
||||
|
||||
* tests/stty/row-col-1: Set COLUMNS envvar, just to be safe.
|
||||
|
||||
2000-01-28 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/stty.c (wrapf): Emit a newline only if 0 < current_col.
|
||||
(screen_columns): Use xstrtol, not atoi.
|
||||
If get_win_size fails and $COLUMNS == 0, then return 80, not `0'.
|
||||
|
||||
2000-01-23 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure.in (OPTIONAL_BIN_PROGS, OPTIONAL_BIN_ZCRIPTS, MAN):
|
||||
AC_SUBST these not here, but rather in m4/, so that the now-shared
|
||||
lib/Makefile.am are all the same.
|
||||
(AC_CHECK_FUNCS): Remove check for utmpname, since it's already
|
||||
in m4/prereq.m4.
|
||||
Remove many function checks (moved to m4/.)
|
||||
|
||||
* configure.in (AM_FUNC_STRTOD): Move to m4/.
|
||||
(AC_SUBST(POW_LIBM)): Likewise.
|
||||
|
||||
* configure.in (SEQ_LIBM): Remove AC_SUBST of a constant.
|
||||
* src/Makefile.am (seq_LDADD): Add -lm rather than constant $(SEQ_LIBM).
|
||||
|
||||
2000-01-22 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/sys2.h [! HAVE_DECL_STRTOUL]: Declare strtoul.
|
||||
[! HAVE_DECL_STRTOULL]: Declare strtoull.
|
||||
Required for some AIX systems. Reported by Christian Krackowizer.
|
||||
|
||||
* configure.in (ALL_LINGUAS): Add Slovenian (sl).
|
||||
(AC_CHECK_HEADERS): Move these checks into m4/.
|
||||
|
||||
* src/seq.c (enum Format_type): Declare.
|
||||
(format_type): New global to take place of intconv.
|
||||
(format_str): Move global declaration...
|
||||
(main): ... to here.
|
||||
(check_format): Rename parameter to avoid shadowing global.
|
||||
(DO_printf): New macro.
|
||||
(main): Use it.
|
||||
Topologically sort the functions and remove fwd declarations.
|
||||
|
||||
2000-01-21 Bruno Haible <haible@linuix.math.u-bordeaux.fr>
|
||||
|
||||
Add support for octal and hexadecimal output.
|
||||
* seq.c (intconv): New variable.
|
||||
(usage): Update.
|
||||
(main): Call scan_arg instead of scan_double_arg. Call check_format
|
||||
before scan_arg.
|
||||
(scan_int_arg, scan_arg): New functions.
|
||||
(check_format): Add intconv argument. Accept %d, %u, %o, %x, %X.
|
||||
(print_numbers): If intconv is true, pass an int argument to printf.
|
||||
|
||||
2000-01-21 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure.in (ALL_LINGUAS): Add Galician (gl).
|
||||
|
||||
2000-01-16 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* lib/Makefile.am: Sync with fileutils/lib/Makefile.am.
|
||||
|
||||
* src/date.c (usage): Correct error in %V description.
|
||||
From Wolfram Kleff.
|
||||
|
||||
* configure.in: Remove jm_FUNC_GROUP_MEMBER, jm_FUNC_PUTENV,
|
||||
AM_FUNC_GETLOADAVG, jm_SYS_PROC_UPTIME, AM_SYS_POSIX_TERMIOS,
|
||||
jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL.
|
||||
|
||||
2000-01-15 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure.in (AC_REPLACE_FUNCS): Remove gethostname, getusershell,
|
||||
memcpy, and memset. Now that's done in m4/.
|
||||
Remove these, too: stime strcspn stpcpy strstr strtol strtoul.
|
||||
|
||||
2000-01-12 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure.in: Remove the tests that are now in jm_PREREQ_CANON_HOST.
|
||||
|
||||
2000-01-11 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Sync lib/ directories of sh-utils, and textutils.
|
||||
|
||||
* lib/Makefile.am (libfetish_a_SOURCES): Add diacrit.c, hard-locale.c,
|
||||
linebuffer.c, md5.c, memcasecmp.c, memcoll.c, obstack.c, safe-read.c
|
||||
(noinst_HEADERS): Add bumpalloc.h, diacrit.h, hard-locale.h,
|
||||
linebuffer.h, md5.h, memcasecmp.h, memcoll.h, obstack.h, safe-read.h.
|
||||
|
||||
* lib/Makefile.am: s/su/fetish/
|
||||
* src/Makefile.am: s/libsu/libfetish/
|
||||
|
||||
2000-01-10 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 2.0d.
|
||||
|
||||
* src/Makefile.am (sleep_LDADD): Add @POW_LIBM@, for systems that use
|
||||
lib/strtod.c and need -lm to resolve its pow reference.
|
||||
|
||||
2000-01-07 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* Version 2.0c.
|
||||
|
||||
* tests/basename/Makefile.am (TESTS_ENVIRONMENT): Add `pwd`/ prefix
|
||||
to exported PATH value (though not strictly necessary, here).
|
||||
* tests/factor/Makefile.am (TESTS_ENVIRONMENT): Likewise.
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
Changes in release 2.1
|
||||
[2.0f]
|
||||
* fix build problems with ut_name vs. ut_user
|
||||
[2.0e]
|
||||
* stty: fix long-standing bug that caused test failures on at least HPUX
|
||||
systems when COLUMNS was set to zero
|
||||
* still more portability fixes
|
||||
* unified lib/: now that directory and most of the configuration framework
|
||||
is common between fileutils, textutils, and sh-utils
|
||||
[2.0d]
|
||||
* fix portability problem with sleep vs lib/strtod.c's requirement for -lm
|
||||
[2.0c]
|
||||
* fix portability problems with nanosleep.c and with the new code in sleep.c
|
||||
[2.0b]
|
||||
|
||||
@@ -1,5 +1,153 @@
|
||||
2000-01-30 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 2.0d.
|
||||
|
||||
* Makefile.maint (my-distcheck): Depend on po-check, so I'll be warned
|
||||
about any required changes at `make distcheck' time rather than at
|
||||
`make alpha' time.
|
||||
(writable-files): New target.
|
||||
(my-distcheck): Depend on it.
|
||||
(alpha): Likewise.
|
||||
|
||||
* po/POTFILES.in: Add these: lib/makepath.c, lib/rpmatch.c,
|
||||
and lib/same.c
|
||||
|
||||
2000-01-29 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure.in: Remove lib-check for cposix now that we use
|
||||
m4/isc-posix.m4.
|
||||
(jm_LIB_CHECK): Use this even though the library checks aren't
|
||||
required for this patchage (so all three lib/Makefile.in files
|
||||
will be the same).
|
||||
|
||||
2000-01-24 Mark Kettenis <kettenis@gnu.org>
|
||||
|
||||
* src/tsort.c (exit_status): New variable.
|
||||
(loop): New varibale.
|
||||
(count_items, scan_zeroes): Change return type to int.
|
||||
(detect_loop): Complete rewrite to correctly implement detection
|
||||
of loops. Also change return type to int.
|
||||
(recurse_tree): Stop if ACTION returns non-zero. This involves
|
||||
changing the return type of this function and ACTION to int.
|
||||
(walk_tree): Change return type of ACTION to int.
|
||||
(tsort): Continue sort after a loop has been detected (and
|
||||
broken). Set exit_status to 1 if a loop was detected.
|
||||
(main): Use exit_status to determine exit code.
|
||||
* tests/tsort/basic-1: Change expected output for cycle-1 and
|
||||
cycle-2 tests.
|
||||
|
||||
2000-01-23 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure.in (AM_FUNC_STRTOD): Move to m4/.
|
||||
(AC_SUBST(POW_LIBM)): Likewise.
|
||||
|
||||
2000-01-22 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* src/sort.c (keycompare): Use global, hard_LC_COLLATE in place of
|
||||
local that is sometimes undeclared.
|
||||
|
||||
* configure.in (ALL_LINGUAS): Add Brazilian Portuguese (pt_BR).
|
||||
(AC_CHECK_HEADERS): Move these checks into m4/.
|
||||
|
||||
* src/tr.c ("xstrtol.h"): Include.
|
||||
(Filter): Rename from PFL.
|
||||
(non_neg_strtol): Remove function.
|
||||
(find_bracketed_repeat): Use xstrtoul instead of non_neg_strtol.
|
||||
(squeeze_filter, set_initialize, main): Use size_t and ssize_t in
|
||||
place of long and int in several decls.
|
||||
(read_and_delete, read_and_xlate): Likewise, and remove assertion.
|
||||
* tests/tr/Test.pm: (o-rep-1, o-rep-2): New tests.
|
||||
|
||||
* src/cut.c: Correct copying notice to use GPL, per author's request.
|
||||
* src/paste.c: Likewise.
|
||||
(AUTHORS): Add djm.
|
||||
|
||||
1999-09-19 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* src/tr.c (PFI): Return `long', not `int'.
|
||||
(PFL): Rename from PFI now that it returns long.
|
||||
(squeeze_filter): Declare as `long': i, nr, out_len.
|
||||
|
||||
2000-01-17 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
Tweak sort performance.
|
||||
|
||||
* src/sort.c (hard_LC_CTYPE): Remove.
|
||||
(keylist): Renamed from keyhead. Now a pointer, not a
|
||||
mostly-unused struct. All uses changed.
|
||||
(findlines, keycompare, CMP_WITH_IGNORE, compare, checkfp, mergefps,
|
||||
sort): Tune and use a more consistent style for reallocation.
|
||||
(keycompare, main): Don't worry about LC_CTYPE;
|
||||
it's buggy with multibyte chars anyway.
|
||||
(compare): Invoke alloca (0) after each call to keycompare,
|
||||
not just the ones that return nonzero. This avoids a memory
|
||||
leak on architectures without builtin alloca that occurs
|
||||
sometimes when a file contains all duplicate lines.
|
||||
|
||||
2000-01-17 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/csplit.c (interrupt_handler, main):
|
||||
Don't use SA_INTERRUPT to decide whether to call sigaction, as
|
||||
POSIX.1 doesn't require SA_INTERRUPT and some systems
|
||||
(e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead;
|
||||
it's been part of POSIX.1 since day 1 (in 1988).
|
||||
* src/sort.c (sighandler, main): Likewise.
|
||||
|
||||
2000-01-16 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* lib/Makefile.am: Merge with fileutils/lib/Makefile.am.
|
||||
|
||||
* configure.in: Remove AM_FUNC_ERROR_AT_LINE, jm_FUNC_STRFTIME,
|
||||
AC_FUNC_VPRINTF, and AC_FUNC_ALLOCA. Now they're in m4/.
|
||||
|
||||
2000-01-15 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* configure.in (AC_REPLACE_FUNCS): Remove these: memcpy memset stpcpy
|
||||
strpbrk strtol strtoul. Now that's in m4/.
|
||||
|
||||
unexpand could infloop
|
||||
* src/unexpand.c (TAB_STOP_SENTINEL): Define.
|
||||
(unexpand): Use it instead of INT_MAX.
|
||||
Declare column and pending to be `unsigned'.
|
||||
Increment pending and column counters only if column is smaller
|
||||
than TAB_STOP_SENTINEL.
|
||||
* tests/Makefile.am (SUBDIRS): Add unexpand.
|
||||
* tests/unexpand/basic-1: New tests for the above-fixed bug.
|
||||
* configure.in (AC_OUTPUT): Add tests/unexpand/Makefile.
|
||||
Reported by John Kodis.
|
||||
|
||||
2000-01-12 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* src/sort.c (fillbuf): Avoid quadratic behavior with long lines.
|
||||
Also, stop worrying about ancient memchr bug (misbehavior when
|
||||
size is zero), since other code doesn't worry either.
|
||||
|
||||
2000-01-11 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
Sync lib/ directories of sh-utils, and textutils.
|
||||
|
||||
* lib/Makefile.am (libfetish_a_SOURCES): Add getdate.y, posixtm.c,
|
||||
basename.c, canon-host.c, readutmp.c, stripslash.c, xgetcwd.c,
|
||||
xgethostname.c.
|
||||
(noinst_HEADERS): Add getdate.h, group-member.h, posixtm.h,
|
||||
pathmax.h, readutmp.h
|
||||
|
||||
* lib/Makefile.am: s/tu/fetish/
|
||||
* src/Makefile.am: s/libtu/libfetish/
|
||||
|
||||
2000-01-10 Jim Meyering <meyering@lucent.com>
|
||||
|
||||
* Version 2.0c.
|
||||
|
||||
* Makefile.maint (announcement): Include URLs for xdelta files.
|
||||
(alpha): Use scp, not ncftp.
|
||||
|
||||
* lib/Makefile.am (noinst_HEADERS): Add nanosleep.h.
|
||||
|
||||
2000-01-08 Jim Meyering <meyering@ascend.com>
|
||||
|
||||
* Version 2.0b.
|
||||
|
||||
More nits.
|
||||
* src/cut.c (OUTPUT_DELIMITER_OPTION): Define this and use it
|
||||
instead of `CHAR_MAX + n'.
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
Changes in release 2.1
|
||||
[2.0e]
|
||||
* configure and portability changes in m4/ and lib/
|
||||
[2.0d]
|
||||
* preliminary sort performance improvements
|
||||
* tsort now works more like the traditional UNIX tsort. Before it would
|
||||
exit when it found a loop. Now it continues and outputs all items.
|
||||
* unexpand no longer infloops on certain sequences of white space
|
||||
* unified lib/: now that directory and most of the configuration framework
|
||||
is common between fileutils, textutils, and sh-utils
|
||||
[2.0c]
|
||||
* include lib/nanosleep.h.
|
||||
[2.0b]
|
||||
* portability tweaks for error.c vs. systems with deficient strerror_r
|
||||
[2.0a]
|
||||
* `tail --follow=name' no longer gets a failed assertion for a
|
||||
dev,inode-reusing race condition
|
||||
|
||||
10
src/chown.c
10
src/chown.c
@@ -1,5 +1,5 @@
|
||||
/* chown -- change user and 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
|
||||
@@ -295,8 +295,8 @@ usage (int status)
|
||||
else
|
||||
{
|
||||
printf (_("\
|
||||
Usage: %s [OPTION]... OWNER[.[GROUP]] FILE...\n\
|
||||
or: %s [OPTION]... .GROUP FILE...\n\
|
||||
Usage: %s [OPTION]... OWNER[:[GROUP]] FILE...\n\
|
||||
or: %s [OPTION]... :GROUP FILE...\n\
|
||||
or: %s [OPTION]... --reference=RFILE FILE...\n\
|
||||
"),
|
||||
program_name, program_name, program_name);
|
||||
@@ -311,14 +311,14 @@ Change the owner and/or group of each FILE to OWNER and/or GROUP.\n\
|
||||
ownership of a symlink)\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\
|
||||
the specified OWNER:GROUP values\n\
|
||||
-R, --recursive operate on files and directories recursively\n\
|
||||
-v, --verbose output a diagnostic for every file processed\n\
|
||||
--help display this help and exit\n\
|
||||
--version output version information and exit\n\
|
||||
\n\
|
||||
Owner is unchanged if missing. Group is unchanged if missing, but changed\n\
|
||||
to login group if implied by a period. A colon may replace the period.\n\
|
||||
to login group if implied by a `:'.\n\
|
||||
"));
|
||||
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
|
||||
close_stdout ();
|
||||
|
||||
20
src/copy.c
20
src/copy.c
@@ -507,11 +507,23 @@ copy_internal (const char *src_path, const char *dst_path,
|
||||
return (move_mode ? 1 : 0);
|
||||
}
|
||||
|
||||
/* In move_mode, DEST may not be an existing directory. */
|
||||
if (move_mode && S_ISDIR (dst_sb.st_mode))
|
||||
if (move_mode)
|
||||
{
|
||||
error (0, 0, _("%s: cannot overwrite directory"), dst_path);
|
||||
return 1;
|
||||
/* In move_mode, DEST may not be an existing directory. */
|
||||
if (S_ISDIR (dst_sb.st_mode))
|
||||
{
|
||||
error (0, 0, _("%s: cannot overwrite directory"), dst_path);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Don't allow user to move a directory onto a non-directory. */
|
||||
if (S_ISDIR (src_sb.st_mode) && !S_ISDIR (dst_sb.st_mode))
|
||||
{
|
||||
error (0, 0,
|
||||
_("cannot move directory onto non-directory: %s -> %s"),
|
||||
src_path, dst_path);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (x->backup_type != none && !S_ISDIR (dst_sb.st_mode))
|
||||
|
||||
16
src/csplit.c
16
src/csplit.c
@@ -1,5 +1,5 @@
|
||||
/* csplit - split a file into sections determined by context lines
|
||||
Copyright (C) 91, 1995-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 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
|
||||
@@ -245,16 +245,16 @@ cleanup_fatal (void)
|
||||
static RETSIGTYPE
|
||||
interrupt_handler (int sig)
|
||||
{
|
||||
#ifdef SA_INTERRUPT
|
||||
#ifdef SA_NOCLDSTOP
|
||||
struct sigaction sigact;
|
||||
|
||||
sigact.sa_handler = SIG_DFL;
|
||||
sigemptyset (&sigact.sa_mask);
|
||||
sigact.sa_flags = 0;
|
||||
sigaction (sig, &sigact, NULL);
|
||||
#else /* !SA_INTERRUPT */
|
||||
#else
|
||||
signal (sig, SIG_DFL);
|
||||
#endif /* SA_INTERRUPT */
|
||||
#endif
|
||||
cleanup ();
|
||||
kill (getpid (), sig);
|
||||
}
|
||||
@@ -1374,7 +1374,7 @@ main (int argc, char **argv)
|
||||
{
|
||||
int optc;
|
||||
unsigned long val;
|
||||
#ifdef SA_INTERRUPT
|
||||
#ifdef SA_NOCLDSTOP
|
||||
struct sigaction oldact, newact;
|
||||
#endif
|
||||
|
||||
@@ -1393,7 +1393,7 @@ main (int argc, char **argv)
|
||||
/* Change the way xmalloc and xrealloc fail. */
|
||||
xalloc_fail_func = cleanup;
|
||||
|
||||
#ifdef SA_INTERRUPT
|
||||
#ifdef SA_NOCLDSTOP
|
||||
newact.sa_handler = interrupt_handler;
|
||||
sigemptyset (&newact.sa_mask);
|
||||
newact.sa_flags = 0;
|
||||
@@ -1413,7 +1413,7 @@ main (int argc, char **argv)
|
||||
sigaction (SIGTERM, NULL, &oldact);
|
||||
if (oldact.sa_handler != SIG_IGN)
|
||||
sigaction (SIGTERM, &newact, NULL);
|
||||
#else /* not SA_INTERRUPT */
|
||||
#else
|
||||
if (signal (SIGHUP, SIG_IGN) != SIG_IGN)
|
||||
signal (SIGHUP, interrupt_handler);
|
||||
if (signal (SIGINT, SIG_IGN) != SIG_IGN)
|
||||
@@ -1422,7 +1422,7 @@ main (int argc, char **argv)
|
||||
signal (SIGQUIT, interrupt_handler);
|
||||
if (signal (SIGTERM, SIG_IGN) != SIG_IGN)
|
||||
signal (SIGTERM, interrupt_handler);
|
||||
#endif /* not SA_INTERRUPT */
|
||||
#endif
|
||||
|
||||
while ((optc = getopt_long (argc, argv, "f:b:kn:sqz", longopts, NULL)) != -1)
|
||||
switch (optc)
|
||||
|
||||
36
src/cut.c
36
src/cut.c
@@ -1,28 +1,26 @@
|
||||
/* cut - remove parts of lines of files
|
||||
Copyright (C) 1984, 1997, 1998, 1999 by David M. Ihnat
|
||||
Copyright (C) 1984, 1997, 1998, 1999, 2000 by David M. Ihnat
|
||||
|
||||
This program is a total rewrite of the Bell Laboratories Unix(Tm)
|
||||
command of the same name, as of System V. It contains no proprietary
|
||||
code, and therefore may be used without violation of any proprietary
|
||||
agreements whatsoever. However, you will notice that the program is
|
||||
copyrighted by me. This is to assure the program does *not* fall
|
||||
into the public domain. Thus, I may specify just what I am now:
|
||||
This program may be freely copied and distributed, provided this notice
|
||||
remains; it may not be sold for profit without express written consent of
|
||||
the author.
|
||||
Please note that I recreated the behavior of the Unix(Tm) 'cut' command
|
||||
as faithfully as possible; however, I haven't run a full set of regression
|
||||
tests. Thus, the user of this program accepts full responsibility for any
|
||||
effects or loss; in particular, the author is not responsible for any losses,
|
||||
explicit or incidental, that may be incurred through use of this program.
|
||||
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.
|
||||
|
||||
I ask that any bugs (and, if possible, fixes) be reported to me when
|
||||
possible. -David Ihnat (312) 784-4544 ignatz@homebru.chi.il.us
|
||||
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.
|
||||
|
||||
POSIX changes, bug fixes, long-named options, and cleanup
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Written by David Ihnat. */
|
||||
|
||||
/* POSIX changes, bug fixes, long-named options, and cleanup
|
||||
by David MacKenzie <djm@gnu.ai.mit.edu>.
|
||||
|
||||
Rewrite cut_fields and cut_bytes -- Jim Meyering (meyering@comco.com).
|
||||
Rewrite cut_fields and cut_bytes -- Jim Meyering.
|
||||
|
||||
Options:
|
||||
--bytes=byte-list
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* date - print or set the system date and time
|
||||
Copyright (C) 1989-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989-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
|
||||
@@ -165,7 +165,7 @@ specifies Coordinated Universal Time. Interpreted sequences are:\n\
|
||||
%%t a horizontal tab\n\
|
||||
%%T time, 24-hour (hh:mm:ss)\n\
|
||||
%%U week number of year with Sunday as first day of week (00..53)\n\
|
||||
%%V week number of year with Monday as first day of week (01..52)\n\
|
||||
%%V week number of year with Monday as first day of week (01..53)\n\
|
||||
%%w day of week (0..6); 0 represents Sunday\n\
|
||||
%%W week number of year with Monday as first day of week (00..53)\n\
|
||||
%%x locale's date representation (mm/dd/yy)\n\
|
||||
|
||||
12
src/dd.c
12
src/dd.c
@@ -1,5 +1,5 @@
|
||||
/* dd -- convert a file while copying it.
|
||||
Copyright (C) 85, 90, 91, 1995-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 85, 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
|
||||
@@ -381,16 +381,16 @@ quit (int code)
|
||||
static RETSIGTYPE
|
||||
interrupt_handler (int sig)
|
||||
{
|
||||
#ifdef SA_INTERRUPT
|
||||
#ifdef SA_NOCLDSTOP
|
||||
struct sigaction sigact;
|
||||
|
||||
sigact.sa_handler = SIG_DFL;
|
||||
sigemptyset (&sigact.sa_mask);
|
||||
sigact.sa_flags = 0;
|
||||
sigaction (sig, &sigact, NULL);
|
||||
#else /* !SA_INTERRUPT */
|
||||
#else
|
||||
signal (sig, SIG_DFL);
|
||||
#endif /* SA_INTERRUPT */
|
||||
#endif
|
||||
cleanup ();
|
||||
kill (getpid (), sig);
|
||||
}
|
||||
@@ -406,7 +406,7 @@ siginfo_handler (int sig ATTRIBUTE_UNUSED)
|
||||
static void
|
||||
install_handler (int sig_num, RETSIGTYPE (*sig_handler) (int sig))
|
||||
{
|
||||
#ifdef _POSIX_VERSION
|
||||
#ifdef SA_NOCLDSTOP
|
||||
struct sigaction sigact;
|
||||
sigaction (sig_num, NULL, &sigact);
|
||||
if (sigact.sa_handler != SIG_IGN)
|
||||
@@ -1100,7 +1100,7 @@ main (int argc, char **argv)
|
||||
if (o / output_blocksize != seek_record)
|
||||
error (1, 0, _("file offset out of range"));
|
||||
if (ftruncate (STDOUT_FILENO, o) < 0)
|
||||
error (0, errno, "%s", output_file);
|
||||
error (1, errno, "%s", output_file);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
23
src/df.c
23
src/df.c
@@ -762,6 +762,7 @@ main (int argc, char **argv)
|
||||
{
|
||||
int c;
|
||||
struct stat *stats IF_LINT (= 0);
|
||||
int n_valid_args = 0;
|
||||
|
||||
program_name = argv[0];
|
||||
setlocale (LC_ALL, "");
|
||||
@@ -877,12 +878,18 @@ main (int argc, char **argv)
|
||||
stats = (struct stat *)
|
||||
xmalloc ((argc - optind) * sizeof (struct stat));
|
||||
for (i = optind; i < argc; ++i)
|
||||
if (stat (argv[i], &stats[i - optind]))
|
||||
{
|
||||
error (0, errno, "%s", argv[i]);
|
||||
exit_status = 1;
|
||||
argv[i] = NULL;
|
||||
}
|
||||
{
|
||||
if (stat (argv[i], &stats[i - optind]))
|
||||
{
|
||||
error (0, errno, "%s", argv[i]);
|
||||
exit_status = 1;
|
||||
argv[i] = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
++n_valid_args;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mount_list =
|
||||
@@ -917,7 +924,9 @@ main (int argc, char **argv)
|
||||
/* Display explicitly requested empty filesystems. */
|
||||
show_listed_fs = 1;
|
||||
|
||||
print_header ();
|
||||
if (n_valid_args > 0)
|
||||
print_header ();
|
||||
|
||||
for (i = optind; i < argc; ++i)
|
||||
if (argv[i])
|
||||
show_entry (argv[i], &stats[i - optind]);
|
||||
|
||||
79
src/du.c
79
src/du.c
@@ -1,5 +1,5 @@
|
||||
/* du -- summarize disk usage
|
||||
Copyright (C) 88, 89, 90, 91, 1995-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 88, 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
|
||||
@@ -145,9 +145,6 @@ static String *path;
|
||||
/* Pointer to hash structure, used by the hash routines. */
|
||||
static struct htab *htab;
|
||||
|
||||
/* Globally used stat buffer. */
|
||||
static struct stat stat_buf;
|
||||
|
||||
/* A pointer to either lstat or stat, depending on whether
|
||||
dereferencing of all symbolic links is to be done. */
|
||||
static int (*xstat) ();
|
||||
@@ -457,17 +454,41 @@ hash_insert (ino_t ino, dev_t dev)
|
||||
return hash_insert2 (htab_r, ino, dev);
|
||||
}
|
||||
|
||||
/* Restore the previous working directory or exit.
|
||||
If THROUGH_SYMLINK is non-zero, 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)
|
||||
{
|
||||
if (through_symlink)
|
||||
{
|
||||
if (restore_cwd (cwd, "..", curr_dir_name))
|
||||
exit (1);
|
||||
free_cwd (cwd);
|
||||
}
|
||||
else if (chdir ("..") < 0)
|
||||
{
|
||||
error (1, errno, _("cannot change to `..' from directory %s"),
|
||||
curr_dir_name);
|
||||
}
|
||||
}
|
||||
|
||||
/* Print (if appropriate) the size (in units determined by `output_block_size')
|
||||
of file or directory ENT. Return the size of ENT in units of 512-byte
|
||||
blocks. TOP is one for external calls, zero for recursive calls.
|
||||
LAST_DEV is the device that the parent directory of ENT is on.
|
||||
DEPTH is the number of levels (in hierarchy) down from a command
|
||||
line argument. Don't print if DEPTH > max_depth. */
|
||||
line argument. Don't print if DEPTH > max_depth.
|
||||
An important invariant is that when this function returns, the current
|
||||
working directory is the same as when it was called. */
|
||||
|
||||
static uintmax_t
|
||||
count_entry (const char *ent, int top, dev_t last_dev, int depth)
|
||||
{
|
||||
uintmax_t size;
|
||||
struct stat stat_buf;
|
||||
|
||||
if (((top && opt_dereference_arguments)
|
||||
? stat (ent, &stat_buf)
|
||||
@@ -527,15 +548,7 @@ count_entry (const char *ent, int top, dev_t last_dev, int depth)
|
||||
if (errno)
|
||||
{
|
||||
error (0, errno, "%s", path->text);
|
||||
if (through_symlink)
|
||||
{
|
||||
if (restore_cwd (&cwd, "..", path->text))
|
||||
exit (1);
|
||||
free_cwd (&cwd);
|
||||
}
|
||||
else if (chdir ("..") < 0)
|
||||
error (1, errno, _("cannot change to `..' from directory %s"),
|
||||
path->text);
|
||||
pop_dir (through_symlink, &cwd, path->text);
|
||||
exit_status = 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -550,7 +563,7 @@ count_entry (const char *ent, int top, dev_t last_dev, int depth)
|
||||
|
||||
for (namep = name_space; *namep; namep += strlen (namep) + 1)
|
||||
{
|
||||
if (!excluded_filename (exclude, namep))
|
||||
if (!excluded_filename (exclude, namep, 0))
|
||||
{
|
||||
str_concatc (path, namep);
|
||||
size += count_entry (namep, 0, dir_dev, depth + 1);
|
||||
@@ -559,16 +572,7 @@ count_entry (const char *ent, int top, dev_t last_dev, int depth)
|
||||
}
|
||||
|
||||
free (name_space);
|
||||
if (through_symlink)
|
||||
{
|
||||
restore_cwd (&cwd, "..", path->text);
|
||||
free_cwd (&cwd);
|
||||
}
|
||||
else if (chdir ("..") < 0)
|
||||
{
|
||||
error (1, errno,
|
||||
_("cannot change to `..' from directory %s"), path->text);
|
||||
}
|
||||
pop_dir (through_symlink, &cwd, path->text);
|
||||
|
||||
str_trunc (path, pathlen - 1); /* Remove the "/" we added. */
|
||||
if (depth <= max_depth || top)
|
||||
@@ -592,20 +596,8 @@ count_entry (const char *ent, int top, dev_t last_dev, int depth)
|
||||
static void
|
||||
du_files (char **files)
|
||||
{
|
||||
struct saved_cwd cwd;
|
||||
ino_t initial_ino; /* Initial directory's inode. */
|
||||
dev_t initial_dev; /* Initial directory's device. */
|
||||
int i; /* Index in FILES. */
|
||||
|
||||
if (save_cwd (&cwd))
|
||||
exit (1);
|
||||
|
||||
/* Remember the inode and device number of the current directory. */
|
||||
if (stat (".", &stat_buf))
|
||||
error (1, errno, _("current directory"));
|
||||
initial_ino = stat_buf.st_ino;
|
||||
initial_dev = stat_buf.st_dev;
|
||||
|
||||
for (i = 0; files[i]; i++)
|
||||
{
|
||||
char *arg;
|
||||
@@ -631,21 +623,10 @@ du_files (char **files)
|
||||
hash_reset ();
|
||||
|
||||
count_entry (arg, 1, 0, 0);
|
||||
|
||||
/* chdir if `count_entry' has changed the working directory. */
|
||||
if (stat (".", &stat_buf))
|
||||
error (1, errno, ".");
|
||||
if (stat_buf.st_ino != initial_ino || stat_buf.st_dev != initial_dev)
|
||||
{
|
||||
if (restore_cwd (&cwd, _("starting directory"), NULL))
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
if (opt_combined_arguments)
|
||||
print_size (tot_size, _("total"));
|
||||
|
||||
free_cwd (&cwd);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -742,7 +723,7 @@ main (int argc, char **argv)
|
||||
break;
|
||||
|
||||
case 'X':
|
||||
if (add_exclude_file (exclude, optarg, '\n') != 0)
|
||||
if (add_exclude_file (add_exclude, exclude, optarg, '\n') != 0)
|
||||
error (1, errno, "%s", optarg);
|
||||
break;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* install - copy files and set attributes
|
||||
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
|
||||
@@ -393,7 +393,7 @@ install_file_to_path (const char *from, const char *to,
|
||||
const struct cp_options *x)
|
||||
{
|
||||
char *dest_dir;
|
||||
int fail;
|
||||
int fail = 0;
|
||||
|
||||
dest_dir = dir_name (to);
|
||||
|
||||
@@ -408,14 +408,10 @@ install_file_to_path (const char *from, const char *to,
|
||||
#define DIR_MODE (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
|
||||
fail = make_path (dest_dir, DIR_MODE, DIR_MODE, owner_id, group_id, 0,
|
||||
(x->verbose ? _("creating directory `%s'") : NULL));
|
||||
}
|
||||
|
||||
if (fail == 0)
|
||||
fail = install_file_in_dir (from, dest_dir, x);
|
||||
}
|
||||
else
|
||||
{
|
||||
fail = install_file_in_file (from, to, x);
|
||||
}
|
||||
if (fail == 0)
|
||||
fail = install_file_in_file (from, to, x);
|
||||
|
||||
free (dest_dir);
|
||||
|
||||
|
||||
10
src/ln.c
10
src/ln.c
@@ -338,10 +338,12 @@ Usage: %s [OPTION]... TARGET [LINK_NAME]\n\
|
||||
"),
|
||||
program_name, program_name, program_name);
|
||||
printf (_("\
|
||||
Create a link to the specified TARGET with optional LINK_NAME. If there is\n\
|
||||
more than one TARGET, the last argument must be a directory; create links\n\
|
||||
in DIRECTORY to each TARGET. Create hard links by default, symbolic links\n\
|
||||
with --symbolic. When creating hard links, each TARGET must exist.\n\
|
||||
Create a link to the specified TARGET with optional LINK_NAME.\n\
|
||||
If LINK_NAME is omitted, a link with the same basename as the TARGET is\n\
|
||||
created in the current directory. When using the second form with more\n\
|
||||
than one TARGET, the last argument must be a directory; create links\n\
|
||||
in DIRECTORY to each TARGET. Create hard links by default, symbolic\n\
|
||||
links with --symbolic. When creating hard links, each TARGET must exist.\n\
|
||||
\n\
|
||||
-b, --backup[=CONTROL] make a backup of each existing destination file\n\
|
||||
-d, -F, --directory hard link directories (super-user only)\n\
|
||||
|
||||
8
src/mv.c
8
src/mv.c
@@ -464,12 +464,8 @@ main (int argc, char **argv)
|
||||
file = argv + optind;
|
||||
|
||||
target_directory_specified = (target_directory != NULL);
|
||||
if (target_directory == NULL)
|
||||
{
|
||||
/* Be careful below. When n_files is 0, this value will be
|
||||
argv[0], `--', or an option string. */
|
||||
target_directory = file[n_files - 1];
|
||||
}
|
||||
if (target_directory == NULL && n_files != 0)
|
||||
target_directory = file[n_files - 1];
|
||||
|
||||
dest_is_dir = (n_files > 0 && isdir (target_directory));
|
||||
|
||||
|
||||
37
src/paste.c
37
src/paste.c
@@ -1,26 +1,23 @@
|
||||
/* paste - merge lines of files
|
||||
Copyright (C) 1984, 1997, 1998, 1999 by David M. Ihnat
|
||||
Copyright (C) 1984, 1997, 1998, 1999, 2000 by David M. Ihnat
|
||||
|
||||
This program is a total rewrite of the Bell Laboratories Unix(Tm)
|
||||
command of the same name, as of System V. It contains no proprietary
|
||||
code, and therefore may be used without violation of any proprietary
|
||||
agreements whatsoever. However, you will notice that the program is
|
||||
copyrighted by me. This is to assure the program does *not* fall
|
||||
into the public domain. Thus, I may specify just what I am now:
|
||||
This program may be freely copied and distributed, provided this notice
|
||||
remains; it may not be sold for profit without express written consent of
|
||||
the author.
|
||||
Please note that I recreated the behavior of the Unix(Tm) 'paste' command
|
||||
as faithfully as possible, with minor exceptions; however,
|
||||
I haven't run a full set of regression tests. Thus, the user of
|
||||
this program accepts full responsibility for any effects or loss;
|
||||
in particular, the author is not responsible for any losses,
|
||||
explicit or incidental, that may be incurred through use of this program.
|
||||
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.
|
||||
|
||||
I ask that any bugs (and, if possible, fixes) be reported to me when
|
||||
possible. -David Ihnat (312) 784-4544 ignatz@homebru.chi.il.us
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
The list of valid escape sequences has been expanded over the Unix
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Written by David Ihnat. */
|
||||
|
||||
/* The list of valid escape sequences has been expanded over the Unix
|
||||
version, to include \b, \f, \r, and \v.
|
||||
|
||||
POSIX changes, bug fixes, long-named options, and cleanup
|
||||
@@ -49,7 +46,7 @@
|
||||
/* The official name of this program (e.g., no `g' prefix). */
|
||||
#define PROGRAM_NAME "paste"
|
||||
|
||||
#define AUTHORS "David M. Ihnat"
|
||||
#define AUTHORS "David M. Ihnat and David MacKenzie"
|
||||
|
||||
/* Indicates that no delimiter should be added in the current position. */
|
||||
#define EMPTY_DELIM '\0'
|
||||
|
||||
16
src/pinky.c
16
src/pinky.c
@@ -1,5 +1,5 @@
|
||||
/* GNU's pinky.
|
||||
Copyright (C) 1992-1997, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992-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
|
||||
@@ -199,15 +199,15 @@ print_entry (const STRUCT_UTMP *utmp_ent)
|
||||
last_change = 0;
|
||||
}
|
||||
|
||||
printf ("%-8.*s", (int) sizeof (utmp_ent->ut_name), utmp_ent->ut_name);
|
||||
printf ("%-8.*s", (int) sizeof (UT_USER (utmp_ent)), UT_USER (utmp_ent));
|
||||
|
||||
if (include_fullname)
|
||||
{
|
||||
struct passwd *pw;
|
||||
char name[sizeof (utmp_ent->ut_name) + 1];
|
||||
char name[sizeof (UT_USER (utmp_ent)) + 1];
|
||||
|
||||
strncpy (name, utmp_ent->ut_name, sizeof (utmp_ent->ut_name));
|
||||
name[sizeof (utmp_ent->ut_name)] = '\0';
|
||||
strncpy (name, UT_USER (utmp_ent), sizeof (UT_USER (utmp_ent)));
|
||||
name[sizeof (UT_USER (utmp_ent))] = '\0';
|
||||
pw = getpwnam (name);
|
||||
if (pw == NULL)
|
||||
printf (" %19s", " ???");
|
||||
@@ -405,7 +405,7 @@ scan_entries (int n, const STRUCT_UTMP *utmp_buf,
|
||||
|
||||
while (n--)
|
||||
{
|
||||
if (utmp_buf->ut_name[0]
|
||||
if (UT_USER (utmp_buf)[0]
|
||||
#ifdef USER_PROCESS
|
||||
&& utmp_buf->ut_type == USER_PROCESS
|
||||
#endif
|
||||
@@ -416,8 +416,8 @@ scan_entries (int n, const STRUCT_UTMP *utmp_buf,
|
||||
int i;
|
||||
|
||||
for (i = 0; i < argc_names; i++)
|
||||
if (strncmp (utmp_buf->ut_name, argv_names[i],
|
||||
sizeof (utmp_buf->ut_name)) == 0)
|
||||
if (strncmp (UT_USER (utmp_buf), argv_names[i],
|
||||
sizeof (UT_USER (utmp_buf))) == 0)
|
||||
{
|
||||
print_entry (utmp_buf);
|
||||
break;
|
||||
|
||||
378
src/seq.c
378
src/seq.c
@@ -1,5 +1,5 @@
|
||||
/* seq - print sequence of numbers to standard output.
|
||||
Copyright (C) 1994-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994-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
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "system.h"
|
||||
#include "error.h"
|
||||
#include "xstrtol.h"
|
||||
#include "xstrtod.h"
|
||||
|
||||
/* The official name of this program (e.g., no `g' prefix). */
|
||||
@@ -32,20 +33,9 @@
|
||||
|
||||
#define AUTHORS "Ulrich Drepper"
|
||||
|
||||
static double scan_double_arg PARAMS ((const char *arg));
|
||||
static int check_format PARAMS ((const char *format_string));
|
||||
static char *get_width_format PARAMS ((void));
|
||||
static int print_numbers PARAMS ((const char *format_str));
|
||||
|
||||
/* If nonzero print all number with equal width. */
|
||||
static int equal_width;
|
||||
|
||||
/* The printf(3) format used for output. */
|
||||
static char *format_str;
|
||||
|
||||
/* The starting number. */
|
||||
static double first;
|
||||
|
||||
/* The name that this program was run with. */
|
||||
char *program_name;
|
||||
|
||||
@@ -61,6 +51,9 @@ static char *terminator = "\n";
|
||||
Always "." if the localeconv function is not supported. */
|
||||
static char *decimal_point = ".";
|
||||
|
||||
/* The starting number. */
|
||||
static double first;
|
||||
|
||||
/* The increment. */
|
||||
static double step;
|
||||
|
||||
@@ -103,148 +96,13 @@ If FIRST or INCREMENT is omitted, it defaults to 1.\n\
|
||||
FIRST, INCREMENT, and LAST are interpreted as floating point values.\n\
|
||||
INCREMENT should be positive if FIRST is smaller than LAST, and negative\n\
|
||||
otherwise. When given, the FORMAT argument must contain exactly one of\n\
|
||||
the printf-style, floating point output formats %%e, %%f, or %%g.\n\
|
||||
the printf-style, floating point output formats %%e, %%f, %%g\n\
|
||||
"));
|
||||
puts (_("\nReport bugs to <bug-sh-utils@gnu.org>."));
|
||||
}
|
||||
exit (status);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
int errs;
|
||||
int optc;
|
||||
int step_is_set;
|
||||
|
||||
program_name = argv[0];
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
equal_width = 0;
|
||||
format_str = NULL;
|
||||
separator = "\n";
|
||||
first = 1.0;
|
||||
step_is_set = 0;
|
||||
|
||||
/* Figure out the locale's idea of a decimal point. */
|
||||
#ifdef HAVE_LOCALECONV
|
||||
{
|
||||
struct lconv *locale;
|
||||
|
||||
locale = localeconv ();
|
||||
/* Paranoia. */
|
||||
if (locale && locale->decimal_point && locale->decimal_point[0] != '\0')
|
||||
decimal_point = locale->decimal_point;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* We have to handle negative numbers in the command line but this
|
||||
conflicts with the command line arguments. So explicitly check first
|
||||
whether the next argument looks like a negative number. */
|
||||
while (optind < argc)
|
||||
{
|
||||
if (argv[optind][0] == '-'
|
||||
&& ((optc = argv[optind][1]) == decimal_point[0]
|
||||
|| ISDIGIT (optc)))
|
||||
{
|
||||
/* means negative number */
|
||||
break;
|
||||
}
|
||||
|
||||
optc = getopt_long (argc, argv, "+f:s:w", long_options, NULL);
|
||||
if (optc == -1)
|
||||
break;
|
||||
|
||||
switch (optc)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
format_str = optarg;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
separator = optarg;
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
equal_width = 1;
|
||||
break;
|
||||
|
||||
case_GETOPT_HELP_CHAR;
|
||||
|
||||
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
|
||||
|
||||
default:
|
||||
usage (1);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
}
|
||||
|
||||
if (optind >= argc)
|
||||
{
|
||||
error (0, 0, _("too few arguments"));
|
||||
usage (1);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
last = scan_double_arg (argv[optind++]);
|
||||
|
||||
if (optind < argc)
|
||||
{
|
||||
first = last;
|
||||
last = scan_double_arg (argv[optind++]);
|
||||
|
||||
if (optind < argc)
|
||||
{
|
||||
step = last;
|
||||
step_is_set = 1;
|
||||
last = scan_double_arg (argv[optind++]);
|
||||
|
||||
if (optind < argc)
|
||||
{
|
||||
usage (1);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (format_str != NULL && equal_width)
|
||||
{
|
||||
error (0, 0, _("\
|
||||
format string may not be specified when printing equal width strings"));
|
||||
usage (1);
|
||||
}
|
||||
|
||||
if (!step_is_set)
|
||||
{
|
||||
step = first <= last ? 1.0 : -1.0;
|
||||
}
|
||||
|
||||
if (format_str != NULL)
|
||||
{
|
||||
if (!check_format (format_str))
|
||||
{
|
||||
error (0, 0, _("invalid format string: `%s'"), format_str);
|
||||
usage (1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (equal_width)
|
||||
format_str = get_width_format ();
|
||||
else
|
||||
format_str = "%g";
|
||||
}
|
||||
|
||||
errs = print_numbers (format_str);
|
||||
|
||||
exit (errs);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
/* Read a double value from the command line.
|
||||
Return if the string is correct else signal error. */
|
||||
|
||||
@@ -257,18 +115,16 @@ scan_double_arg (const char *arg)
|
||||
{
|
||||
error (0, 0, _("invalid floating point argument: %s"), arg);
|
||||
usage (1);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/* Check whether the format string is valid for a single double
|
||||
argument.
|
||||
Return 0 if not, 1 if correct. */
|
||||
/* Check whether the format string is valid for a single `double'
|
||||
argument. Return 0 if not, 1 if correct. */
|
||||
|
||||
static int
|
||||
check_format (const char *fmt)
|
||||
valid_format (const char *fmt)
|
||||
{
|
||||
while (*fmt != '\0')
|
||||
{
|
||||
@@ -293,7 +149,7 @@ check_format (const char *fmt)
|
||||
fmt += strspn (++fmt, "0123456789");
|
||||
}
|
||||
|
||||
if (*fmt != 'e' && *fmt != 'f' && *fmt != 'g')
|
||||
if (!(*fmt == 'e' || *fmt == 'f' || *fmt == 'g'))
|
||||
return 0;
|
||||
|
||||
fmt++;
|
||||
@@ -312,6 +168,64 @@ check_format (const char *fmt)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Actually print the sequence of numbers in the specified range, with the
|
||||
given or default stepping and format. */
|
||||
static int
|
||||
print_numbers (const char *fmt)
|
||||
{
|
||||
if (first > last)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (step >= 0)
|
||||
{
|
||||
error (0, 0,
|
||||
_("when the starting value is larger than the limit,\n\
|
||||
the increment must be negative"));
|
||||
usage (1);
|
||||
}
|
||||
|
||||
printf (fmt, first);
|
||||
for (i = 1; /* empty */; i++)
|
||||
{
|
||||
double x = first + i * step;
|
||||
|
||||
if (x < last)
|
||||
break;
|
||||
|
||||
fputs (separator, stdout);
|
||||
printf (fmt, x);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int i;
|
||||
|
||||
if (step <= 0)
|
||||
{
|
||||
error (0, 0,
|
||||
_("when the starting value is smaller than the limit,\n\
|
||||
the increment must be positive"));
|
||||
usage (1);
|
||||
}
|
||||
|
||||
printf (fmt, first);
|
||||
for (i = 1; /* empty */; i++)
|
||||
{
|
||||
double x = first + i * step;
|
||||
|
||||
if (x > last)
|
||||
break;
|
||||
|
||||
fputs (separator, stdout);
|
||||
printf (fmt, x);
|
||||
}
|
||||
}
|
||||
fputs (terminator, stdout);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined (HAVE_RINT) && defined (HAVE_MODF) && defined (HAVE_FLOOR)
|
||||
|
||||
/* Return a printf-style format string with which all selected numbers
|
||||
@@ -406,62 +320,136 @@ get_width_format (void)
|
||||
|
||||
#endif
|
||||
|
||||
/* Actually print the sequence of numbers in the specified range, with the
|
||||
given or default stepping and format. */
|
||||
static int
|
||||
print_numbers (const char *fmt)
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
if (first > last)
|
||||
{
|
||||
int i;
|
||||
int errs;
|
||||
int optc;
|
||||
int step_is_set;
|
||||
|
||||
if (step >= 0)
|
||||
/* The printf(3) format used for output. */
|
||||
char *format_str = NULL;
|
||||
|
||||
program_name = argv[0];
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
equal_width = 0;
|
||||
separator = "\n";
|
||||
first = 1.0;
|
||||
step_is_set = 0;
|
||||
|
||||
/* Figure out the locale's idea of a decimal point. */
|
||||
#ifdef HAVE_LOCALECONV
|
||||
{
|
||||
struct lconv *locale;
|
||||
|
||||
locale = localeconv ();
|
||||
/* Paranoia. */
|
||||
if (locale && locale->decimal_point && locale->decimal_point[0] != '\0')
|
||||
decimal_point = locale->decimal_point;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* We have to handle negative numbers in the command line but this
|
||||
conflicts with the command line arguments. So explicitly check first
|
||||
whether the next argument looks like a negative number. */
|
||||
while (optind < argc)
|
||||
{
|
||||
if (argv[optind][0] == '-'
|
||||
&& ((optc = argv[optind][1]) == decimal_point[0]
|
||||
|| ISDIGIT (optc)))
|
||||
{
|
||||
error (0, 0,
|
||||
_("when the starting value is larger than the limit,\n\
|
||||
the increment must be negative"));
|
||||
usage (1);
|
||||
/* NOTREACHED */
|
||||
/* means negative number */
|
||||
break;
|
||||
}
|
||||
|
||||
printf (fmt, first);
|
||||
for (i = 1; /* empty */; i++)
|
||||
optc = getopt_long (argc, argv, "+f:s:w", long_options, NULL);
|
||||
if (optc == -1)
|
||||
break;
|
||||
|
||||
switch (optc)
|
||||
{
|
||||
double x = first + i * step;
|
||||
case 0:
|
||||
break;
|
||||
|
||||
if (x < last)
|
||||
break;
|
||||
case 'f':
|
||||
format_str = optarg;
|
||||
break;
|
||||
|
||||
fputs (separator, stdout);
|
||||
printf (fmt, x);
|
||||
case 's':
|
||||
separator = optarg;
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
equal_width = 1;
|
||||
break;
|
||||
|
||||
case_GETOPT_HELP_CHAR;
|
||||
|
||||
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
|
||||
|
||||
default:
|
||||
usage (1);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (argc - optind < 1)
|
||||
{
|
||||
int i;
|
||||
error (0, 0, _("too few arguments"));
|
||||
usage (1);
|
||||
}
|
||||
|
||||
if (step <= 0)
|
||||
if (3 < argc - optind)
|
||||
{
|
||||
error (0, 0, _("too many arguments"));
|
||||
usage (1);
|
||||
}
|
||||
|
||||
if (format_str && !valid_format (format_str))
|
||||
{
|
||||
error (0, 0, _("invalid format string: `%s'"), format_str);
|
||||
usage (1);
|
||||
}
|
||||
|
||||
last = scan_double_arg (argv[optind++]);
|
||||
|
||||
if (optind < argc)
|
||||
{
|
||||
first = last;
|
||||
last = scan_double_arg (argv[optind++]);
|
||||
|
||||
if (optind < argc)
|
||||
{
|
||||
error (0, 0,
|
||||
_("when the starting value is smaller than the limit,\n\
|
||||
the increment must be positive"));
|
||||
usage (1);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
step = last;
|
||||
step_is_set = 1;
|
||||
last = scan_double_arg (argv[optind++]);
|
||||
|
||||
printf (fmt, first);
|
||||
for (i = 1; /* empty */; i++)
|
||||
{
|
||||
double x = first + i * step;
|
||||
|
||||
if (x > last)
|
||||
break;
|
||||
|
||||
fputs (separator, stdout);
|
||||
printf (format_str, x);
|
||||
}
|
||||
}
|
||||
fputs (terminator, stdout);
|
||||
|
||||
return 0;
|
||||
if (format_str != NULL && equal_width)
|
||||
{
|
||||
error (0, 0, _("\
|
||||
format string may not be specified when printing equal width strings"));
|
||||
usage (1);
|
||||
}
|
||||
|
||||
if (!step_is_set)
|
||||
{
|
||||
step = first <= last ? 1.0 : -1.0;
|
||||
}
|
||||
|
||||
if (format_str == NULL)
|
||||
{
|
||||
if (equal_width)
|
||||
format_str = get_width_format ();
|
||||
else
|
||||
format_str = "%g";
|
||||
}
|
||||
|
||||
errs = print_numbers (format_str);
|
||||
|
||||
exit (errs);
|
||||
}
|
||||
|
||||
393
src/sort.c
393
src/sort.c
@@ -1,5 +1,5 @@
|
||||
/* sort - sort lines of text (with all kinds of options).
|
||||
Copyright (C) 88, 1991-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 88, 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
|
||||
@@ -84,7 +84,6 @@ static int th_sep; /* if CHAR_MAX + 1, then there is no thousands separator */
|
||||
|
||||
/* Nonzero if the corresponding locales are hard. */
|
||||
static int hard_LC_COLLATE;
|
||||
static int hard_LC_CTYPE;
|
||||
# if HAVE_NL_LANGINFO
|
||||
static int hard_LC_TIME;
|
||||
# endif
|
||||
@@ -160,6 +159,13 @@ struct month
|
||||
/* The name this program was run with. */
|
||||
char *program_name;
|
||||
|
||||
/* FIXME: None of these tables work with multibyte character sets.
|
||||
Also, there are many other bugs when handling multibyte characters,
|
||||
or even unibyte encodings where line boundaries are not in the
|
||||
initial shift state. One way to fix this is to rewrite `sort' to
|
||||
use wide characters internally, but doing this with good
|
||||
performance is a bit tricky. */
|
||||
|
||||
/* Table of white space. */
|
||||
static int blanks[UCHAR_LIM];
|
||||
|
||||
@@ -169,8 +175,7 @@ static int nonprinting[UCHAR_LIM];
|
||||
/* Table of non-dictionary characters (not letters, digits, or blanks). */
|
||||
static int nondictionary[UCHAR_LIM];
|
||||
|
||||
/* Translation table folding lower case to upper.
|
||||
FIXME: This doesn't work with multibyte character sets. */
|
||||
/* Translation table folding lower case to upper. */
|
||||
static char fold_toupper[UCHAR_LIM];
|
||||
|
||||
#define MONTHS_PER_YEAR 12
|
||||
@@ -240,8 +245,8 @@ static int unique;
|
||||
/* Nonzero if any of the input files are the standard input. */
|
||||
static int have_read_stdin;
|
||||
|
||||
/* Lists of key field comparisons to be tried. */
|
||||
static struct keyfield keyhead;
|
||||
/* List of key field comparisons to be tried. */
|
||||
static struct keyfield *keylist;
|
||||
|
||||
void
|
||||
usage (int status)
|
||||
@@ -543,10 +548,9 @@ fillbuf (struct buffer *buf, FILE *fp)
|
||||
int cc;
|
||||
|
||||
memmove (buf->buf, buf->buf + buf->used - buf->left, buf->left);
|
||||
buf->used = buf->left;
|
||||
cc = buf->used = buf->left;
|
||||
|
||||
while (!feof (fp) && (buf->used == 0
|
||||
|| !memchr (buf->buf, eolchar, buf->used)))
|
||||
while (!feof (fp) && !memchr (buf->buf + buf->used - cc, eolchar, cc))
|
||||
{
|
||||
if (buf->used == buf->alloc)
|
||||
{
|
||||
@@ -744,13 +748,15 @@ static void
|
||||
findlines (struct buffer *buf, struct lines *lines)
|
||||
{
|
||||
register char *beg = buf->buf, *lim = buf->buf + buf->used, *ptr;
|
||||
struct keyfield *key = keyhead.next;
|
||||
struct keyfield *key = keylist;
|
||||
|
||||
lines->used = 0;
|
||||
|
||||
while (beg < lim && (ptr = memchr (beg, eolchar, lim - beg))
|
||||
&& lines->used < lines->limit)
|
||||
{
|
||||
struct line *line;
|
||||
|
||||
if (lines->used == lines->alloc)
|
||||
{
|
||||
lines->alloc *= 2;
|
||||
@@ -759,38 +765,26 @@ findlines (struct buffer *buf, struct lines *lines)
|
||||
lines->alloc * sizeof (struct line));
|
||||
}
|
||||
|
||||
lines->lines[lines->used].text = beg;
|
||||
lines->lines[lines->used].length = ptr + 1 - beg;
|
||||
line = &lines->lines[lines->used];
|
||||
line->text = beg;
|
||||
line->length = ptr + 1 - beg;
|
||||
|
||||
/* Precompute the position of the first key for efficiency. */
|
||||
if (key)
|
||||
{
|
||||
if (key->eword >= 0)
|
||||
lines->lines[lines->used].keylim =
|
||||
limfield (&lines->lines[lines->used], key);
|
||||
else
|
||||
lines->lines[lines->used].keylim = ptr;
|
||||
/* Precompute the position of the first key for efficiency. */
|
||||
line->keylim = 0 <= key->eword ? limfield (line, key) : ptr;
|
||||
|
||||
if (key->sword >= 0)
|
||||
lines->lines[lines->used].keybeg =
|
||||
begfield (&lines->lines[lines->used], key);
|
||||
line->keybeg = begfield (line, key);
|
||||
else
|
||||
{
|
||||
if (key->skipsblanks)
|
||||
while (blanks[UCHAR (*beg)])
|
||||
++beg;
|
||||
lines->lines[lines->used].keybeg = beg;
|
||||
line->keybeg = beg;
|
||||
}
|
||||
if (key->skipeblanks)
|
||||
{
|
||||
trim_trailing_blanks (lines->lines[lines->used].keybeg,
|
||||
&lines->lines[lines->used].keylim);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lines->lines[lines->used].keybeg = 0;
|
||||
lines->lines[lines->used].keylim = 0;
|
||||
trim_trailing_blanks (line->keybeg, &line->keylim);
|
||||
}
|
||||
|
||||
++lines->used;
|
||||
@@ -1084,48 +1078,21 @@ getmonth (const char *s, int len)
|
||||
static int
|
||||
keycompare (const struct line *a, const struct line *b)
|
||||
{
|
||||
register char *texta, *textb, *lima, *limb;
|
||||
register unsigned char *translate;
|
||||
register int *ignore;
|
||||
struct keyfield *key;
|
||||
int diff = 0, iter = 0, lena, lenb;
|
||||
struct keyfield *key = keylist;
|
||||
|
||||
for (key = keyhead.next; key; key = key->next, ++iter)
|
||||
/* For the first iteration only, the key positions have been
|
||||
precomputed for us. */
|
||||
register char *texta = a->keybeg;
|
||||
register char *textb = b->keybeg;
|
||||
register char *lima = a->keylim;
|
||||
register char *limb = b->keylim;
|
||||
|
||||
int diff, lena, lenb;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
int comparable_lengths = 1;
|
||||
|
||||
ignore = key->ignore;
|
||||
translate = (unsigned char *) key->translate;
|
||||
|
||||
/* Find the beginning and limit of each field. */
|
||||
if (iter || a->keybeg == NULL || b->keybeg == NULL)
|
||||
{
|
||||
if (key->eword >= 0)
|
||||
lima = limfield (a, key), limb = limfield (b, key);
|
||||
else
|
||||
lima = a->text + a->length - 1, limb = b->text + b->length - 1;
|
||||
|
||||
if (key->sword >= 0)
|
||||
texta = begfield (a, key), textb = begfield (b, key);
|
||||
else
|
||||
{
|
||||
texta = a->text, textb = b->text;
|
||||
if (key->skipsblanks)
|
||||
{
|
||||
while (texta < lima && blanks[UCHAR (*texta)])
|
||||
++texta;
|
||||
while (textb < limb && blanks[UCHAR (*textb)])
|
||||
++textb;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* For the first iteration only, the key positions have
|
||||
been precomputed for us. */
|
||||
texta = a->keybeg, lima = a->keylim;
|
||||
textb = b->keybeg, limb = b->keylim;
|
||||
}
|
||||
register unsigned char *translate = (unsigned char *) key->translate;
|
||||
register int *ignore = key->ignore;
|
||||
|
||||
/* Find the lengths. */
|
||||
lena = lima - texta, lenb = limb - textb;
|
||||
@@ -1153,27 +1120,18 @@ keycompare (const struct line *a, const struct line *b)
|
||||
diff = ((key->numeric ? numcompare : general_numcompare)
|
||||
(texta, textb));
|
||||
*lima = savea, *limb = saveb;
|
||||
if (diff)
|
||||
return key->reverse ? -diff : diff;
|
||||
continue;
|
||||
}
|
||||
else if (key->month)
|
||||
{
|
||||
diff = getmonth (texta, lena) - getmonth (textb, lenb);
|
||||
if (diff)
|
||||
return key->reverse ? -diff : diff;
|
||||
continue;
|
||||
}
|
||||
diff = getmonth (texta, lena) - getmonth (textb, lenb);
|
||||
#ifdef ENABLE_NLS
|
||||
|
||||
/* Sorting like this may become slow, so in a simple locale the user
|
||||
can select a faster sort that is similar to ascii sort */
|
||||
else if (hard_LC_COLLATE | hard_LC_CTYPE)
|
||||
else if (hard_LC_COLLATE)
|
||||
{
|
||||
if (ignore || translate)
|
||||
{
|
||||
char *copy_a = (char *) alloca (lena + 1);
|
||||
char *copy_b = (char *) alloca (lenb + 1);
|
||||
char *copy_a = (char *) alloca (lena + 1 + lenb + 1);
|
||||
char *copy_b = copy_a + lena + 1;
|
||||
int new_len_a, new_len_b, i;
|
||||
|
||||
/* Ignore and/or translate chars before comparing. */
|
||||
@@ -1199,103 +1157,103 @@ keycompare (const struct line *a, const struct line *b)
|
||||
|
||||
diff = memcoll (copy_a, new_len_a, copy_b, new_len_b);
|
||||
}
|
||||
else if (lena == 0)
|
||||
diff = -lenb;
|
||||
else if (lenb == 0)
|
||||
goto greater;
|
||||
else
|
||||
{
|
||||
diff = memcoll (texta, lena, textb, lenb);
|
||||
}
|
||||
|
||||
if (diff)
|
||||
return key->reverse ? -diff : diff;
|
||||
|
||||
continue;
|
||||
diff = memcoll (texta, lena, textb, lenb);
|
||||
}
|
||||
#endif
|
||||
else if (ignore && translate)
|
||||
|
||||
else if (ignore)
|
||||
{
|
||||
#define CMP_WITH_IGNORE(A, B) \
|
||||
do \
|
||||
{ \
|
||||
while (texta < lima && textb < limb) \
|
||||
for (;;) \
|
||||
{ \
|
||||
while (texta < lima && ignore[UCHAR (*texta)]) \
|
||||
++texta; \
|
||||
while (textb < limb && ignore[UCHAR (*textb)]) \
|
||||
++textb; \
|
||||
if (texta < lima && textb < limb) \
|
||||
{ \
|
||||
if ((A) != (B)) \
|
||||
{ \
|
||||
diff = UCHAR (A) - UCHAR (B); \
|
||||
break; \
|
||||
} \
|
||||
++texta; \
|
||||
++textb; \
|
||||
} \
|
||||
\
|
||||
if (texta == lima && textb < limb && !ignore[UCHAR (*textb)]) \
|
||||
diff = -1; \
|
||||
else if (texta < lima && textb == limb \
|
||||
&& !ignore[UCHAR (*texta)]) \
|
||||
diff = 1; \
|
||||
if (! (texta < lima && textb < limb)) \
|
||||
break; \
|
||||
diff = UCHAR (A) - UCHAR (B); \
|
||||
if (diff) \
|
||||
goto not_equal; \
|
||||
++texta; \
|
||||
++textb; \
|
||||
} \
|
||||
\
|
||||
if (diff == 0) \
|
||||
{ \
|
||||
while (texta < lima && ignore[UCHAR (*texta)]) \
|
||||
++texta; \
|
||||
while (textb < limb && ignore[UCHAR (*textb)]) \
|
||||
++textb; \
|
||||
\
|
||||
if (texta == lima && textb < limb) \
|
||||
diff = -1; \
|
||||
else if (texta < lima && textb == limb) \
|
||||
diff = 1; \
|
||||
} \
|
||||
/* Relative lengths are meaningless if characters were ignored. \
|
||||
Handling this case here avoids what might be an invalid length \
|
||||
comparison below. */ \
|
||||
if (diff == 0 && texta == lima && textb == limb) \
|
||||
comparable_lengths = 0; \
|
||||
diff = (lima - texta) - (limb - textb); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
CMP_WITH_IGNORE (translate[UCHAR (*texta)], translate[UCHAR (*textb)]);
|
||||
else if (ignore)
|
||||
CMP_WITH_IGNORE (UCHAR (*texta), UCHAR (*textb));
|
||||
else if (translate)
|
||||
while (texta < lima && textb < limb)
|
||||
{
|
||||
if (translate[UCHAR (*texta++)] != translate[UCHAR (*textb++)])
|
||||
{
|
||||
diff = (UCHAR (translate[UCHAR (*--texta)])
|
||||
- UCHAR (translate[UCHAR (*--textb)]));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (translate)
|
||||
CMP_WITH_IGNORE (translate[UCHAR (*texta)],
|
||||
translate[UCHAR (*textb)]);
|
||||
else
|
||||
CMP_WITH_IGNORE (UCHAR (*texta), UCHAR (*textb));
|
||||
}
|
||||
else if (lena == 0)
|
||||
diff = -lenb;
|
||||
else if (lenb == 0)
|
||||
goto greater;
|
||||
else
|
||||
{
|
||||
#ifdef ENABLE_NLS
|
||||
if (hard_LC_COLLATE)
|
||||
if (translate)
|
||||
{
|
||||
/* Ignore any length difference if the localized comparison
|
||||
says the strings are equal. */
|
||||
comparable_lengths = 0;
|
||||
diff = memcoll (texta, lena, textb, lenb);
|
||||
while (texta < lima && textb < limb)
|
||||
{
|
||||
diff = (UCHAR (translate[UCHAR (*texta++)])
|
||||
- UCHAR (translate[UCHAR (*textb++)]));
|
||||
if (diff)
|
||||
goto not_equal;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
diff = memcmp (texta, textb, min (lena, lenb));
|
||||
if (diff)
|
||||
goto not_equal;
|
||||
}
|
||||
diff = lena - lenb;
|
||||
}
|
||||
|
||||
if (diff)
|
||||
return key->reverse ? -diff : diff;
|
||||
if (comparable_lengths && (diff = lena - lenb) != 0)
|
||||
return key->reverse ? -diff : diff;
|
||||
goto not_equal;
|
||||
|
||||
key = key->next;
|
||||
if (! key)
|
||||
break;
|
||||
|
||||
/* Find the beginning and limit of the next field. */
|
||||
if (key->eword >= 0)
|
||||
lima = limfield (a, key), limb = limfield (b, key);
|
||||
else
|
||||
lima = a->text + a->length - 1, limb = b->text + b->length - 1;
|
||||
|
||||
if (key->sword >= 0)
|
||||
texta = begfield (a, key), textb = begfield (b, key);
|
||||
else
|
||||
{
|
||||
texta = a->text, textb = b->text;
|
||||
if (key->skipsblanks)
|
||||
{
|
||||
while (texta < lima && blanks[UCHAR (*texta)])
|
||||
++texta;
|
||||
while (textb < limb && blanks[UCHAR (*textb)])
|
||||
++textb;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
greater:
|
||||
diff = 1;
|
||||
not_equal:
|
||||
return key->reverse ? -diff : diff;
|
||||
}
|
||||
|
||||
/* Compare two lines A and B, returning negative, zero, or positive
|
||||
@@ -1304,38 +1262,32 @@ keycompare (const struct line *a, const struct line *b)
|
||||
static int
|
||||
compare (register const struct line *a, register const struct line *b)
|
||||
{
|
||||
int diff, alen, blen, minlen;
|
||||
int diff, alen, blen;
|
||||
|
||||
/* First try to compare on the specified keys (if any).
|
||||
The only two cases with no key at all are unadorned sort,
|
||||
and unadorned sort -r. */
|
||||
if (keyhead.next)
|
||||
if (keylist)
|
||||
{
|
||||
diff = keycompare (a, b);
|
||||
alloca (0);
|
||||
if (diff != 0 || unique || stable)
|
||||
{
|
||||
alloca (0);
|
||||
return diff;
|
||||
}
|
||||
return diff;
|
||||
}
|
||||
|
||||
/* If the keys all compare equal (or no keys were specified)
|
||||
fall through to the default byte-by-byte comparison. */
|
||||
fall through to the default comparison. */
|
||||
alen = a->length - 1, blen = b->length - 1;
|
||||
|
||||
if (alen == 0)
|
||||
diff = - blen;
|
||||
else if (blen == 0)
|
||||
diff = alen;
|
||||
#ifdef ENABLE_NLS
|
||||
if (hard_LC_COLLATE)
|
||||
{
|
||||
diff = memcoll (a->text, alen, b->text, blen);
|
||||
alloca (0);
|
||||
return reverse ? -diff : diff;
|
||||
}
|
||||
else if (hard_LC_COLLATE)
|
||||
diff = memcoll (a->text, alen, b->text, blen);
|
||||
#endif
|
||||
|
||||
minlen = min (alen, blen);
|
||||
if (minlen == 0
|
||||
|| (! (diff = UCHAR (a->text[0]) - UCHAR (b->text[0]))
|
||||
&& ! (diff = memcmp (a->text, b->text, minlen))))
|
||||
else if (! (diff = memcmp (a->text, b->text, min (alen, blen))))
|
||||
diff = alen - blen;
|
||||
|
||||
return reverse ? -diff : diff;
|
||||
@@ -1357,6 +1309,7 @@ checkfp (FILE *fp, const char *file_name)
|
||||
int line_number = 1;
|
||||
struct line *disorder_line IF_LINT (= NULL);
|
||||
int disorder_line_number = 0;
|
||||
struct keyfield *key = keylist;
|
||||
|
||||
initbuf (&buf, mergealloc);
|
||||
initlines (&lines, mergealloc / linelength + 1,
|
||||
@@ -1394,18 +1347,17 @@ checkfp (FILE *fp, const char *file_name)
|
||||
prev_line = lines.lines + (lines.used - 1);
|
||||
if (alloc < prev_line->length)
|
||||
{
|
||||
do
|
||||
{
|
||||
alloc *= 2;
|
||||
}
|
||||
while (alloc < prev_line->length);
|
||||
while ((alloc *= 2) < prev_line->length)
|
||||
continue;
|
||||
temp.text = xrealloc (temp.text, alloc);
|
||||
}
|
||||
assert (prev_line->length <= alloc);
|
||||
memcpy (temp.text, prev_line->text, prev_line->length);
|
||||
temp.length = prev_line->length;
|
||||
temp.keybeg = temp.text + (prev_line->keybeg - prev_line->text);
|
||||
temp.keylim = temp.text + (prev_line->keylim - prev_line->text);
|
||||
if (key)
|
||||
{
|
||||
temp.keybeg = temp.text + (prev_line->keybeg - prev_line->text);
|
||||
temp.keylim = temp.text + (prev_line->keylim - prev_line->text);
|
||||
}
|
||||
|
||||
cc = fillbuf (&buf, fp);
|
||||
if (cc == 0)
|
||||
@@ -1448,8 +1400,9 @@ mergefps (FILE **fps, register int nfps, FILE *ofp, const char *output_file)
|
||||
{
|
||||
struct buffer buffer[NMERGE]; /* Input buffers for each file. */
|
||||
struct lines lines[NMERGE]; /* Line tables for each buffer. */
|
||||
struct line saved; /* Saved line for unique check. */
|
||||
int savedflag = 0; /* True if there is a saved line. */
|
||||
struct line saved; /* Saved line storage for unique check. */
|
||||
struct line const *savedline IF_LINT (= NULL);
|
||||
/* &saved if there is a saved line. */
|
||||
int savealloc IF_LINT (= 0); /* Size allocated for the saved line. */
|
||||
int cur[NMERGE]; /* Current line in each line table. */
|
||||
int ord[NMERGE]; /* Table representing a permutation of fps,
|
||||
@@ -1457,10 +1410,12 @@ mergefps (FILE **fps, register int nfps, FILE *ofp, const char *output_file)
|
||||
is the smallest line and will be next
|
||||
output. */
|
||||
register int i, j, t;
|
||||
struct keyfield *key = keylist;
|
||||
|
||||
/* Allocate space for a saved line if necessary. */
|
||||
if (unique)
|
||||
{
|
||||
savedline = NULL;
|
||||
savealloc = linelength;
|
||||
saved.text = xmalloc (savealloc);
|
||||
}
|
||||
@@ -1501,44 +1456,39 @@ mergefps (FILE **fps, register int nfps, FILE *ofp, const char *output_file)
|
||||
/* Repeatedly output the smallest line until no input remains. */
|
||||
while (nfps)
|
||||
{
|
||||
struct line const *smallest = &lines[ord[0]].lines[cur[ord[0]]];
|
||||
|
||||
/* If uniquified output is turned on, output only the first of
|
||||
an identical series of lines. */
|
||||
if (unique)
|
||||
{
|
||||
if (savedflag && compare (&saved, &lines[ord[0]].lines[cur[ord[0]]]))
|
||||
if (savedline && compare (savedline, smallest))
|
||||
{
|
||||
savedline = 0;
|
||||
write_bytes (saved.text, saved.length, ofp, output_file);
|
||||
savedflag = 0;
|
||||
}
|
||||
if (!savedflag)
|
||||
if (!savedline)
|
||||
{
|
||||
if (savealloc < lines[ord[0]].lines[cur[ord[0]]].length)
|
||||
savedline = &saved;
|
||||
if (savealloc < smallest->length)
|
||||
{
|
||||
while (savealloc < lines[ord[0]].lines[cur[ord[0]]].length)
|
||||
savealloc *= 2;
|
||||
while ((savealloc *= 2) < smallest->length)
|
||||
continue;
|
||||
saved.text = xrealloc (saved.text, savealloc);
|
||||
}
|
||||
saved.length = lines[ord[0]].lines[cur[ord[0]]].length;
|
||||
memcpy (saved.text, lines[ord[0]].lines[cur[ord[0]]].text,
|
||||
saved.length);
|
||||
if (lines[ord[0]].lines[cur[ord[0]]].keybeg != NULL)
|
||||
saved.length = smallest->length;
|
||||
memcpy (saved.text, smallest->text, saved.length);
|
||||
if (key)
|
||||
{
|
||||
saved.keybeg = saved.text +
|
||||
(lines[ord[0]].lines[cur[ord[0]]].keybeg
|
||||
- lines[ord[0]].lines[cur[ord[0]]].text);
|
||||
saved.keybeg =
|
||||
saved.text + (smallest->keybeg - smallest->text);
|
||||
saved.keylim =
|
||||
saved.text + (smallest->keylim - smallest->text);
|
||||
}
|
||||
if (lines[ord[0]].lines[cur[ord[0]]].keylim != NULL)
|
||||
{
|
||||
saved.keylim = saved.text +
|
||||
(lines[ord[0]].lines[cur[ord[0]]].keylim
|
||||
- lines[ord[0]].lines[cur[ord[0]]].text);
|
||||
}
|
||||
savedflag = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
write_bytes (lines[ord[0]].lines[cur[ord[0]]].text,
|
||||
lines[ord[0]].lines[cur[ord[0]]].length, ofp, output_file);
|
||||
write_bytes (smallest->text, smallest->length, ofp, output_file);
|
||||
|
||||
/* Check if we need to read more lines into core. */
|
||||
if (++cur[ord[0]] == lines[ord[0]].used)
|
||||
@@ -1589,7 +1539,7 @@ mergefps (FILE **fps, register int nfps, FILE *ofp, const char *output_file)
|
||||
ord[i - 1] = t;
|
||||
}
|
||||
|
||||
if (unique && savedflag)
|
||||
if (unique && savedline)
|
||||
{
|
||||
write_bytes (saved.text, saved.length, ofp, output_file);
|
||||
free (saved.text);
|
||||
@@ -1729,10 +1679,10 @@ sort (char **files, int nfiles, FILE *ofp, const char *output_file)
|
||||
while (fillbuf (&buf, fp))
|
||||
{
|
||||
findlines (&buf, &lines);
|
||||
if (lines.used > ntmp)
|
||||
if (ntmp < lines.used)
|
||||
{
|
||||
while (lines.used > ntmp)
|
||||
ntmp *= 2;
|
||||
while ((ntmp *= 2) < lines.used)
|
||||
continue;
|
||||
tmp = (struct line *)
|
||||
xrealloc ((char *) tmp, ntmp * sizeof (struct line));
|
||||
}
|
||||
@@ -1773,16 +1723,16 @@ sort (char **files, int nfiles, FILE *ofp, const char *output_file)
|
||||
}
|
||||
}
|
||||
|
||||
/* Insert key KEY at the end of the list (`keyhead'). */
|
||||
/* Insert key KEY at the end of the key list. */
|
||||
|
||||
static void
|
||||
insertkey (struct keyfield *key)
|
||||
{
|
||||
struct keyfield *k = &keyhead;
|
||||
struct keyfield **p;
|
||||
|
||||
while (k->next)
|
||||
k = k->next;
|
||||
k->next = key;
|
||||
for (p = &keylist; *p; p = &(*p)->next)
|
||||
continue;
|
||||
*p = key;
|
||||
key->next = NULL;
|
||||
}
|
||||
|
||||
@@ -1797,16 +1747,16 @@ badfieldspec (const char *s)
|
||||
static void
|
||||
sighandler (int sig)
|
||||
{
|
||||
#ifdef SA_INTERRUPT
|
||||
#ifdef SA_NOCLDSTOP
|
||||
struct sigaction sigact;
|
||||
|
||||
sigact.sa_handler = SIG_DFL;
|
||||
sigemptyset (&sigact.sa_mask);
|
||||
sigact.sa_flags = 0;
|
||||
sigaction (sig, &sigact, NULL);
|
||||
#else /* !SA_INTERRUPT */
|
||||
#else
|
||||
signal (sig, SIG_DFL);
|
||||
#endif /* SA_INTERRUPT */
|
||||
#endif
|
||||
cleanup ();
|
||||
kill (getpid (), sig);
|
||||
}
|
||||
@@ -1875,9 +1825,9 @@ main (int argc, char **argv)
|
||||
int checkonly = 0, mergeonly = 0, nfiles = 0;
|
||||
char *minus = "-", *outfile = minus, **files, *tmp;
|
||||
FILE *ofp;
|
||||
#ifdef SA_INTERRUPT
|
||||
#ifdef SA_NOCLDSTOP
|
||||
struct sigaction oldact, newact;
|
||||
#endif /* SA_INTERRUPT */
|
||||
#endif
|
||||
|
||||
program_name = argv[0];
|
||||
setlocale (LC_ALL, "");
|
||||
@@ -1887,7 +1837,6 @@ main (int argc, char **argv)
|
||||
#ifdef ENABLE_NLS
|
||||
|
||||
hard_LC_COLLATE = hard_locale (LC_COLLATE);
|
||||
hard_LC_CTYPE = hard_locale (LC_CTYPE);
|
||||
# if HAVE_NL_LANGINFO
|
||||
hard_LC_TIME = hard_locale (LC_TIME);
|
||||
# endif
|
||||
@@ -1925,7 +1874,7 @@ main (int argc, char **argv)
|
||||
xalloc_exit_failure = SORT_FAILURE;
|
||||
xalloc_fail_func = cleanup;
|
||||
|
||||
#ifdef SA_INTERRUPT
|
||||
#ifdef SA_NOCLDSTOP
|
||||
newact.sa_handler = sighandler;
|
||||
sigemptyset (&newact.sa_mask);
|
||||
newact.sa_flags = 0;
|
||||
@@ -1942,7 +1891,7 @@ main (int argc, char **argv)
|
||||
sigaction (SIGTERM, NULL, &oldact);
|
||||
if (oldact.sa_handler != SIG_IGN)
|
||||
sigaction (SIGTERM, &newact, NULL);
|
||||
#else /* !SA_INTERRUPT */
|
||||
#else
|
||||
if (signal (SIGINT, SIG_IGN) != SIG_IGN)
|
||||
signal (SIGINT, sighandler);
|
||||
if (signal (SIGHUP, SIG_IGN) != SIG_IGN)
|
||||
@@ -1951,7 +1900,7 @@ main (int argc, char **argv)
|
||||
signal (SIGPIPE, sighandler);
|
||||
if (signal (SIGTERM, SIG_IGN) != SIG_IGN)
|
||||
signal (SIGTERM, sighandler);
|
||||
#endif /* !SA_INTERRUPT */
|
||||
#endif
|
||||
|
||||
gkey.sword = gkey.eword = -1;
|
||||
gkey.ignore = NULL;
|
||||
@@ -2213,7 +2162,7 @@ but lacks following character offset"));
|
||||
insertkey (key);
|
||||
|
||||
/* Inheritance of global options to individual keys. */
|
||||
for (key = keyhead.next; key; key = key->next)
|
||||
for (key = keylist; key; key = key->next)
|
||||
if (!key->ignore && !key->translate && !key->skipsblanks && !key->reverse
|
||||
&& !key->skipeblanks && !key->month && !key->numeric
|
||||
&& !key->general_numeric)
|
||||
@@ -2228,9 +2177,9 @@ but lacks following character offset"));
|
||||
key->reverse = gkey.reverse;
|
||||
}
|
||||
|
||||
if (!keyhead.next && (gkey.ignore || gkey.translate || gkey.skipsblanks
|
||||
|| gkey.skipeblanks || gkey.month || gkey.numeric
|
||||
|| gkey.general_numeric))
|
||||
if (!keylist && (gkey.ignore || gkey.translate || gkey.skipsblanks
|
||||
|| gkey.skipeblanks || gkey.month || gkey.numeric
|
||||
|| gkey.general_numeric))
|
||||
insertkey (&gkey);
|
||||
reverse = gkey.reverse;
|
||||
|
||||
|
||||
24
src/stty.c
24
src/stty.c
@@ -1,5 +1,5 @@
|
||||
/* stty -- change and print terminal line settings
|
||||
Copyright (C) 1990-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990-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
|
||||
@@ -467,12 +467,13 @@ wrapf (const char *message,...)
|
||||
vsprintf (buf, message, args);
|
||||
va_end (args);
|
||||
buflen = strlen (buf);
|
||||
if (current_col + (current_col > 0) + buflen >= max_col)
|
||||
if (0 < current_col
|
||||
&& max_col <= current_col + (0 < current_col) + buflen)
|
||||
{
|
||||
putchar ('\n');
|
||||
current_col = 0;
|
||||
}
|
||||
if (current_col > 0)
|
||||
if (0 < current_col)
|
||||
{
|
||||
putchar (' ');
|
||||
current_col++;
|
||||
@@ -1434,13 +1435,20 @@ screen_columns (void)
|
||||
(but it works for ptys).
|
||||
It can also fail on any system when stdout isn't a tty.
|
||||
In case of any failure, just use the default. */
|
||||
if (get_win_size (STDOUT_FILENO, &win) == 0 && win.ws_col > 0)
|
||||
if (get_win_size (STDOUT_FILENO, &win) == 0 && 0 < win.ws_col)
|
||||
return win.ws_col;
|
||||
#endif
|
||||
/* FIXME: use xstrtol */
|
||||
if (getenv ("COLUMNS"))
|
||||
return atoi (getenv ("COLUMNS"));
|
||||
return 80;
|
||||
{
|
||||
/* Use $COLUMNS if it's in [1..INT_MAX-1]. */
|
||||
char *col_string = getenv ("COLUMNS");
|
||||
long n_columns;
|
||||
if (!(col_string != NULL
|
||||
&& xstrtol (col_string, NULL, 0, &n_columns, "") == LONGINT_OK
|
||||
&& 0 < n_columns
|
||||
&& n_columns < INT_MAX))
|
||||
n_columns = 80;
|
||||
return n_columns;
|
||||
}
|
||||
}
|
||||
|
||||
static tcflag_t *
|
||||
|
||||
4
src/su.c
4
src/su.c
@@ -1,5 +1,5 @@
|
||||
/* su for GNU. Run a shell with substitute user and group IDs.
|
||||
Copyright (C) 1992-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992-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
|
||||
@@ -275,7 +275,7 @@ static int
|
||||
correct_password (const struct passwd *pw)
|
||||
{
|
||||
char *unencrypted, *encrypted, *correct;
|
||||
#ifdef HAVE_SHADOW_H
|
||||
#if HAVE_GETSPNAM && HAVE_STRUCT_SPWD_SP_PWDP
|
||||
/* Shadow passwd stuff for SVR3 and maybe other systems. */
|
||||
struct spwd *sp = getspnam (pw->pw_name);
|
||||
|
||||
|
||||
26
src/sys2.h
26
src/sys2.h
@@ -261,40 +261,50 @@ char *alloca ();
|
||||
|
||||
#define STREQ(a, b) (strcmp ((a), (b)) == 0)
|
||||
|
||||
#ifndef HAVE_DECL_FREE
|
||||
#if !HAVE_DECL_FREE
|
||||
void free ();
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_MALLOC
|
||||
#if !HAVE_DECL_MALLOC
|
||||
char *malloc ();
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_MEMCHR
|
||||
#if !HAVE_DECL_MEMCHR
|
||||
char *memchr ();
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_REALLOC
|
||||
#if !HAVE_DECL_REALLOC
|
||||
char *realloc ();
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_STPCPY
|
||||
#if !HAVE_DECL_STPCPY
|
||||
# ifndef stpcpy
|
||||
char *stpcpy ();
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_STRSTR
|
||||
#if !HAVE_DECL_STRSTR
|
||||
char *strstr ();
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_GETENV
|
||||
#if !HAVE_DECL_GETENV
|
||||
char *getenv ();
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_LSEEK
|
||||
#if !HAVE_DECL_LSEEK
|
||||
off_t lseek ();
|
||||
#endif
|
||||
|
||||
/* This is needed on some AIX systems. */
|
||||
#if !HAVE_DECL_STRTOUL
|
||||
unsigned long strtoul ();
|
||||
#endif
|
||||
|
||||
/* This is needed on some AIX systems. */
|
||||
#if !HAVE_DECL_STRTOULL && HAVE_UNSIGNED_LONG_LONG
|
||||
unsigned long long strtoull ();
|
||||
#endif
|
||||
|
||||
#include "xalloc.h"
|
||||
|
||||
#if ! defined HAVE_MEMPCPY && ! defined mempcpy
|
||||
|
||||
20
src/system.h
20
src/system.h
@@ -193,9 +193,15 @@ extern int errno;
|
||||
#ifndef HAVE_STRUCT_STAT_ST_BLOCKS
|
||||
# define ST_BLKSIZE(statbuf) DEV_BSIZE
|
||||
# if defined(_POSIX_SOURCE) || !defined(BSIZE) /* fileblocks.c uses BSIZE. */
|
||||
# define ST_NBLOCKS(statbuf) ((statbuf).st_size / ST_NBLOCKSIZE + ((statbuf).st_size % ST_NBLOCKSIZE != 0))
|
||||
# define ST_NBLOCKS(statbuf) \
|
||||
(S_ISREG ((statbuf).st_mode) \
|
||||
|| S_ISDIR ((statbuf).st_mode) \
|
||||
? (statbuf).st_size / ST_NBLOCKSIZE + ((statbuf).st_size % ST_NBLOCKSIZE != 0) : 0)
|
||||
# else /* !_POSIX_SOURCE && BSIZE */
|
||||
# define ST_NBLOCKS(statbuf) (st_blocks ((statbuf).st_size))
|
||||
# define ST_NBLOCKS(statbuf) \
|
||||
(S_ISREG ((statbuf).st_mode) \
|
||||
|| S_ISDIR ((statbuf).st_mode) \
|
||||
? st_blocks ((statbuf).st_size) : 0)
|
||||
# endif /* !_POSIX_SOURCE && BSIZE */
|
||||
#else /* HAVE_STRUCT_STAT_ST_BLOCKS */
|
||||
/* Some systems, like Sequents, return st_blksize of 0 on pipes. */
|
||||
@@ -211,14 +217,20 @@ extern int errno;
|
||||
# define ST_NBLOCKSIZE (4 * 1024)
|
||||
# else /* not AIX PS/2 */
|
||||
# if defined(_CRAY)
|
||||
# define ST_NBLOCKS(statbuf) ((statbuf).st_blocks * ST_BLKSIZE(statbuf)/ST_NBLOCKSIZE)
|
||||
# define ST_NBLOCKS(statbuf) \
|
||||
(S_ISREG ((statbuf).st_mode) \
|
||||
|| S_ISDIR ((statbuf).st_mode) \
|
||||
? (statbuf).st_blocks * ST_BLKSIZE(statbuf)/ST_NBLOCKSIZE : 0)
|
||||
# endif /* _CRAY */
|
||||
# endif /* not AIX PS/2 */
|
||||
# endif /* !hpux */
|
||||
#endif /* HAVE_STRUCT_STAT_ST_BLOCKS */
|
||||
|
||||
#ifndef ST_NBLOCKS
|
||||
# define ST_NBLOCKS(statbuf) ((statbuf).st_blocks)
|
||||
# define ST_NBLOCKS(statbuf) \
|
||||
(S_ISREG ((statbuf).st_mode) \
|
||||
|| S_ISDIR ((statbuf).st_mode) \
|
||||
? (statbuf).st_blocks : 0)
|
||||
#endif
|
||||
|
||||
#ifndef ST_NBLOCKSIZE
|
||||
|
||||
12
src/touch.c
12
src/touch.c
@@ -1,5 +1,5 @@
|
||||
/* touch -- change modification and access times of files
|
||||
Copyright (C) 87, 1989-1991, 1995-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 87, 1989-1991, 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
|
||||
@@ -44,6 +44,14 @@ time_t time ();
|
||||
#define CH_ATIME 1
|
||||
#define CH_MTIME 2
|
||||
|
||||
#if !defined O_NDELAY
|
||||
# define O_NDELAY 0
|
||||
#endif
|
||||
|
||||
#if !defined O_NONBLOCK
|
||||
# define O_NONBLOCK O_NDELAY
|
||||
#endif
|
||||
|
||||
/* The name by which this program was run. */
|
||||
char *program_name;
|
||||
|
||||
@@ -123,7 +131,7 @@ touch (const char *file)
|
||||
if (! no_create)
|
||||
{
|
||||
/* Try to open FILE, creating it if necessary. */
|
||||
fd = open (file, O_WRONLY | O_CREAT,
|
||||
fd = open (file, O_WRONLY | O_CREAT | O_NONBLOCK,
|
||||
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
|
||||
if (fd == -1)
|
||||
open_errno = errno;
|
||||
|
||||
144
src/tr.c
144
src/tr.c
@@ -1,5 +1,5 @@
|
||||
/* tr -- a filter to translate characters
|
||||
Copyright (C) 91, 1995-1998, 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 91, 1995-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
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "system.h"
|
||||
#include "error.h"
|
||||
#include "safe-read.h"
|
||||
#include "xstrtol.h"
|
||||
|
||||
/* The official name of this program (e.g., no `g' prefix). */
|
||||
#define PROGRAM_NAME "tr"
|
||||
@@ -36,8 +37,8 @@
|
||||
|
||||
#define N_CHARS (UCHAR_MAX + 1)
|
||||
|
||||
/* A pointer to a function that returns an int. */
|
||||
typedef int (*PFI) ();
|
||||
/* A pointer to a filtering function. */
|
||||
typedef size_t (*Filter) (/* unsigned char *, size_t, Filter */);
|
||||
|
||||
/* Convert from character C to its index in the collating
|
||||
sequence array. Just cast to an unsigned int to avoid
|
||||
@@ -838,48 +839,6 @@ find_closing_delim (const struct E_string *es, size_t start_idx,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Convert a string S with explicit length LEN, possibly
|
||||
containing embedded zero bytes, to a long integer value.
|
||||
If the string represents a negative value, a value larger
|
||||
than LONG_MAX, or if all LEN characters do not represent a
|
||||
valid integer, return nonzero and do not modify *VAL.
|
||||
Otherwise, return zero and set *VAL to the converted value. */
|
||||
|
||||
static int
|
||||
non_neg_strtol (const unsigned char *s, size_t len, size_t *val)
|
||||
{
|
||||
size_t i;
|
||||
unsigned long sum = 0;
|
||||
unsigned int base;
|
||||
|
||||
if (len <= 0)
|
||||
return 1;
|
||||
if (s[0] == '0')
|
||||
base = 8;
|
||||
else if (ISDIGIT (s[0]))
|
||||
base = 10;
|
||||
else
|
||||
return 1;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
unsigned int c;
|
||||
|
||||
if (s[i] < '0')
|
||||
return 1;
|
||||
|
||||
c = s[i] - '0';
|
||||
if (c >= base)
|
||||
return 1;
|
||||
|
||||
if (sum > (LONG_MAX - c) / base)
|
||||
return 1;
|
||||
sum = sum * base + c;
|
||||
}
|
||||
*val = sum;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Parse the bracketed repeat-char syntax. If the P_LEN characters
|
||||
beginning with P[ START_IDX ] comprise a valid [c*n] construct,
|
||||
then set *CHAR_TO_REPEAT, *REPEAT_COUNT, and *CLOSING_BRACKET_IDX
|
||||
@@ -905,7 +864,6 @@ find_bracketed_repeat (const struct E_string *es, size_t start_idx,
|
||||
{
|
||||
if (ES_MATCH (es, i, ']'))
|
||||
{
|
||||
const unsigned char *digit_str;
|
||||
size_t digit_str_len = i - start_idx - 2;
|
||||
|
||||
*char_to_repeat = es->s[start_idx];
|
||||
@@ -918,17 +876,34 @@ find_bracketed_repeat (const struct E_string *es, size_t start_idx,
|
||||
}
|
||||
|
||||
/* Here, we have found [c*s] where s should be a string
|
||||
of octal or decimal digits. */
|
||||
digit_str = &es->s[start_idx + 2];
|
||||
if (non_neg_strtol (digit_str, digit_str_len, repeat_count)
|
||||
|| *repeat_count > BEGIN_STATE)
|
||||
{
|
||||
char *tmp = make_printable_str (digit_str, digit_str_len);
|
||||
error (0, 0, _("invalid repeat count `%s' in [c*n] construct"),
|
||||
tmp);
|
||||
free (tmp);
|
||||
return -2;
|
||||
}
|
||||
of octal (if it starts with `0') or decimal digits. */
|
||||
{
|
||||
const char *digit_str = &es->s[start_idx + 2];
|
||||
unsigned long int tmp_ulong;
|
||||
char *d_end;
|
||||
int base = 10;
|
||||
/* Select the base manually so we can be sure it's either 8 or 10.
|
||||
If the spec allowed it to be interpreted as hexadecimal, we
|
||||
could have used `0' and let xstrtoul decide. */
|
||||
if (*digit_str == '0')
|
||||
{
|
||||
base = 8;
|
||||
++digit_str;
|
||||
--digit_str_len;
|
||||
}
|
||||
if (xstrtoul (digit_str, &d_end, base, &tmp_ulong, NULL) != LONGINT_OK
|
||||
|| BEGIN_STATE < tmp_ulong
|
||||
|| d_end - digit_str != digit_str_len)
|
||||
{
|
||||
char *tmp = make_printable_str (es->s + start_idx + 2,
|
||||
i - start_idx - 2);
|
||||
error (0, 0, _("invalid repeat count `%s' in [c*n] construct"),
|
||||
tmp);
|
||||
free (tmp);
|
||||
return -2;
|
||||
}
|
||||
*repeat_count = tmp_ulong;
|
||||
}
|
||||
*closing_bracket_idx = i;
|
||||
return 0;
|
||||
}
|
||||
@@ -960,7 +935,7 @@ star_digits_closebracket (const struct E_string *es, size_t idx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Convert string UNESACPED_STRING (which has been preprocessed to
|
||||
/* Convert string UNESCAPED_STRING (which has been preprocessed to
|
||||
convert backslash-escape sequences) of length LEN characters into
|
||||
a linked list of the following 5 types of constructs:
|
||||
- [:str:] Character class where `str' is one of the 12 valid strings.
|
||||
@@ -1598,25 +1573,30 @@ when translating"));
|
||||
character is in the squeeze set. */
|
||||
|
||||
static void
|
||||
squeeze_filter (unsigned char *buf, long int size, PFI reader)
|
||||
squeeze_filter (unsigned char *buf, size_t size, Filter reader)
|
||||
{
|
||||
unsigned int char_to_squeeze = NOT_A_CHAR;
|
||||
int i = 0;
|
||||
int nr = 0;
|
||||
size_t i = 0;
|
||||
ssize_t nr = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
int begin;
|
||||
size_t begin;
|
||||
|
||||
if (i >= nr)
|
||||
{
|
||||
if (reader == NULL)
|
||||
nr = safe_read (0, (char *) buf, size);
|
||||
{
|
||||
ssize_t signed_nr = safe_read (0, (char *) buf, size);
|
||||
if (signed_nr < 0)
|
||||
error (EXIT_FAILURE, errno, _("read error"));
|
||||
nr = signed_nr;
|
||||
}
|
||||
else
|
||||
nr = (*reader) (buf, size, NULL);
|
||||
{
|
||||
nr = (*reader) (buf, size, NULL);
|
||||
}
|
||||
|
||||
if (nr < 0)
|
||||
error (EXIT_FAILURE, errno, _("read error"));
|
||||
if (nr == 0)
|
||||
break;
|
||||
i = 0;
|
||||
@@ -1626,7 +1606,7 @@ squeeze_filter (unsigned char *buf, long int size, PFI reader)
|
||||
|
||||
if (char_to_squeeze == NOT_A_CHAR)
|
||||
{
|
||||
int out_len;
|
||||
size_t out_len;
|
||||
/* Here, by being a little tricky, we can get a significant
|
||||
performance increase in most cases when the input is
|
||||
reasonably large. Since tr will modify the input only
|
||||
@@ -1692,14 +1672,13 @@ squeeze_filter (unsigned char *buf, long int size, PFI reader)
|
||||
in the delete set, and return the number of characters saved
|
||||
or 0 upon EOF. */
|
||||
|
||||
static long
|
||||
read_and_delete (unsigned char *buf, long int size, PFI not_used)
|
||||
static size_t
|
||||
read_and_delete (unsigned char *buf, size_t size, Filter not_used)
|
||||
{
|
||||
long n_saved;
|
||||
size_t n_saved;
|
||||
static int hit_eof = 0;
|
||||
|
||||
assert (not_used == NULL);
|
||||
assert (size > 0);
|
||||
|
||||
if (hit_eof)
|
||||
return 0;
|
||||
@@ -1709,8 +1688,8 @@ read_and_delete (unsigned char *buf, long int size, PFI not_used)
|
||||
just deleted all the characters in a buffer. */
|
||||
do
|
||||
{
|
||||
int i;
|
||||
int nr = safe_read (0, (char *) buf, size);
|
||||
size_t i;
|
||||
ssize_t nr = safe_read (0, (char *) buf, size);
|
||||
|
||||
if (nr < 0)
|
||||
error (EXIT_FAILURE, errno, _("read error"));
|
||||
@@ -1742,15 +1721,14 @@ read_and_delete (unsigned char *buf, long int size, PFI not_used)
|
||||
perform the in-place and one-to-one mapping specified by the global
|
||||
array `xlate'. Return the number of characters read, or 0 upon EOF. */
|
||||
|
||||
static long
|
||||
read_and_xlate (unsigned char *buf, long int size, PFI not_used)
|
||||
static size_t
|
||||
read_and_xlate (unsigned char *buf, size_t size, Filter not_used)
|
||||
{
|
||||
long chars_read = 0;
|
||||
ssize_t chars_read = 0;
|
||||
static int hit_eof = 0;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
assert (not_used == NULL);
|
||||
assert (size > 0);
|
||||
|
||||
if (hit_eof)
|
||||
return 0;
|
||||
@@ -1779,7 +1757,7 @@ static void
|
||||
set_initialize (struct Spec_list *s, int complement_this_set, SET_TYPE *in_set)
|
||||
{
|
||||
int c;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
memset (in_set, 0, N_CHARS * sizeof (in_set[0]));
|
||||
s->state = BEGIN_STATE;
|
||||
@@ -1906,7 +1884,7 @@ without squeezing repeats"));
|
||||
}
|
||||
else if (delete && non_option_args == 1)
|
||||
{
|
||||
long nr;
|
||||
size_t nr;
|
||||
|
||||
set_initialize (s1, complement, in_delete_set);
|
||||
do
|
||||
@@ -1921,7 +1899,7 @@ without squeezing repeats"));
|
||||
{
|
||||
set_initialize (s1, complement, in_delete_set);
|
||||
set_initialize (s2, 0, in_squeeze_set);
|
||||
squeeze_filter (io_buf, IO_BUF_SIZE, (PFI) read_and_delete);
|
||||
squeeze_filter (io_buf, IO_BUF_SIZE, read_and_delete);
|
||||
}
|
||||
else if (translating)
|
||||
{
|
||||
@@ -2010,11 +1988,11 @@ construct in string1 must be aligned with a corresponding construct\n\
|
||||
if (squeeze_repeats)
|
||||
{
|
||||
set_initialize (s2, 0, in_squeeze_set);
|
||||
squeeze_filter (io_buf, IO_BUF_SIZE, (PFI) read_and_xlate);
|
||||
squeeze_filter (io_buf, IO_BUF_SIZE, read_and_xlate);
|
||||
}
|
||||
else
|
||||
{
|
||||
long chars_read;
|
||||
size_t chars_read;
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
203
src/tsort.c
203
src/tsort.c
@@ -1,5 +1,5 @@
|
||||
/* tsort - topological sort.
|
||||
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
|
||||
@@ -66,12 +66,18 @@ char *program_name;
|
||||
/* Nonzero if any of the input files are the standard input. */
|
||||
static int have_read_stdin;
|
||||
|
||||
/* The error code to return to the system. */
|
||||
static int exit_status;
|
||||
|
||||
/* The head of the sorted list. */
|
||||
static struct item *head = NULL;
|
||||
|
||||
/* The tail of the list of `zeros', strings that have no predecessors. */
|
||||
static struct item *zeros = NULL;
|
||||
|
||||
/* Used for loop detection. */
|
||||
static struct item *loop = NULL;
|
||||
|
||||
/* The number of strings to sort. */
|
||||
static int n_strings = 0;
|
||||
|
||||
@@ -288,16 +294,18 @@ record_relation (struct item *j, struct item *k)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
count_items (struct item *k)
|
||||
{
|
||||
n_strings++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
scan_zeros (struct item *k)
|
||||
{
|
||||
if (k->count == 0)
|
||||
/* Ignore strings that have already been printed. */
|
||||
if (k->count == 0 && k->str)
|
||||
{
|
||||
if (head == NULL)
|
||||
head = k;
|
||||
@@ -306,48 +314,128 @@ scan_zeros (struct item *k)
|
||||
|
||||
zeros = k;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* If K is part of a loop, print the loop on standard error, and exit. */
|
||||
/* Try to detect the loop. If we have detected that K is part of a
|
||||
loop, print the loop on standard error, remove a relation to break
|
||||
the loop, and return non-zero.
|
||||
|
||||
static void
|
||||
The loop detection strategy is as follows: Realise that what we're
|
||||
dealing with is essentially a directed graph. If we find an item
|
||||
that is part of a graph that contains a cycle we traverse the graph
|
||||
in backwards direction. In general there is no unique way to do
|
||||
this, but that is no problem. If we encounter an item that we have
|
||||
encountered before, we know that we've found a cycle. All we have
|
||||
to do now is retrace our steps, printing out the items until we
|
||||
encounter that item again. (This is not necessarily the item that
|
||||
we started from originally.) Since the order in which the items
|
||||
are stored in the tree is not related to the specified partial
|
||||
ordering, we may need to walk the tree several times before the
|
||||
loop has completely been constructed. If the loop was found, the
|
||||
global variable LOOP will be NULL. */
|
||||
|
||||
static int
|
||||
detect_loop (struct item *k)
|
||||
{
|
||||
if (k->count > 0 && k->top)
|
||||
if (k->count > 0)
|
||||
{
|
||||
while (k && k->count > 0)
|
||||
{
|
||||
k->count = 0;
|
||||
fprintf (stderr, "%s: %s\n", program_name, k->str);
|
||||
k = k->top->suc;
|
||||
}
|
||||
/* K does not have to be part of a cycle. It is however part of
|
||||
a graph that contains a cycle. */
|
||||
|
||||
exit (EXIT_FAILURE);
|
||||
if (loop == NULL)
|
||||
/* Start traversing the graph at K. */
|
||||
loop = k;
|
||||
else
|
||||
{
|
||||
struct successor **p = &k->top;
|
||||
|
||||
while (*p)
|
||||
{
|
||||
if ((*p)->suc == loop)
|
||||
{
|
||||
if (k->qlink)
|
||||
{
|
||||
/* We have found a loop. Retrace our steps. */
|
||||
while (loop)
|
||||
{
|
||||
struct item *tmp = loop->qlink;
|
||||
|
||||
fprintf (stderr, "%s: %s\n", program_name,
|
||||
loop->str);
|
||||
|
||||
/* Until we encounter K again. */
|
||||
if (loop == k)
|
||||
{
|
||||
/* Remove relation. */
|
||||
(*p)->suc->count--;
|
||||
*p = (*p)->next;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Tidy things up since we might have to
|
||||
detect another loop. */
|
||||
loop->qlink = NULL;
|
||||
loop = tmp;
|
||||
}
|
||||
|
||||
while (loop)
|
||||
{
|
||||
struct item *tmp = loop->qlink;
|
||||
|
||||
loop->qlink = NULL;
|
||||
loop = tmp;
|
||||
}
|
||||
|
||||
/* Since we have found the loop, stop walking
|
||||
the tree. */
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
k->qlink = loop;
|
||||
loop = k;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
p = &(*p)->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Recurse (sub)tree rooted at ROOT, calling ACTION for each node. */
|
||||
/* Recurse (sub)tree rooted at ROOT, calling ACTION for each node.
|
||||
Stop when ACTION returns non-zero. */
|
||||
|
||||
static void
|
||||
recurse_tree (struct item *root, void (*action) (struct item *))
|
||||
static int
|
||||
recurse_tree (struct item *root, int (*action) (struct item *))
|
||||
{
|
||||
if (root->left == NULL && root->right == NULL)
|
||||
(*action) (root);
|
||||
return (*action) (root);
|
||||
else
|
||||
{
|
||||
if (root->left != NULL)
|
||||
recurse_tree (root->left, action);
|
||||
(*action) (root);
|
||||
if (recurse_tree (root->left, action))
|
||||
return 1;
|
||||
if ((*action) (root))
|
||||
return 1;
|
||||
if (root->right != NULL)
|
||||
recurse_tree (root->right, action);
|
||||
if (recurse_tree (root->right, action))
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Walk the tree specified by the head ROOT, calling ACTION for
|
||||
each node. */
|
||||
|
||||
static void
|
||||
walk_tree (struct item *root, void (*action) (struct item *))
|
||||
walk_tree (struct item *root, int (*action) (struct item *))
|
||||
{
|
||||
if (root->right)
|
||||
recurse_tree (root->right, action);
|
||||
@@ -406,46 +494,51 @@ tsort (const char *file)
|
||||
/* T1. Initialize (N <- n). */
|
||||
walk_tree (root, count_items);
|
||||
|
||||
/* T4. Scan for zeros. */
|
||||
walk_tree (root, scan_zeros);
|
||||
|
||||
while (head)
|
||||
while (n_strings > 0)
|
||||
{
|
||||
struct successor *p = head->top;
|
||||
/* T4. Scan for zeros. */
|
||||
walk_tree (root, scan_zeros);
|
||||
|
||||
/* T5. Output front of queue. */
|
||||
printf ("%s\n", head->str);
|
||||
n_strings--;
|
||||
|
||||
/* T6. Erase relations. */
|
||||
while (p)
|
||||
while (head)
|
||||
{
|
||||
p->suc->count--;
|
||||
if (p->suc->count == 0)
|
||||
struct successor *p = head->top;
|
||||
|
||||
/* T5. Output front of queue. */
|
||||
printf ("%s\n", head->str);
|
||||
head->str = NULL; /* Avoid printing the same string twice. */
|
||||
n_strings--;
|
||||
|
||||
/* T6. Erase relations. */
|
||||
while (p)
|
||||
{
|
||||
zeros->qlink = p->suc;
|
||||
zeros = p->suc;
|
||||
p->suc->count--;
|
||||
if (p->suc->count == 0)
|
||||
{
|
||||
zeros->qlink = p->suc;
|
||||
zeros = p->suc;
|
||||
}
|
||||
|
||||
p = p->next;
|
||||
}
|
||||
|
||||
p = p->next;
|
||||
/* T7. Remove from queue. */
|
||||
head = head->qlink;
|
||||
}
|
||||
|
||||
/* T7. Remove from queue. */
|
||||
head = head->qlink;
|
||||
}
|
||||
/* T8. End of process. */
|
||||
assert (n_strings >= 0);
|
||||
if (n_strings > 0)
|
||||
{
|
||||
/* The input contains a loop. */
|
||||
error (0, 0, _("%s: input contains a loop:"),
|
||||
(have_read_stdin ? "-" : file));
|
||||
exit_status = 1;
|
||||
|
||||
/* T8. End of process. */
|
||||
assert (n_strings >= 0);
|
||||
if (n_strings > 0)
|
||||
{
|
||||
error (0, 0, _("%s: input contains a loop:"),
|
||||
(have_read_stdin ? "-" : file));
|
||||
|
||||
/* Print out loop. */
|
||||
walk_tree (root, detect_loop);
|
||||
|
||||
/* Should not happen. */
|
||||
error (EXIT_FAILURE, 0, _("could not find loop"));
|
||||
/* Print the loop and remove a relation to break it. */
|
||||
do
|
||||
walk_tree (root, detect_loop);
|
||||
while (loop);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,6 +552,8 @@ main (int argc, char **argv)
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
exit_status = 0;
|
||||
|
||||
parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
|
||||
AUTHORS, usage);
|
||||
|
||||
@@ -490,5 +585,5 @@ main (int argc, char **argv)
|
||||
if (have_read_stdin && fclose (stdin) == EOF)
|
||||
error (EXIT_FAILURE, errno, _("standard input"));
|
||||
|
||||
exit (EXIT_SUCCESS);
|
||||
exit (exit_status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* unexpand - convert spaces to tabs
|
||||
Copyright (C) 89, 91, 1995-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 89, 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
|
||||
@@ -57,6 +57,11 @@
|
||||
allocated for the list of tabstops. */
|
||||
#define TABLIST_BLOCK 256
|
||||
|
||||
/* A sentinel value that's placed at the end of the list of tab stops.
|
||||
This value must be a large number, but not so large that adding the
|
||||
length of a line to it would cause the column variable to overflow. */
|
||||
#define TAB_STOP_SENTINEL INT_MAX
|
||||
|
||||
/* The name this program was run with. */
|
||||
char *program_name;
|
||||
|
||||
@@ -219,10 +224,10 @@ unexpand (void)
|
||||
/* Index in `tab_list' of next tabstop: */
|
||||
int tab_index = 0; /* For calculating width of pending tabs. */
|
||||
int print_tab_index = 0; /* For printing as many tabs as possible. */
|
||||
int column = 0; /* Column on screen of next char. */
|
||||
unsigned int column = 0; /* Column on screen of next char. */
|
||||
int next_tab_column; /* Column the next tab stop is on. */
|
||||
int convert = 1; /* If nonzero, perform translations. */
|
||||
int pending = 0; /* Pending columns of blanks. */
|
||||
unsigned int pending = 0; /* Pending columns of blanks. */
|
||||
|
||||
fp = next_file ((FILE *) NULL);
|
||||
if (fp == NULL)
|
||||
@@ -235,7 +240,7 @@ unexpand (void)
|
||||
{
|
||||
c = getc (fp);
|
||||
|
||||
if (c == ' ' && convert)
|
||||
if (c == ' ' && convert && column < TAB_STOP_SENTINEL)
|
||||
{
|
||||
++pending;
|
||||
++column;
|
||||
@@ -276,7 +281,7 @@ unexpand (void)
|
||||
pending = 0;
|
||||
}
|
||||
column -= pending;
|
||||
while (pending != 0)
|
||||
while (pending > 0)
|
||||
{
|
||||
if (tab_size == 0)
|
||||
{
|
||||
@@ -437,7 +442,7 @@ main (int argc, char **argv)
|
||||
else
|
||||
{
|
||||
/* Append a sentinel to the list of tab stop indices. */
|
||||
add_tabstop (INT_MAX);
|
||||
add_tabstop (TAB_STOP_SENTINEL);
|
||||
tab_size = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* GNU's uptime.
|
||||
Copyright (C) 1992-1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992-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
|
||||
@@ -79,7 +79,7 @@ print_uptime (int n, const STRUCT_UTMP *this)
|
||||
ones, also in the process possibly gleaning boottime. */
|
||||
while (n--)
|
||||
{
|
||||
if (this->ut_name[0]
|
||||
if (UT_USER (this) [0]
|
||||
#ifdef USER_PROCESS
|
||||
&& this->ut_type == USER_PROCESS
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user