mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
Compare commits
108 Commits
FILEUTILS-
...
FILEUTILS-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7f77ef1cf | ||
|
|
31053908a0 | ||
|
|
0c7040607d | ||
|
|
d81cbf71b4 | ||
|
|
b339cb8d84 | ||
|
|
d8880083a6 | ||
|
|
96cdeb978e | ||
|
|
b2cc136736 | ||
|
|
b394529747 | ||
|
|
edfafcd7b7 | ||
|
|
1c75eb6a98 | ||
|
|
814dc35407 | ||
|
|
99fe905035 | ||
|
|
ccf556a616 | ||
|
|
d96a2d9e14 | ||
|
|
8e11d5dfae | ||
|
|
f64f586fdc | ||
|
|
6f8e1b2134 | ||
|
|
8888bceb65 | ||
|
|
78315499ba | ||
|
|
e666e3459e | ||
|
|
6a9d144a66 | ||
|
|
f34578f297 | ||
|
|
1dc643390a | ||
|
|
ea3702aa6d | ||
|
|
59b9296742 | ||
|
|
bf3b759a61 | ||
|
|
bc24ebbed0 | ||
|
|
10ac9ed1ba | ||
|
|
f28de0cbe3 | ||
|
|
d7477dbf0c | ||
|
|
b4062862f6 | ||
|
|
4ddff14202 | ||
|
|
c98881bb59 | ||
|
|
9016aac157 | ||
|
|
8c5a8ba959 | ||
|
|
62a6b18a77 | ||
|
|
0f39512ec6 | ||
|
|
77becb06e1 | ||
|
|
2ff0c1870c | ||
|
|
9438eff8ec | ||
|
|
4097b92a07 | ||
|
|
7c695a0e5a | ||
|
|
85cddd3119 | ||
|
|
3661c96081 | ||
|
|
d4368d4802 | ||
|
|
34c992c065 | ||
|
|
e904744174 | ||
|
|
47e8713900 | ||
|
|
5637dfa191 | ||
|
|
ce5730d5c2 | ||
|
|
f1a405c1e9 | ||
|
|
7f88c2b896 | ||
|
|
eaa41b023f | ||
|
|
0867d4efd3 | ||
|
|
b12923594b | ||
|
|
4f208e731c | ||
|
|
26b61d5962 | ||
|
|
955f5eb1f4 | ||
|
|
0e02a64c99 | ||
|
|
545c237530 | ||
|
|
3cc1863ab3 | ||
|
|
815261aefc | ||
|
|
f599541be9 | ||
|
|
c62a6dbaa9 | ||
|
|
74388abca3 | ||
|
|
e044081627 | ||
|
|
d1320b7277 | ||
|
|
6ac49bdf47 | ||
|
|
c74ae79fd9 | ||
|
|
4b29186f72 | ||
|
|
94435a6401 | ||
|
|
1e26d4455a | ||
|
|
3683b0b3ef | ||
|
|
2d30458a75 | ||
|
|
9cde1990ab | ||
|
|
3fc07d456b | ||
|
|
73ca459085 | ||
|
|
85219ddf0f | ||
|
|
f471847cac | ||
|
|
edbc415595 | ||
|
|
e4c1c5efca | ||
|
|
c830d53afb | ||
|
|
4526777121 | ||
|
|
97df7b0013 | ||
|
|
9c28acb705 | ||
|
|
7b9e7765ee | ||
|
|
14c6c66b64 | ||
|
|
58b136578a | ||
|
|
139408f867 | ||
|
|
d2c6e7cba9 | ||
|
|
62e0054a8d | ||
|
|
a5be9924f2 | ||
|
|
f709048a82 | ||
|
|
d1f996b486 | ||
|
|
d3900b79bc | ||
|
|
34d871d67d | ||
|
|
71066e34b9 | ||
|
|
4be8ee6d75 | ||
|
|
63a48d0278 | ||
|
|
b8d66b1704 | ||
|
|
d64ae4c1be | ||
|
|
1a9771061b | ||
|
|
5c8eaa8139 | ||
|
|
4cfd024d37 | ||
|
|
5e053a624b | ||
|
|
e3625e3032 | ||
|
|
4c9586c01b |
43
ABOUT-NLS
43
ABOUT-NLS
@@ -134,7 +134,7 @@ Each translation team has its own mailing list, courtesy of Linux
|
||||
International. You may reach your translation team at the address
|
||||
`LL@li.org', replacing LL by the two-letter ISO 639 code for your
|
||||
language. Language codes are *not* the same as the country codes given
|
||||
in ISO 3166. The following translation teams exist, as of May 1996:
|
||||
in ISO 3166. The following translation teams exist, as of August 1996:
|
||||
|
||||
Arabic `ar', Chinese `zh', Czech `cs', Danish `da', Dutch `nl',
|
||||
English `en', Esperanto `eo', Finnish `fi', French `fr', German
|
||||
@@ -172,39 +172,40 @@ Available Packages
|
||||
|
||||
Languages are not equally supported in all GNU packages. The
|
||||
following matrix shows the current state of GNU internationalization,
|
||||
as of May 1996. The matrix shows, in regard of each package, for which
|
||||
languages PO files have been submitted to translation coordination.
|
||||
as of August 1996. The matrix shows, in regard of each package, for
|
||||
which languages PO files have been submitted to translation
|
||||
coordination.
|
||||
|
||||
cs de en es fi fr ja ko nl no pl pt sl sv
|
||||
.-------------------------------------------.
|
||||
bash | [] | 1
|
||||
bison | [] | 1
|
||||
bash | [] [] | 2
|
||||
bison | [] [] | 2
|
||||
clisp | [] [] [] | 3
|
||||
cpio | [] | 1
|
||||
cpio | [] [] [] | 3
|
||||
diffutils | [] [] [] | 3
|
||||
enscript | [] [] [] [] | 4
|
||||
fileutils | [] [] [] [] | 4
|
||||
findutils | [] [] | 2
|
||||
enscript | [] [] [] [] [] | 5
|
||||
fileutils | [] [] [] [] [] [] | 6
|
||||
findutils | [] [] [] [] [] | 5
|
||||
flex | [] | 1
|
||||
gcal | [] | 1
|
||||
gettext | [] [] [] [] [] [] [] [] | 9
|
||||
gettext | [] [] [] [] [] [] [] [] [] | 10
|
||||
glibc | [] [] [] | 3
|
||||
grep | [] [] [] [] [] [] | 6
|
||||
hello | [] [] [] [] [] [] | 6
|
||||
m4 | [] [] [] [] | 4
|
||||
make | | 0
|
||||
grep | [] [] [] [] [] [] [] | 7
|
||||
hello | [] [] [] [] [] [] [] [] | 8
|
||||
m4 | [] [] [] [] [] | 5
|
||||
make | [] [] | 2
|
||||
mkid | [] [] | 2
|
||||
music | [] | 1
|
||||
ptx | [] [] [] | 3
|
||||
recode | [] [] [] [] [] | 5
|
||||
ptx | [] [] [] [] [] | 5
|
||||
recode | [] [] [] [] [] [] [] | 7
|
||||
sh-utils | [] [] | 2
|
||||
sharutils | [] [] [] [] | 4
|
||||
tar | [] [] [] [] [] [] [] | 7
|
||||
textutils | [] [] [] [] | 4
|
||||
wdiff | [] [] [] [] | 4
|
||||
tar | [] [] [] [] [] [] [] [] | 8
|
||||
textutils | [] [] [] [] [] | 5
|
||||
wdiff | [] [] [] [] [] | 5
|
||||
`-------------------------------------------'
|
||||
cs de en es fi fr ja ko nl no pl pt sl sv
|
||||
1 17 1 3 1 22 1 6 3 3 4 3 6 10 81
|
||||
1 18 1 4 1 22 1 7 16 3 10 3 6 12 105
|
||||
|
||||
Some counters in the preceding matrix are higher than the number of
|
||||
visible blocks let us expect. This is because a few extra PO files are
|
||||
@@ -217,6 +218,6 @@ distributed as such by its maintainer. There might be an observable
|
||||
lag between the mere existence a PO file and its wide availability in a
|
||||
GNU distribution.
|
||||
|
||||
If May 1996 seems to be old, you may fetch a more recent copy of
|
||||
If August 1996 seems to be old, you may fetch a more recent copy of
|
||||
this `ABOUT-NLS' file on most GNU archive sites.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Makefile.in generated automatically by automake 1.1c from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.1e from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
@@ -49,7 +49,7 @@ CONFIG_CLEAN_FILES =
|
||||
|
||||
MAKEINFO = makeinfo
|
||||
TEXI2DVI = texi2dvi
|
||||
INFOS = fileutils.info fileutils.info-[0-9] fileutils.info-[0-9][0-9]
|
||||
INFOS = fileutils.info fileutils.info[-0-9]*
|
||||
INFO_DEPS = fileutils.info
|
||||
DVIS = fileutils.dvi
|
||||
TEXINFOS = fileutils.texi
|
||||
@@ -83,11 +83,8 @@ stamp-vti: fileutils.texi $(top_srcdir)/configure.in
|
||||
&& $(SHELL) ./mdate-sh fileutils.texi`" > vti.tmp
|
||||
echo "@set EDITION $(VERSION)" >> vti.tmp
|
||||
echo "@set VERSION $(VERSION)" >> vti.tmp
|
||||
if cmp -s vti.tmp $(srcdir)/version.texi; then \
|
||||
rm vti.tmp; \
|
||||
else \
|
||||
mv vti.tmp $(srcdir)/version.texi; \
|
||||
fi
|
||||
cmp -s vti.tmp $(srcdir)/version.texi || cp vti.tmp $(srcdir)/version.texi
|
||||
rm vti.tmp
|
||||
echo timestamp > $(srcdir)/stamp-vti
|
||||
|
||||
mostlyclean-vti:
|
||||
@@ -111,7 +108,15 @@ fileutils.dvi: fileutils.texi version.texi
|
||||
.texi.dvi:
|
||||
TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) $<
|
||||
|
||||
.texinfo.info:
|
||||
cd $(srcdir) \
|
||||
&& $(MAKEINFO) `echo $< | sed 's,.*/,,'`
|
||||
|
||||
.texinfo.dvi:
|
||||
TEXINPUTS=$(srcdir):$$TEXINPUTS $(TEXI2DVI) $<
|
||||
|
||||
install-info: $(INFO_DEPS)
|
||||
$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(infodir)
|
||||
for file in $(INFO_DEPS); do \
|
||||
for ifile in `cd $(srcdir) && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
|
||||
@@ -160,8 +165,10 @@ check: all
|
||||
installcheck:
|
||||
|
||||
install-exec:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install-data: install-info
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install: install-exec install-data all
|
||||
@:
|
||||
@@ -210,7 +217,7 @@ installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .texi .info .dvi
|
||||
.SUFFIXES: .texi .texinfo .info .dvi
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
|
||||
373
doc/texinfo.tex
373
doc/texinfo.tex
@@ -35,7 +35,7 @@
|
||||
|
||||
% This automatically updates the version number based on RCS.
|
||||
\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
|
||||
\deftexinfoversion$Revision: 1.10 $
|
||||
\deftexinfoversion$Revision: 1.11 $
|
||||
\message{Loading texinfo package [Version \texinfoversion]:}
|
||||
|
||||
% If in a .fmt file, print the version number
|
||||
@@ -74,6 +74,7 @@
|
||||
}
|
||||
\let\~ = \tie % And make it available as @~.
|
||||
|
||||
|
||||
\message{Basics,}
|
||||
\chardef\other=12
|
||||
|
||||
@@ -579,7 +580,7 @@ where each line of input produces a line of output.}
|
||||
% @sp n outputs n lines of vertical space
|
||||
|
||||
\def\sp{\parsearg\spxxx}
|
||||
\def\spxxx #1{\par \vskip #1\baselineskip}
|
||||
\def\spxxx #1{\vskip #1\baselineskip}
|
||||
|
||||
% @comment ...line which is ignored...
|
||||
% @c is the same as @comment
|
||||
@@ -592,6 +593,9 @@ where each line of input produces a line of output.}
|
||||
|
||||
\let\c=\comment
|
||||
|
||||
% @paragraphindent is defined for the Info formatting commands only.
|
||||
\let\paragraphindent=\comment
|
||||
|
||||
% Prevent errors for section commands.
|
||||
% Used in @ignore and in failing conditionals.
|
||||
\def\ignoresections{%
|
||||
@@ -626,6 +630,7 @@ where each line of input produces a line of output.}
|
||||
% incorrectly.
|
||||
%
|
||||
\def\ignoremorecommands{%
|
||||
\let\defcodeindex = \relax
|
||||
\let\defcv = \relax
|
||||
\let\deffn = \relax
|
||||
\let\deffnx = \relax
|
||||
@@ -666,7 +671,6 @@ where each line of input produces a line of output.}
|
||||
\let\set = \relax
|
||||
\let\clear = \relax
|
||||
\let\item = \relax
|
||||
\let\message = \relax
|
||||
}
|
||||
|
||||
% Ignore @ignore ... @end ignore.
|
||||
@@ -681,10 +685,15 @@ where each line of input produces a line of output.}
|
||||
\def\menu{\doignore{menu}}
|
||||
\def\direntry{\doignore{direntry}}
|
||||
|
||||
% Also ignore @macro ... @end macro. The user must run texi2dvi,
|
||||
% which runs makeinfo to do macro expansion. Ignore @unmacro, too.
|
||||
\def\macro{\doignore{macro}}
|
||||
\let\unmacro = \comment
|
||||
|
||||
|
||||
% @dircategory CATEGORY -- specify a category of the dir file
|
||||
% which this file should belong to. Ignore this in TeX.
|
||||
|
||||
\def\dircategory{\comment}
|
||||
\let\dircategory = \comment
|
||||
|
||||
% Ignore text until a line `@end #1'.
|
||||
%
|
||||
@@ -938,16 +947,13 @@ where each line of input produces a line of output.}
|
||||
\comment % Ignore the actual filename.
|
||||
}
|
||||
|
||||
% @bye.
|
||||
\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
|
||||
|
||||
\def\inforef #1{\inforefzzz #1,,,,**}
|
||||
\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
|
||||
node \samp{\ignorespaces#1{}}}
|
||||
|
||||
\def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx}
|
||||
\def\macroxxx#1#2 \end macro{%
|
||||
\expandafter\gdef\macrotemp#1{#2}%
|
||||
\endgroup}
|
||||
% \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx}
|
||||
% \def\macroxxx#1#2 \end macro{%
|
||||
% \expandafter\gdef\macrotemp#1{#2}%
|
||||
% \endgroup}
|
||||
|
||||
%\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx}
|
||||
%\def\linemacroxxx#1#2 \end linemacro{%
|
||||
@@ -959,6 +965,7 @@ where each line of input produces a line of output.}
|
||||
|
||||
%\def\butfirst#1{}
|
||||
|
||||
|
||||
\message{fonts,}
|
||||
|
||||
% Font-change commands.
|
||||
@@ -1028,7 +1035,7 @@ where each line of input produces a line of output.}
|
||||
\setfont\deftt\ttshape{10}{\magstep1}
|
||||
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
|
||||
|
||||
% Fonts for indices and small examples.
|
||||
% Fonts for indices and small examples (9pt).
|
||||
% We actually use the slanted font rather than the italic,
|
||||
% because texinfo normally uses the slanted fonts for that.
|
||||
% Do not make many font distinctions in general in the index, since they
|
||||
@@ -1045,7 +1052,7 @@ where each line of input produces a line of output.}
|
||||
\font\indi=cmmi9
|
||||
\font\indsy=cmsy9
|
||||
|
||||
% Fonts for headings
|
||||
% Chapter (and unnumbered) fonts (17.28pt).
|
||||
\setfont\chaprm\rmbshape{12}{\magstep2}
|
||||
\setfont\chapit\itbshape{10}{\magstep3}
|
||||
\setfont\chapsl\slbshape{10}{\magstep3}
|
||||
@@ -1057,6 +1064,7 @@ where each line of input produces a line of output.}
|
||||
\font\chapi=cmmi12 scaled \magstep2
|
||||
\font\chapsy=cmsy10 scaled \magstep3
|
||||
|
||||
% Section fonts (14.4pt).
|
||||
\setfont\secrm\rmbshape{12}{\magstep1}
|
||||
\setfont\secit\itbshape{10}{\magstep2}
|
||||
\setfont\secsl\slbshape{10}{\magstep2}
|
||||
@@ -1082,6 +1090,7 @@ where each line of input produces a line of output.}
|
||||
|
||||
%\let\ssecbf=\ssecrm
|
||||
|
||||
% Subsection fonts (13.15pt).
|
||||
\setfont\ssecrm\rmbshape{12}{\magstephalf}
|
||||
\setfont\ssecit\itbshape{10}{1315}
|
||||
\setfont\ssecsl\slbshape{10}{1315}
|
||||
@@ -1127,22 +1136,23 @@ where each line of input produces a line of output.}
|
||||
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
|
||||
\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
|
||||
\let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
|
||||
\resetmathfonts}
|
||||
\resetmathfonts \setleading{19pt}}
|
||||
\def\secfonts{%
|
||||
\let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
|
||||
\let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
|
||||
\let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
|
||||
\resetmathfonts}
|
||||
\resetmathfonts \setleading{16pt}}
|
||||
\def\subsecfonts{%
|
||||
\let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
|
||||
\let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
|
||||
\let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
|
||||
\resetmathfonts}
|
||||
\resetmathfonts \setleading{15pt}}
|
||||
\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
|
||||
\def\indexfonts{%
|
||||
\let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
|
||||
\let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
|
||||
\let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
|
||||
\resetmathfonts}
|
||||
\resetmathfonts \setleading{12pt}}
|
||||
|
||||
% Set up the default fonts, so we can use them for creating boxes.
|
||||
%
|
||||
@@ -1186,11 +1196,21 @@ where each line of input produces a line of output.}
|
||||
}
|
||||
\let\ttfont=\t
|
||||
\def\samp #1{`\tclose{#1}'\null}
|
||||
\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
|
||||
\setfont\smallrm\rmshape{8}{1000}
|
||||
\font\smallsy=cmsy9
|
||||
\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
|
||||
\raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{%
|
||||
\vbox{\hrule\kern-0.4pt
|
||||
\hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}%
|
||||
\kern-0.4pt\hrule}%
|
||||
\kern-.06em\raise0.4pt\hbox{$\rangle$}}}}
|
||||
% The old definition, with no lozenge:
|
||||
%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
|
||||
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
|
||||
|
||||
\let\file=\samp
|
||||
\let\url=\samp % perhaps include a hypertex \special eventually
|
||||
\def\email#1{$\langle${\tt #1}$\rangle$}
|
||||
|
||||
% @code is a modification of @t,
|
||||
% which makes spaces the same size as normal in the surrounding text.
|
||||
@@ -1222,7 +1242,7 @@ where each line of input produces a line of output.}
|
||||
% Unfortunately, TeX uses one parameter (\hyphenchar) to control
|
||||
% both hyphenation at - and hyphenation within words.
|
||||
% We must therefore turn them both off (\tclose does that)
|
||||
% and arrange explicitly to hyphenate an a dash.
|
||||
% and arrange explicitly to hyphenate at a dash.
|
||||
% -- rms.
|
||||
{
|
||||
\catcode`\-=\active
|
||||
@@ -1274,6 +1294,10 @@ where each line of input produces a line of output.}
|
||||
\def\sc#1{{\smallcaps#1}} % smallcaps font
|
||||
\def\ii#1{{\it #1}} % italic font
|
||||
|
||||
% @pounds{} is a sterling sign.
|
||||
\def\pounds{{\it\$}}
|
||||
|
||||
|
||||
\message{page headings,}
|
||||
|
||||
\newskip\titlepagetopglue \titlepagetopglue = 1.5in
|
||||
@@ -1419,7 +1443,8 @@ where each line of input produces a line of output.}
|
||||
% @headings after turns on double-sided headings after this page.
|
||||
% @headings doubleafter turns on double-sided headings after this page.
|
||||
% @headings singleafter turns on single-sided headings after this page.
|
||||
% By default, they are off.
|
||||
% By default, they are off at the start of a document,
|
||||
% and turned `on' after @end titlepage.
|
||||
|
||||
\def\headings #1 {\csname HEADINGS#1\endcsname}
|
||||
|
||||
@@ -1433,22 +1458,24 @@ where each line of input produces a line of output.}
|
||||
% title on inside top of left hand pages, and page numbers on outside top
|
||||
% edge of all pages.
|
||||
\def\HEADINGSdouble{
|
||||
%\pagealignmacro
|
||||
\global\pageno=1
|
||||
\global\evenfootline={\hfil}
|
||||
\global\oddfootline={\hfil}
|
||||
\global\evenheadline={\line{\folio\hfil\thistitle}}
|
||||
\global\oddheadline={\line{\thischapter\hfil\folio}}
|
||||
\global\let\contentsalignmacro = \chapoddpage
|
||||
}
|
||||
\let\contentsalignmacro = \chappager
|
||||
|
||||
% For single-sided printing, chapter title goes across top left of page,
|
||||
% page number on top right.
|
||||
\def\HEADINGSsingle{
|
||||
%\pagealignmacro
|
||||
\global\pageno=1
|
||||
\global\evenfootline={\hfil}
|
||||
\global\oddfootline={\hfil}
|
||||
\global\evenheadline={\line{\thischapter\hfil\folio}}
|
||||
\global\oddheadline={\line{\thischapter\hfil\folio}}
|
||||
\global\let\contentsalignmacro = \chappager
|
||||
}
|
||||
\def\HEADINGSon{\HEADINGSdouble}
|
||||
|
||||
@@ -1459,6 +1486,7 @@ where each line of input produces a line of output.}
|
||||
\global\oddfootline={\hfil}
|
||||
\global\evenheadline={\line{\folio\hfil\thistitle}}
|
||||
\global\oddheadline={\line{\thischapter\hfil\folio}}
|
||||
\global\let\contentsalignmacro = \chapoddpage
|
||||
}
|
||||
|
||||
\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
|
||||
@@ -1467,6 +1495,7 @@ where each line of input produces a line of output.}
|
||||
\global\oddfootline={\hfil}
|
||||
\global\evenheadline={\line{\thischapter\hfil\folio}}
|
||||
\global\oddheadline={\line{\thischapter\hfil\folio}}
|
||||
\global\let\contentsalignmacro = \chappager
|
||||
}
|
||||
|
||||
% Subroutines used in generating headings
|
||||
@@ -1490,6 +1519,7 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\def\settitle{\parsearg\settitlezzz}
|
||||
\def\settitlezzz #1{\gdef\thistitle{#1}}
|
||||
|
||||
|
||||
\message{tables,}
|
||||
|
||||
% @tabs -- simple alignment
|
||||
@@ -1812,6 +1842,7 @@ July\or August\or September\or October\or November\or December\fi
|
||||
% current hsize to be used for each column. You may use as many
|
||||
% columns as desired.
|
||||
|
||||
|
||||
% Or use a template:
|
||||
% @multitable {Column 1 template} {Column 2 template} {Column 3 template}
|
||||
% @item ...
|
||||
@@ -1832,7 +1863,7 @@ July\or August\or September\or October\or November\or December\fi
|
||||
% with nothing between them for as many times as empty columns are needed,
|
||||
% ie, @tab@tab@tab will produce two empty columns.
|
||||
|
||||
% @item, @tab, @multicolumn or @endmulticolumn do not need to be on their
|
||||
% @item, @tab, @multitable or @end multitable do not need to be on their
|
||||
% own lines, but it will not hurt if they are.
|
||||
|
||||
% Sample multitable:
|
||||
@@ -1856,8 +1887,9 @@ July\or August\or September\or October\or November\or December\fi
|
||||
% @multitableparskip is vertical space between paragraphs in table.
|
||||
% @multitableparindent is paragraph indent in table.
|
||||
% @multitablecolmargin is horizontal space to be left between columns.
|
||||
% @multitablelinespace is space to leave between table items;
|
||||
% 0 means it depends on current normal line spacing.
|
||||
% @multitablelinespace is space to leave between table items, baseline
|
||||
% to baseline.
|
||||
% 0pt means it depends on current normal line spacing.
|
||||
|
||||
%%%%
|
||||
% Dimensions
|
||||
@@ -1936,7 +1968,7 @@ July\or August\or September\or October\or November\or December\fi
|
||||
% \vtop will set a single line and will also let text wrap and
|
||||
% continue for many paragraphs if desired.
|
||||
\halign\bgroup&\global\advance\colcount by 1\relax%
|
||||
\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
|
||||
\multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
|
||||
% In order to keep entries from bumping into each other
|
||||
% we will add a \leftskip of \multitablecolspace to all columns after
|
||||
% the first one.
|
||||
@@ -1958,26 +1990,30 @@ July\or August\or September\or October\or November\or December\fi
|
||||
% In either case we will make \leftskip=\multitablecolspace:
|
||||
\leftskip=\multitablecolspace
|
||||
\fi
|
||||
\noindent##%\par
|
||||
%\vskip\multitablelinespace
|
||||
}\cr%
|
||||
\noindent##}\cr%
|
||||
% \everycr will reset column counter, \colcount, at the end of
|
||||
% each line. Every column entry will cause \colcount to advance by one.
|
||||
% The table preamble
|
||||
% looks at the current \colcount to find the correct column width.
|
||||
\global\everycr{\noalign{\nointerlineskip\vskip\multitablelinespace
|
||||
\global\everycr{\noalign{%
|
||||
\filbreak%% keeps underfull box messages off when table breaks over pages.
|
||||
\global\colcount=0\relax}}}
|
||||
\global\colcount=0\relax}}
|
||||
}
|
||||
|
||||
\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
|
||||
% If so, do nothing. If not, give it an appropriate dimension based on
|
||||
% current baselineskip.
|
||||
\setbox0=\vbox{Xy}
|
||||
\ifdim\multitablelinespace=0pt
|
||||
\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
|
||||
\global\advance\multitablelinespace by-\ht0\fi
|
||||
%% strut to put in table in case some entry doesn't have descenders,
|
||||
%% to keep lines equally spaced
|
||||
\gdef\multistrut{\vrule height\ht0 depth\dp0 width0pt\relax}
|
||||
%% Test to see if parskip is larger than space between lines of
|
||||
%% table. If not, do nothing.
|
||||
%% If so, set to same dimension as multitablelinespace.
|
||||
\else
|
||||
\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
|
||||
width0pt\relax} \fi
|
||||
\ifdim\multitableparskip>\multitablelinespace
|
||||
\global\multitableparskip=\multitablelinespace
|
||||
\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
|
||||
@@ -1988,6 +2024,8 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
|
||||
%% than skip between lines in the table.
|
||||
\fi}
|
||||
|
||||
|
||||
\message{indexing,}
|
||||
% Index generation facilities
|
||||
|
||||
@@ -2276,26 +2314,17 @@ July\or August\or September\or October\or November\or December\fi
|
||||
|
||||
\def\printindex{\parsearg\doprintindex}
|
||||
|
||||
\def\doprintindex#1{%
|
||||
\tex
|
||||
\dobreak \chapheadingskip {10000}
|
||||
\catcode`\%=\other\catcode`\&=\other\catcode`\#=\other
|
||||
\catcode`\$=\other
|
||||
\catcode`\~=\other
|
||||
\indexbreaks
|
||||
\def\doprintindex#1{\begingroup
|
||||
\dobreak \chapheadingskip{10000}%
|
||||
%
|
||||
% The following don't help, since the chars were translated
|
||||
% when the raw index was written, and their fonts were discarded
|
||||
% due to \indexnofonts.
|
||||
%\catcode`\"=\active
|
||||
%\catcode`\^=\active
|
||||
%\catcode`\_=\active
|
||||
%\catcode`\|=\active
|
||||
%\catcode`\<=\active
|
||||
%\catcode`\>=\active
|
||||
% %
|
||||
\def\indexbackslash{\rawbackslashxx}
|
||||
\indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt
|
||||
\indexfonts \rm
|
||||
\tolerance = 9500
|
||||
\indexbreaks
|
||||
\def\indexbackslash{\rawbackslashxx}%
|
||||
% Index files are almost Texinfo source, but we use \ as the escape
|
||||
% character. It would be better to use @, but that's too big a change
|
||||
% to make right now.
|
||||
\catcode`\\ = 0
|
||||
\begindoublecolumns
|
||||
%
|
||||
% See if the index file exists and is nonempty.
|
||||
@@ -2306,7 +2335,7 @@ July\or August\or September\or October\or November\or December\fi
|
||||
% index. The easiest way to prevent this problem is to make sure
|
||||
% there is some text.
|
||||
(Index is nonexistent)
|
||||
\else
|
||||
\else
|
||||
%
|
||||
% If the index file exists but is empty, then \openin leaves \ifeof
|
||||
% false. We have to make TeX try to read something from the file, so
|
||||
@@ -2320,8 +2349,7 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\fi
|
||||
\closein 1
|
||||
\enddoublecolumns
|
||||
\Etex
|
||||
}
|
||||
\endgroup}
|
||||
|
||||
% These macros are used by the sorted index file itself.
|
||||
% Change them to control the appearance of the index.
|
||||
@@ -2496,8 +2524,9 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\fi
|
||||
\fi
|
||||
}
|
||||
|
||||
\catcode `\@=\other
|
||||
|
||||
|
||||
\message{sectioning,}
|
||||
% Define chapters, sections, etc.
|
||||
|
||||
@@ -2669,6 +2698,10 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\global\let\subsubsection = \appendixsubsubsec
|
||||
}}
|
||||
|
||||
% @centerchap is like @unnumbered, but the heading is centered.
|
||||
\outer\def\centerchap{\parsearg\centerchapyyy}
|
||||
\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
|
||||
|
||||
\outer\def\top{\parsearg\unnumberedyyy}
|
||||
\outer\def\unnumbered{\parsearg\unnumberedyyy}
|
||||
\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
|
||||
@@ -2771,7 +2804,7 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
|
||||
\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
|
||||
\def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
|
||||
\plainsecheading {#1}\gdef\thissection{#1}%
|
||||
\plainsubsecheading {#1}\gdef\thissection{#1}%
|
||||
{\chapternofonts%
|
||||
\edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
|
||||
\escapechar=`\\%
|
||||
@@ -2816,7 +2849,7 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
|
||||
\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
|
||||
\def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
|
||||
\plainsecheading {#1}\gdef\thissection{#1}%
|
||||
\plainsubsubsecheading {#1}\gdef\thissection{#1}%
|
||||
{\chapternofonts%
|
||||
\edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
|
||||
\escapechar=`\\%
|
||||
@@ -2875,11 +2908,10 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\parindent=0pt\raggedright
|
||||
\rm #1\hfill}}\bigskip \par\penalty 200}
|
||||
|
||||
\def\heading{\parsearg\secheadingi}
|
||||
|
||||
\def\subheading{\parsearg\subsecheadingi}
|
||||
|
||||
\def\subsubheading{\parsearg\subsubsecheadingi}
|
||||
% @heading, @subheading, @subsubheading.
|
||||
\def\heading{\parsearg\plainsecheading}
|
||||
\def\subheading{\parsearg\plainsubsecheading}
|
||||
\def\subsubheading{\parsearg\plainsubsubsecheading}
|
||||
|
||||
% These macros generate a chapter, section, etc. heading only
|
||||
% (including whitespace, linebreaking, etc. around it),
|
||||
@@ -2893,7 +2925,7 @@ July\or August\or September\or October\or November\or December\fi
|
||||
%%% Define plain chapter starts, and page on/off switching for it
|
||||
% Parameter controlling skip before chapter headings (if needed)
|
||||
|
||||
\newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt
|
||||
\newskip\chapheadingskip
|
||||
|
||||
\def\chapbreak{\dobreak \chapheadingskip {-4000}}
|
||||
\def\chappager{\par\vfill\supereject}
|
||||
@@ -2902,15 +2934,18 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
|
||||
|
||||
\def\CHAPPAGoff{
|
||||
\global\let\contentsalignmacro = \chappager
|
||||
\global\let\pchapsepmacro=\chapbreak
|
||||
\global\let\pagealignmacro=\chappager}
|
||||
|
||||
\def\CHAPPAGon{
|
||||
\global\let\contentsalignmacro = \chappager
|
||||
\global\let\pchapsepmacro=\chappager
|
||||
\global\let\pagealignmacro=\chappager
|
||||
\global\def\HEADINGSon{\HEADINGSsingle}}
|
||||
|
||||
\def\CHAPPAGodd{
|
||||
\global\let\contentsalignmacro = \chapoddpage
|
||||
\global\let\pchapsepmacro=\chapoddpage
|
||||
\global\let\pagealignmacro=\chapoddpage
|
||||
\global\def\HEADINGSon{\HEADINGSdouble}}
|
||||
@@ -2919,25 +2954,39 @@ July\or August\or September\or October\or November\or December\fi
|
||||
|
||||
\def\CHAPFplain{
|
||||
\global\let\chapmacro=\chfplain
|
||||
\global\let\unnumbchapmacro=\unnchfplain}
|
||||
\global\let\unnumbchapmacro=\unnchfplain
|
||||
\global\let\centerchapmacro=\centerchfplain}
|
||||
|
||||
\def\chfplain #1#2{%
|
||||
% Plain chapter opening.
|
||||
% #1 is the text, #2 the chapter number or empty if unnumbered.
|
||||
\def\chfplain#1#2{%
|
||||
\pchapsepmacro
|
||||
{%
|
||||
\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
|
||||
\parindent=0pt\raggedright
|
||||
\rm #2\enspace #1}%
|
||||
\chapfonts \rm
|
||||
\def\chapnum{#2}%
|
||||
\setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
|
||||
\vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
|
||||
\hangindent = \wd0 \centerparametersmaybe
|
||||
\unhbox0 #1\par}%
|
||||
}%
|
||||
\bigskip
|
||||
\penalty5000
|
||||
\nobreak\bigskip % no page break after a chapter title
|
||||
\nobreak
|
||||
}
|
||||
|
||||
\def\unnchfplain #1{%
|
||||
\pchapsepmacro %
|
||||
{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
|
||||
\parindent=0pt\raggedright
|
||||
\rm #1\hfill}}\bigskip \par\penalty 10000 %
|
||||
}
|
||||
% Plain opening for unnumbered.
|
||||
\def\unnchfplain#1{\chfplain{#1}{}}
|
||||
|
||||
% @centerchap -- centered and unnumbered.
|
||||
\let\centerparametersmaybe = \relax
|
||||
\def\centerchfplain#1{{%
|
||||
\def\centerparametersmaybe{%
|
||||
\advance\rightskip by 3\rightskip
|
||||
\leftskip = \rightskip
|
||||
\parfillskip = 0pt
|
||||
}%
|
||||
\chfplain{#1}{}%
|
||||
}}
|
||||
|
||||
\CHAPFplain % The default
|
||||
|
||||
\def\unnchfopen #1{%
|
||||
@@ -2951,65 +3000,73 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\par\penalty 5000 %
|
||||
}
|
||||
|
||||
\def\centerchfopen #1{%
|
||||
\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
|
||||
\parindent=0pt
|
||||
\hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 %
|
||||
}
|
||||
|
||||
\def\CHAPFopen{
|
||||
\global\let\chapmacro=\chfopen
|
||||
\global\let\unnumbchapmacro=\unnchfopen}
|
||||
\global\let\unnumbchapmacro=\unnchfopen
|
||||
\global\let\centerchapmacro=\centerchfopen}
|
||||
|
||||
% Parameter controlling skip before section headings.
|
||||
|
||||
\newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt
|
||||
\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
|
||||
|
||||
\newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt
|
||||
% Section titles.
|
||||
\newskip\secheadingskip
|
||||
\def\secheadingbreak{\dobreak \secheadingskip {-1000}}
|
||||
\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}}
|
||||
\def\plainsecheading#1{\sectionheading{sec}{}{#1}}
|
||||
|
||||
% @paragraphindent is defined for the Info formatting commands only.
|
||||
\let\paragraphindent=\comment
|
||||
% Subsection titles.
|
||||
\newskip \subsecheadingskip
|
||||
\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
|
||||
\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
|
||||
\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}}
|
||||
|
||||
% Section fonts are the base font at magstep2, which produces
|
||||
% a size a bit more than 14 points in the default situation.
|
||||
|
||||
\def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}}
|
||||
\def\plainsecheading #1{\secheadingi {#1}}
|
||||
\def\secheadingi #1{{\advance \secheadingskip by \parskip %
|
||||
\secheadingbreak}%
|
||||
{\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000
|
||||
\parindent=0pt\raggedright
|
||||
\rm #1\hfill}}%
|
||||
\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
|
||||
% Subsubsection titles.
|
||||
\let\subsubsecheadingskip = \subsecheadingskip
|
||||
\let\subsubsecheadingbreak = \subsecheadingbreak
|
||||
\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
|
||||
\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}}
|
||||
|
||||
|
||||
% Subsection fonts are the base font at magstep1,
|
||||
% which produces a size of 12 points.
|
||||
|
||||
\def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}}
|
||||
\def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip %
|
||||
\subsecheadingbreak}%
|
||||
{\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
|
||||
\parindent=0pt\raggedright
|
||||
\rm #1\hfill}}%
|
||||
\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
|
||||
|
||||
\def\subsubsecfonts{\subsecfonts} % Maybe this should change:
|
||||
% Perhaps make sssec fonts scaled
|
||||
% magstep half
|
||||
\def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}}
|
||||
\def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip %
|
||||
\subsecheadingbreak}%
|
||||
{\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
|
||||
\parindent=0pt\raggedright
|
||||
\rm #1\hfill}}%
|
||||
\ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000}
|
||||
% Print any size section title.
|
||||
%
|
||||
% #1 is the section type (sec/subsec/subsubsec), #2 is the section
|
||||
% number (maybe empty), #3 the text.
|
||||
\def\sectionheading#1#2#3{%
|
||||
{%
|
||||
\expandafter\advance\csname #1headingskip\endcsname by \parskip
|
||||
\csname #1headingbreak\endcsname
|
||||
}%
|
||||
{%
|
||||
% Switch to the right set of fonts.
|
||||
\csname #1fonts\endcsname \rm
|
||||
%
|
||||
% Only insert the separating space if we have a section number.
|
||||
\def\secnum{#2}%
|
||||
\setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
|
||||
%
|
||||
\vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
|
||||
\hangindent = \wd0 % zero if no section number
|
||||
\unhbox0 #3}%
|
||||
}%
|
||||
\ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
|
||||
}
|
||||
|
||||
|
||||
\message{toc printing,}
|
||||
|
||||
% Finish up the main text and prepare to read what we've written
|
||||
% to \contentsfile.
|
||||
|
||||
\newskip\contentsrightmargin \contentsrightmargin=1in
|
||||
\def\startcontents#1{%
|
||||
\pagealignmacro
|
||||
% If @setchapternewpage on, and @headings double, the contents should
|
||||
% start on an odd page, unlike chapters. Thus, we maintain
|
||||
% \contentsalignmacro in parallel with \pagealignmacro.
|
||||
% From: Torbjorn Granlund <tege@matematik.su.se>
|
||||
\contentsalignmacro
|
||||
\immediate\closeout \contentsfile
|
||||
\ifnum \pageno>0
|
||||
\pageno = -1 % Request roman numbered pages.
|
||||
@@ -3184,12 +3241,11 @@ July\or August\or September\or October\or November\or December\fi
|
||||
% depth .1ex\hfil}
|
||||
%}
|
||||
|
||||
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
|
||||
\def\point{$\star$}
|
||||
|
||||
\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
|
||||
\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
|
||||
\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
|
||||
|
||||
\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
|
||||
|
||||
% Adapted from the TeXbook's \boxit.
|
||||
@@ -3235,6 +3291,8 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\let\.=\ptexdot
|
||||
\let\*=\ptexstar
|
||||
\let\dots=\ptexdots
|
||||
\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}
|
||||
\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}
|
||||
\def\@{@}%
|
||||
\let\bullet=\ptexbullet
|
||||
\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl
|
||||
@@ -3403,8 +3461,7 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\let\Esmalllisp = \nonfillfinish
|
||||
\let\Esmallexample = \nonfillfinish
|
||||
%
|
||||
% Smaller interline space and fonts for small examples.
|
||||
\setleading{10pt}%
|
||||
% Smaller fonts for small examples.
|
||||
\indexfonts \tt
|
||||
\rawbackslash % make \ output the \ character from the current font (tt)
|
||||
\gobble
|
||||
@@ -3932,6 +3989,7 @@ July\or August\or September\or October\or November\or December\fi
|
||||
|
||||
\def\deftpx #1 {\errmessage{@deftpx in invalid context}}
|
||||
|
||||
|
||||
\message{cross reference,}
|
||||
% Define cross-reference macros
|
||||
\newwrite \auxfile
|
||||
@@ -3939,6 +3997,11 @@ July\or August\or September\or October\or November\or December\fi
|
||||
\newif\ifhavexrefs % True if xref values are known.
|
||||
\newif\ifwarnedxrefs % True if we warned once that they aren't known.
|
||||
|
||||
% @inforef is simple.
|
||||
\def\inforef #1{\inforefzzz #1,,,,**}
|
||||
\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
|
||||
node \samp{\ignorespaces#1{}}}
|
||||
|
||||
% \setref{foo} defines a cross-reference point named foo.
|
||||
|
||||
\def\setref#1{%
|
||||
@@ -4174,7 +4237,8 @@ July\or August\or September\or October\or November\or December\fi
|
||||
% The trailing space in the following definition for supereject is
|
||||
% vital for proper filling; pages come out unaligned when you do a
|
||||
% pagealignmacro call if that space before the closing brace is
|
||||
% removed.
|
||||
% removed. (Generally, numeric constants should always be followed by a
|
||||
% space to prevent strange expansion errors.)
|
||||
\def\supereject{\par\penalty -20000\footnoteno =0 }
|
||||
|
||||
% @footnotestyle is meaningful for info output only..
|
||||
@@ -4299,13 +4363,18 @@ July\or August\or September\or October\or November\or December\fi
|
||||
|
||||
% Set some numeric style parameters, for 8.5 x 11 format.
|
||||
|
||||
%\hsize = 6.5in
|
||||
\hsize = 6in
|
||||
\hoffset = .25in
|
||||
\newdimen\defaultparindent \defaultparindent = 15pt
|
||||
\parindent = \defaultparindent
|
||||
\parskip 18pt plus 1pt
|
||||
\setleading{15pt}
|
||||
\parskip 3pt plus 2pt minus 1pt
|
||||
\setleading{13.2pt}
|
||||
\advance\topskip by 1.2cm
|
||||
|
||||
\chapheadingskip = 15pt plus 4pt minus 2pt
|
||||
\secheadingskip = 12pt plus 3pt minus 2pt
|
||||
\subsecheadingskip = 9pt plus 2pt minus 2pt
|
||||
|
||||
% Prevent underfull vbox error messages.
|
||||
\vbadness=10000
|
||||
|
||||
@@ -4328,30 +4397,28 @@ July\or August\or September\or October\or November\or December\fi
|
||||
|
||||
% Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
|
||||
\def\smallbook{
|
||||
|
||||
% These values for secheadingskip and subsecheadingskip are
|
||||
% experiments. RJC 7 Aug 1992
|
||||
\global\secheadingskip = 17pt plus 6pt minus 3pt
|
||||
\global\subsecheadingskip = 14pt plus 6pt minus 3pt
|
||||
|
||||
\global\lispnarrowing = 0.3in
|
||||
\setleading{12pt}
|
||||
\advance\topskip by -1cm
|
||||
\global\parskip 3pt plus 1pt
|
||||
\global\hsize = 5in
|
||||
\global\vsize=7.5in
|
||||
\global\tolerance=700
|
||||
\global\hfuzz=1pt
|
||||
\global\contentsrightmargin=0pt
|
||||
\global\deftypemargin=0pt
|
||||
\global\defbodyindent=.5cm
|
||||
|
||||
\global\pagewidth=\hsize
|
||||
\global\pageheight=\vsize
|
||||
|
||||
\global\let\smalllisp=\smalllispx
|
||||
\global\let\smallexample=\smalllispx
|
||||
\global\def\Esmallexample{\Esmalllisp}
|
||||
\global\chapheadingskip = 15pt plus 4pt minus 2pt
|
||||
\global\secheadingskip = 12pt plus 3pt minus 2pt
|
||||
\global\subsecheadingskip = 9pt plus 2pt minus 2pt
|
||||
%
|
||||
\global\lispnarrowing = 0.3in
|
||||
\setleading{12pt}
|
||||
\advance\topskip by -1cm
|
||||
\global\parskip 2pt plus 1pt
|
||||
\global\hsize = 5in
|
||||
\global\vsize=7.5in
|
||||
\global\tolerance=700
|
||||
\global\hfuzz=1pt
|
||||
\global\contentsrightmargin=0pt
|
||||
\global\deftypemargin=0pt
|
||||
\global\defbodyindent=.5cm
|
||||
%
|
||||
\global\pagewidth=\hsize
|
||||
\global\pageheight=\vsize
|
||||
%
|
||||
\global\let\smalllisp=\smalllispx
|
||||
\global\let\smallexample=\smalllispx
|
||||
\global\def\Esmallexample{\Esmalllisp}
|
||||
}
|
||||
|
||||
% Use @afourpaper to print on European A4 paper.
|
||||
|
||||
@@ -1572,7 +1572,6 @@ consistent. Synopsis:
|
||||
@example
|
||||
md5sum [@var{option}]@dots{} [@var{file}]@dots{}
|
||||
md5sum [@var{option}]@dots{} --check [@var{file}]
|
||||
md5sum [@var{option}]@dots{} --string=@var{string} @dots{}
|
||||
@end example
|
||||
|
||||
For each @var{file}, @samp{md5sum} outputs the MD5 checksum, a flag
|
||||
@@ -1629,11 +1628,6 @@ If all listed files are readable and are consistent with the associated
|
||||
MD5 checksums, exit successfully. Otherwise exit with a status code
|
||||
indicating there was a failure.
|
||||
|
||||
@itemx --string=@var{string}
|
||||
@opindex --string
|
||||
Compute the message digest for @var{string}, instead of for a file. The
|
||||
result is the same as for a file that contains exactly @var{string}.
|
||||
|
||||
@item -t
|
||||
@itemx --text
|
||||
@opindex -t
|
||||
@@ -1904,11 +1898,8 @@ appended to it, in which case the global ordering options are not used
|
||||
for that particular field. The @samp{-b} option may be independently
|
||||
attached to either or both of the @samp{+@var{pos}} and
|
||||
@samp{-@var{pos}} parts of a field specification, and if it is inherited
|
||||
from the global options it will be attached to both. If a @samp{-n} or
|
||||
@samp{-M} option is used, thus implying a @samp{-b} option, the
|
||||
@samp{-b} option is taken to apply to both the @samp{+@var{pos}} and the
|
||||
@samp{-@var{pos}} parts of a key specification. Keys may span multiple
|
||||
fields.
|
||||
from the global options it will be attached to both.
|
||||
Keys may span multiple fields.
|
||||
|
||||
Here are some examples to illustrate various combinations of options.
|
||||
In them, the @sc{POSIX} @samp{-k} option is used to specify sort keys rather
|
||||
|
||||
@@ -2,14 +2,16 @@
|
||||
noinst_LIBRARIES = fu
|
||||
|
||||
EXTRA_DIST = alloca.c basename.c error.c euidaccess.c fnmatch.c fsusage.c \
|
||||
ftruncate.c getdate.y getopt.c getopt1.c group-member.c \
|
||||
memcmp.c memcpy.c memset.c \
|
||||
mkdir.c mktime.c mountlist.c obstack.c posixtm.y rename.c rmdir.c rpmatch.c \
|
||||
ftruncate.c getdate.y group-member.c memcmp.c memcpy.c memset.c \
|
||||
mkdir.c mktime.c mountlist.c obstack.c posixtm.y regex.c rx.c \
|
||||
rename.c rmdir.c rpmatch.c \
|
||||
stpcpy.c strcasecmp.c strdup.c strndup.c strstr.c strtol.c strtoul.c
|
||||
|
||||
INCLUDES = -I.. -I$(srcdir)
|
||||
INCLUDES = -I.. -I$(srcdir) -I../intl
|
||||
|
||||
fu_SOURCES = getdate.c getline.c posixtm.c argmatch.c backupfile.c \
|
||||
fu_SOURCES = getdate.c getline.c getopt.c getopt1.c posixtm.c \
|
||||
argmatch.c backupfile.c \
|
||||
dirname.c fileblocks.c filemode.c \
|
||||
full-write.c getversion.c idcache.c \
|
||||
isdir.c long-options.c makepath.c modechange.c path-concat.c \
|
||||
@@ -20,7 +22,8 @@ fu_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
|
||||
noinst_HEADERS = argmatch.h backupfile.h error.h fnmatch.h fsusage.h \
|
||||
getline.h getopt.h group-member.h long-options.h makepath.h modechange.h \
|
||||
mountlist.h obstack.h path-concat.h pathmax.h save-cwd.h xstrtol.h xstrtoul.h
|
||||
mountlist.h obstack.h path-concat.h pathmax.h regex.h rx.h \
|
||||
save-cwd.h xstrtol.h xstrtoul.h
|
||||
|
||||
BUILT_SOURCES = getdate.c posixtm.c
|
||||
|
||||
|
||||
109
lib/Makefile.in
109
lib/Makefile.in
@@ -1,4 +1,4 @@
|
||||
# Makefile.in generated automatically by automake 1.1c from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.1e from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
@@ -41,14 +41,16 @@ transform = @program_transform_name@
|
||||
noinst_LIBRARIES = fu
|
||||
|
||||
EXTRA_DIST = alloca.c basename.c error.c euidaccess.c fnmatch.c fsusage.c \
|
||||
ftruncate.c getdate.y getopt.c getopt1.c group-member.c \
|
||||
memcmp.c memcpy.c memset.c \
|
||||
mkdir.c mktime.c mountlist.c obstack.c posixtm.y rename.c rmdir.c rpmatch.c \
|
||||
ftruncate.c getdate.y group-member.c memcmp.c memcpy.c memset.c \
|
||||
mkdir.c mktime.c mountlist.c obstack.c posixtm.y regex.c rx.c \
|
||||
rename.c rmdir.c rpmatch.c \
|
||||
stpcpy.c strcasecmp.c strdup.c strndup.c strstr.c strtol.c strtoul.c
|
||||
|
||||
INCLUDES = -I.. -I$(srcdir)
|
||||
INCLUDES = -I.. -I$(srcdir) -I../intl
|
||||
|
||||
fu_SOURCES = getdate.c getline.c posixtm.c argmatch.c backupfile.c \
|
||||
fu_SOURCES = getdate.c getline.c getopt.c getopt1.c posixtm.c \
|
||||
argmatch.c backupfile.c \
|
||||
dirname.c fileblocks.c filemode.c \
|
||||
full-write.c getversion.c idcache.c \
|
||||
isdir.c long-options.c makepath.c modechange.c path-concat.c \
|
||||
@@ -59,7 +61,8 @@ fu_LIBADD = @LIBOBJS@ @ALLOCA@
|
||||
|
||||
noinst_HEADERS = argmatch.h backupfile.h error.h fnmatch.h fsusage.h \
|
||||
getline.h getopt.h group-member.h long-options.h makepath.h modechange.h \
|
||||
mountlist.h obstack.h path-concat.h pathmax.h save-cwd.h xstrtol.h xstrtoul.h
|
||||
mountlist.h obstack.h path-concat.h pathmax.h regex.h rx.h \
|
||||
save-cwd.h xstrtol.h xstrtoul.h
|
||||
|
||||
BUILT_SOURCES = getdate.c posixtm.c
|
||||
mkinstalldirs = $(top_srcdir)/mkinstalldirs
|
||||
@@ -74,13 +77,14 @@ CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
fu_DEPENDENCIES = @LIBOBJS@ @ALLOCA@
|
||||
fu_OBJECTS = getdate.o getline.o posixtm.o argmatch.o backupfile.o \
|
||||
dirname.o fileblocks.o filemode.o full-write.o getversion.o idcache.o \
|
||||
isdir.o long-options.o makepath.o modechange.o path-concat.o \
|
||||
safe-read.o save-cwd.o savedir.o stripslash.o userspec.o xgetcwd.o \
|
||||
xmalloc.o xstrdup.o xstrtol.o xstrtoul.o yesno.o
|
||||
fu_OBJECTS = getdate.o getline.o getopt.o getopt1.o posixtm.o argmatch.o \
|
||||
backupfile.o dirname.o fileblocks.o filemode.o full-write.o \
|
||||
getversion.o idcache.o isdir.o long-options.o makepath.o modechange.o \
|
||||
path-concat.o safe-read.o save-cwd.o savedir.o stripslash.o userspec.o \
|
||||
xgetcwd.o xmalloc.o xstrdup.o xstrtol.o xstrtoul.o yesno.o
|
||||
EXTRA_fu_SOURCES =
|
||||
LIBFILES = libfu.a
|
||||
LIBFILES = $(pkglib_LIBFILES) $(noinst_LIBFILES) $(check_LIBFILES) \
|
||||
$(lib_LIBFILES)
|
||||
AR = ar
|
||||
RANLIB = @RANLIB@
|
||||
CC = @CC@
|
||||
@@ -89,7 +93,9 @@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
LINK = $(CC) $(LDFLAGS) -o $@
|
||||
HEADERS = $(noinst_HEADERS)
|
||||
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
DIST_COMMON = Makefile.am Makefile.in alloca.c error.c fileblocks.c \
|
||||
fnmatch.c fsusage.c ftruncate.c getline.c mountlist.c obstack.c regex.c \
|
||||
regex.h rx.c rx.h
|
||||
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
@@ -101,24 +107,16 @@ DEP_DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
|
||||
$(TEXINFOS) $(INFO_DEPS) $(MANS) $(EXTRA_DIST) $(DATA)
|
||||
|
||||
TAR = tar
|
||||
DEP_FILES = $(srcdir)/.deps/alloca.P $(srcdir)/.deps/argmatch.P \
|
||||
$(srcdir)/.deps/backupfile.P $(srcdir)/.deps/dirname.P \
|
||||
$(srcdir)/.deps/error.P $(srcdir)/.deps/fileblocks.P \
|
||||
$(srcdir)/.deps/filemode.P $(srcdir)/.deps/fnmatch.P \
|
||||
$(srcdir)/.deps/fsusage.P $(srcdir)/.deps/ftruncate.P \
|
||||
$(srcdir)/.deps/full-write.P $(srcdir)/.deps/getdate.P \
|
||||
$(srcdir)/.deps/getline.P $(srcdir)/.deps/getopt.P \
|
||||
$(srcdir)/.deps/getopt1.P $(srcdir)/.deps/getversion.P \
|
||||
$(srcdir)/.deps/idcache.P $(srcdir)/.deps/isdir.P \
|
||||
$(srcdir)/.deps/long-options.P $(srcdir)/.deps/makepath.P \
|
||||
$(srcdir)/.deps/modechange.P $(srcdir)/.deps/mountlist.P \
|
||||
$(srcdir)/.deps/obstack.P $(srcdir)/.deps/path-concat.P \
|
||||
$(srcdir)/.deps/posixtm.P $(srcdir)/.deps/safe-read.P \
|
||||
$(srcdir)/.deps/save-cwd.P $(srcdir)/.deps/savedir.P \
|
||||
$(srcdir)/.deps/stripslash.P $(srcdir)/.deps/userspec.P \
|
||||
$(srcdir)/.deps/xgetcwd.P $(srcdir)/.deps/xmalloc.P \
|
||||
$(srcdir)/.deps/xstrdup.P $(srcdir)/.deps/xstrtol.P \
|
||||
$(srcdir)/.deps/xstrtoul.P $(srcdir)/.deps/yesno.P
|
||||
DEP_FILES = .deps/alloca.P .deps/argmatch.P .deps/backupfile.P \
|
||||
.deps/dirname.P .deps/error.P .deps/fileblocks.P .deps/filemode.P \
|
||||
.deps/fnmatch.P .deps/fsusage.P .deps/ftruncate.P .deps/full-write.P \
|
||||
.deps/getdate.P .deps/getline.P .deps/getopt.P .deps/getopt1.P \
|
||||
.deps/getversion.P .deps/idcache.P .deps/isdir.P .deps/long-options.P \
|
||||
.deps/makepath.P .deps/modechange.P .deps/mountlist.P .deps/obstack.P \
|
||||
.deps/path-concat.P .deps/posixtm.P .deps/regex.P .deps/rx.P \
|
||||
.deps/safe-read.P .deps/save-cwd.P .deps/savedir.P .deps/stripslash.P \
|
||||
.deps/userspec.P .deps/xgetcwd.P .deps/xmalloc.P .deps/xstrdup.P \
|
||||
.deps/xstrtol.P .deps/xstrtoul.P .deps/yesno.P
|
||||
SOURCES = $(fu_SOURCES)
|
||||
OBJECTS = $(fu_OBJECTS)
|
||||
|
||||
@@ -172,9 +170,9 @@ mostlyclean-tags:
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
rm -f TAGS ID
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
@@ -186,21 +184,28 @@ distdir: $(DEP_DISTFILES)
|
||||
|| cp -p $(srcdir)/$$file $(distdir)/$$file; \
|
||||
done
|
||||
|
||||
MKDEP = gcc -MM $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
MKDEP = gcc -M $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
|
||||
-include $(srcdir)/.deps/.P
|
||||
$(srcdir)/.deps/.P: $(BUILT_SOURCES)
|
||||
cd $(srcdir) && test -d .deps || mkdir .deps
|
||||
-include .deps/.P
|
||||
.deps/.P: $(BUILT_SOURCES)
|
||||
test -d .deps || mkdir .deps
|
||||
echo > $@
|
||||
|
||||
-include $(DEP_FILES)
|
||||
$(DEP_FILES): $(srcdir)/.deps/.P
|
||||
$(DEP_FILES): .deps/.P
|
||||
|
||||
$(srcdir)/.deps/%.P: $(srcdir)/%.c
|
||||
@echo "mkdeps $< > $@"
|
||||
@re=`echo 's,^$(srcdir)//*,,g;s, $(srcdir)//*, ,g' | sed 's,\.,\\\\.,g'`; \
|
||||
$(MKDEP) $< | sed "$$re" > $@-tmp
|
||||
@if test -n "$o"; then \
|
||||
mostlyclean-depend:
|
||||
|
||||
clean-depend:
|
||||
|
||||
distclean-depend:
|
||||
|
||||
maintainer-clean-depend:
|
||||
rm -rf .deps
|
||||
|
||||
.deps/%.P: $(srcdir)/%.c
|
||||
$(MKDEP) $< > $@-tmp
|
||||
if test -n "$o"; then \
|
||||
sed 's/\.o:/$$o:/' $@-tmp > $@; \
|
||||
rm $@-tmp; \
|
||||
else \
|
||||
@@ -215,8 +220,10 @@ check: all
|
||||
installcheck:
|
||||
|
||||
install-exec:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install-data:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install: install-exec install-data all
|
||||
@:
|
||||
@@ -245,18 +252,19 @@ maintainer-clean-generic:
|
||||
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean: mostlyclean-noinstLIBRARIES mostlyclean-compile \
|
||||
mostlyclean-tags mostlyclean-generic
|
||||
mostlyclean-tags mostlyclean-depend mostlyclean-generic
|
||||
|
||||
clean: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \
|
||||
mostlyclean
|
||||
clean: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
|
||||
clean-generic mostlyclean
|
||||
|
||||
distclean: distclean-noinstLIBRARIES distclean-compile distclean-tags \
|
||||
distclean-generic clean
|
||||
distclean-depend distclean-generic clean
|
||||
rm -f config.status
|
||||
|
||||
maintainer-clean: maintainer-clean-noinstLIBRARIES \
|
||||
maintainer-clean-compile maintainer-clean-tags \
|
||||
maintainer-clean-generic distclean
|
||||
maintainer-clean-depend maintainer-clean-generic \
|
||||
distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
@@ -264,9 +272,10 @@ maintainer-clean: maintainer-clean-noinstLIBRARIES \
|
||||
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
|
||||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile tags mostlyclean-tags distclean-tags \
|
||||
clean-tags maintainer-clean-tags distdir info dvi check installcheck \
|
||||
install-exec install-data install uninstall all installdirs \
|
||||
mostlyclean-generic distclean-generic clean-generic \
|
||||
clean-tags maintainer-clean-tags distdir mostlyclean-depend \
|
||||
distclean-depend clean-depend maintainer-clean-depend info dvi check \
|
||||
installcheck install-exec install-data install uninstall all \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
/* Written by David MacKenzie <djm@ai.mit.edu> */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef STDC_HEADERS
|
||||
#include <string.h>
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
extern char *program_name;
|
||||
|
||||
@@ -34,6 +34,17 @@
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#if defined (STDC_HEADERS) || !defined (isascii)
|
||||
# define ISASCII(c) 1
|
||||
#else
|
||||
# define ISASCII(c) isascii(c)
|
||||
#endif
|
||||
|
||||
#define ISSPACE(c) (ISASCII (c) && isspace (c))
|
||||
#define ISALPHA(c) (ISASCII (c) && isalpha (c))
|
||||
#define ISUPPER(c) (ISASCII (c) && isupper (c))
|
||||
#define ISDIGIT(c) (ISASCII (c) && isdigit (c))
|
||||
|
||||
#if defined (vms)
|
||||
#include <types.h>
|
||||
#include <time.h>
|
||||
@@ -710,7 +721,7 @@ LookupWord (buff)
|
||||
|
||||
/* Make it lowercase. */
|
||||
for (p = buff; *p; p++)
|
||||
if (isupper (*p))
|
||||
if (ISUPPER (*p))
|
||||
*p = tolower (*p);
|
||||
|
||||
if (strcmp (buff, "am") == 0 || strcmp (buff, "a.m.") == 0) {
|
||||
@@ -779,7 +790,7 @@ LookupWord (buff)
|
||||
}
|
||||
|
||||
/* Military timezones. */
|
||||
if (buff[1] == '\0' && isalpha (*buff)) {
|
||||
if (buff[1] == '\0' && ISALPHA (*buff)) {
|
||||
for (tp = MilitaryTable; tp->name; tp++)
|
||||
if (strcmp (buff, tp->name) == 0) {
|
||||
yylval.Number = tp->value;
|
||||
@@ -815,27 +826,27 @@ yylex ()
|
||||
int sign;
|
||||
|
||||
for ( ; ; ) {
|
||||
while (isspace (*yyInput))
|
||||
while (ISSPACE (*yyInput))
|
||||
yyInput++;
|
||||
|
||||
if (isdigit (c = *yyInput) || c == '-' || c == '+') {
|
||||
if (ISDIGIT (c = *yyInput) || c == '-' || c == '+') {
|
||||
if (c == '-' || c == '+') {
|
||||
sign = c == '-' ? -1 : 1;
|
||||
if (!isdigit (*++yyInput))
|
||||
if (!ISDIGIT (*++yyInput))
|
||||
/* skip the '-' sign */
|
||||
continue;
|
||||
}
|
||||
else
|
||||
sign = 0;
|
||||
for (yylval.Number = 0; isdigit (c = *yyInput++); )
|
||||
for (yylval.Number = 0; ISDIGIT (c = *yyInput++); )
|
||||
yylval.Number = 10 * yylval.Number + c - '0';
|
||||
yyInput--;
|
||||
if (sign < 0)
|
||||
yylval.Number = -yylval.Number;
|
||||
return sign ? tSNUMBER : tUNUMBER;
|
||||
}
|
||||
if (isalpha (c)) {
|
||||
for (p = buff; isalpha (c = *yyInput++) || c == '.'; )
|
||||
if (ISALPHA (c)) {
|
||||
for (p = buff; ISALPHA (c = *yyInput++) || c == '.'; )
|
||||
if (p < &buff[sizeof buff - 1])
|
||||
*p++ = c;
|
||||
*p = '\0';
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
DGUX
|
||||
eunice UNIX emulator under VMS.
|
||||
hpux
|
||||
MSDOS No-op for MSDOS.
|
||||
NeXT
|
||||
sgi
|
||||
sequent Sequent Dynix 3.x.x (BSD)
|
||||
@@ -51,6 +52,7 @@
|
||||
UMAX
|
||||
UMAX4_3
|
||||
VMS
|
||||
WIN32 No-op for Windows95/NT.
|
||||
__linux__ Linux: assumes /proc filesystem mounted.
|
||||
Support from Michael K. Johnson.
|
||||
__NetBSD__ NetBSD: assumes /kern filesystem mounted.
|
||||
@@ -139,7 +141,7 @@ extern int errno;
|
||||
#define decstation
|
||||
#endif
|
||||
|
||||
#if (defined(sun) || defined(__sun)) && defined(SVR4)
|
||||
#if (defined(sun) && defined(SVR4)) || defined (SOLARIS2)
|
||||
#define SUNOS_5
|
||||
#endif
|
||||
|
||||
@@ -168,7 +170,7 @@ extern int errno;
|
||||
#define LOAD_AVE_TYPE long
|
||||
#endif
|
||||
|
||||
#if defined(sun) || defined(__sun)
|
||||
#ifdef sun
|
||||
#define LOAD_AVE_TYPE long
|
||||
#endif
|
||||
|
||||
@@ -284,7 +286,7 @@ extern int errno;
|
||||
#define NLIST_STRUCT
|
||||
#endif
|
||||
|
||||
#if defined(sun) || defined(__sun)
|
||||
#ifdef sun
|
||||
#define NLIST_STRUCT
|
||||
#endif
|
||||
|
||||
@@ -389,6 +391,7 @@ extern int errno;
|
||||
#ifdef SUNOS_5
|
||||
#include <fcntl.h>
|
||||
#include <kvm.h>
|
||||
#include <kstat.h>
|
||||
#endif
|
||||
|
||||
#ifndef KERNEL_FILE
|
||||
@@ -514,6 +517,50 @@ getloadavg (loadavg, nelem)
|
||||
elem = -1;
|
||||
#endif
|
||||
|
||||
#if !defined (LDAV_DONE) && defined (SUNOS_5)
|
||||
/* Use libkstat because we don't have to be root. */
|
||||
#define LDAV_DONE
|
||||
kstat_ctl_t *kc;
|
||||
kstat_t *ksp;
|
||||
kstat_named_t *kn;
|
||||
|
||||
kc = kstat_open ();
|
||||
if (kc == 0) return -1;
|
||||
ksp = kstat_lookup (kc, "unix", 0, "system_misc");
|
||||
if (ksp == 0 ) return -1;
|
||||
if (kstat_read (kc, ksp, 0) == -1) return -1;
|
||||
|
||||
|
||||
kn = kstat_data_lookup (ksp, "avenrun_1min");
|
||||
if (kn == 0)
|
||||
{
|
||||
/* Return -1 if no load average information is available. */
|
||||
nelem = 0;
|
||||
elem = -1;
|
||||
}
|
||||
|
||||
if (nelem >= 1)
|
||||
loadavg[elem++] = (double) kn->value.ul/FSCALE;
|
||||
|
||||
if (nelem >= 2)
|
||||
{
|
||||
kn = kstat_data_lookup (ksp, "avenrun_5min");
|
||||
if (kn != 0)
|
||||
{
|
||||
loadavg[elem++] = (double) kn->value.ul/FSCALE;
|
||||
|
||||
if (nelem >= 3)
|
||||
{
|
||||
kn = kstat_data_lookup (ksp, "avenrun_15min");
|
||||
if (kn != 0)
|
||||
loadavg[elem++] = (double) kn->value.ul/FSCALE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
kstat_close (kc);
|
||||
#endif /* SUNOS_5 */
|
||||
|
||||
#if !defined (LDAV_DONE) && defined (__linux__)
|
||||
#define LDAV_DONE
|
||||
#undef LOAD_AVE_TYPE
|
||||
@@ -733,11 +780,11 @@ getloadavg (loadavg, nelem)
|
||||
: (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale));
|
||||
#endif /* OSF_MIPS */
|
||||
|
||||
#if !defined (LDAV_DONE) && defined(MSDOS)
|
||||
#if !defined (LDAV_DONE) && (defined (MSDOS) || defined (WIN32))
|
||||
#define LDAV_DONE
|
||||
|
||||
/* A faithful emulation is going to have to be saved for a rainy day. */
|
||||
for ( ; elem < nelem; elem++)
|
||||
for ( ; elem < nelem; elem++)
|
||||
{
|
||||
loadavg[elem] = 0.0;
|
||||
}
|
||||
@@ -866,7 +913,7 @@ getloadavg (loadavg, nelem)
|
||||
/* We pass 0 for the kernel, corefile, and swapfile names
|
||||
to use the currently running kernel. */
|
||||
kd = kvm_open (0, 0, 0, O_RDONLY, 0);
|
||||
if (kd != 0)
|
||||
if (kd != 0)
|
||||
{
|
||||
/* nlist the currently running kernel. */
|
||||
kvm_nlist (kd, nl);
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
/* Written by David MacKenzie <djm@gnu.ai.mit.edu> */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "backupfile.h"
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
int argmatch ();
|
||||
@@ -32,12 +32,12 @@ void invalid_arg ();
|
||||
|
||||
extern char *program_name;
|
||||
|
||||
static char *backup_args[] =
|
||||
static const char *const backup_args[] =
|
||||
{
|
||||
"never", "simple", "nil", "existing", "t", "numbered", 0
|
||||
};
|
||||
|
||||
static enum backup_type backup_types[] =
|
||||
static const enum backup_type backup_types[] =
|
||||
{
|
||||
simple, simple, numbered_existing, numbered_existing, numbered, numbered
|
||||
};
|
||||
|
||||
@@ -17,52 +17,52 @@
|
||||
|
||||
/* Written by David MacKenzie <djm@gnu.ai.mit.edu> and Jim Meyering. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define alloca __builtin_alloca
|
||||
#if __GNUC__
|
||||
# define alloca __builtin_alloca
|
||||
#else
|
||||
#ifdef HAVE_ALLOCA_H
|
||||
#include <alloca.h>
|
||||
#else
|
||||
#ifdef _AIX
|
||||
# if HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
# else
|
||||
# ifdef _AIX
|
||||
#pragma alloca
|
||||
#else
|
||||
# else
|
||||
char *alloca ();
|
||||
#endif
|
||||
#endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
#undef S_ISDIR
|
||||
#if STAT_MACROS_BROKEN
|
||||
# undef S_ISDIR
|
||||
#endif /* STAT_MACROS_BROKEN. */
|
||||
|
||||
#if !defined(S_ISDIR) && defined(S_IFDIR)
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ERRNO_H
|
||||
#include <errno.h>
|
||||
#if HAVE_ERRNO_H
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#if HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
|
||||
@@ -24,30 +24,30 @@
|
||||
changing the mode of many files, this probably results in a
|
||||
performance gain. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include "modechange.h"
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
char *malloc ();
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
# define NULL 0
|
||||
#endif
|
||||
|
||||
#ifdef STAT_MACROS_BROKEN
|
||||
#undef S_ISDIR
|
||||
#if STAT_MACROS_BROKEN
|
||||
# undef S_ISDIR
|
||||
#endif /* STAT_MACROS_BROKEN. */
|
||||
|
||||
#if !defined(S_ISDIR) && defined(S_IFDIR)
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
|
||||
/* Return newly allocated memory to hold one element of type TYPE. */
|
||||
|
||||
@@ -33,7 +33,10 @@ char *stpcpy ();
|
||||
BASE in the returned concatenation. */
|
||||
|
||||
char *
|
||||
path_concat (const char *dir, const char *base, char **base_in_result)
|
||||
path_concat (dir, base, base_in_result)
|
||||
const char *dir;
|
||||
const char *base;
|
||||
char **base_in_result;
|
||||
{
|
||||
char *p;
|
||||
char *p_concat;
|
||||
|
||||
3621
lib/regex.c
3621
lib/regex.c
File diff suppressed because it is too large
Load Diff
@@ -21,9 +21,15 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
#endif
|
||||
|
||||
#if STDC_HEADERS || _LIBC
|
||||
# include <stddef.h>
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
# ifndef NULL
|
||||
# define NULL 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <regex.h>
|
||||
|
||||
#if ENABLE_NLS
|
||||
@@ -74,8 +80,8 @@ rpmatch (response)
|
||||
static regex_t yesre, nore;
|
||||
int result;
|
||||
|
||||
return ((result = try (response, _("^[yY][[:alpha:]]*"), 1, 0,
|
||||
return ((result = try (response, _("^[yY]"), 1, 0,
|
||||
&yesexpr, &yesre))
|
||||
? result
|
||||
: try (response, _("^[nN][[:alpha:]]*"), 0, -1, &noexpr, &nore));
|
||||
: try (response, _("^[nN]"), 0, -1, &noexpr, &nore));
|
||||
}
|
||||
|
||||
705
lib/strftime.c
705
lib/strftime.c
@@ -1,22 +1,20 @@
|
||||
/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
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,
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If
|
||||
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
@@ -25,13 +23,15 @@ USA. */
|
||||
#ifdef _LIBC
|
||||
# define HAVE_LIMITS_H 1
|
||||
# define HAVE_MBLEN 1
|
||||
# define HAVE_MBRLEN 1
|
||||
# define HAVE_TM_GMTOFF 1
|
||||
# define HAVE_TM_ZONE 1
|
||||
# define MULTIBYTE_IS_FORMAT_SAFE 1
|
||||
# define STDC_HEADERS 1
|
||||
# include <ansidecl.h>
|
||||
# include "../locale/localeinfo.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h> /* Some systems define `time_t' here. */
|
||||
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
@@ -45,8 +45,24 @@ USA. */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if HAVE_MBLEN
|
||||
# include <ctype.h>
|
||||
/* Do multibyte processing if multibytes are supported, unless
|
||||
multibyte sequences are safe in formats. Multibyte sequences are
|
||||
safe if they cannot contain byte sequences that look like format
|
||||
conversion specifications. The GNU C Library uses UTF8 multibyte
|
||||
encoding, which is safe for formats, but strftime.c can be used
|
||||
with other C libraries that use unsafe encodings. */
|
||||
#define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_FORMAT_SAFE)
|
||||
|
||||
#if DO_MULTIBYTE
|
||||
# if HAVE_MBRLEN
|
||||
# include <wchar.h>
|
||||
# else
|
||||
/* Simulate mbrlen with mblen as best we can. */
|
||||
# define mbstate_t int
|
||||
# define mbrlen(s, n, ps) mblen (s, n)
|
||||
# define mbsinit(ps) (*(ps) == 0)
|
||||
# endif
|
||||
static const mbstate_t mbstate_zero;
|
||||
#endif
|
||||
|
||||
#if HAVE_LIMITS_H
|
||||
@@ -77,11 +93,68 @@ USA. */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Uncomment following line in the production version. */
|
||||
/* #define NDEBUG */
|
||||
#include <assert.h>
|
||||
#ifndef CHAR_BIT
|
||||
#define CHAR_BIT 8
|
||||
#endif
|
||||
|
||||
static unsigned int week __P ((const struct tm *const, int, int));
|
||||
#define TYPE_SIGNED(t) ((t) -1 < 0)
|
||||
|
||||
/* Bound on length of the string representing an integer value of type t.
|
||||
Subtract one for the sign bit if t is signed;
|
||||
302 / 1000 is log10 (2) rounded up;
|
||||
add one for integer division truncation;
|
||||
add one more for a minus sign if t is signed. */
|
||||
#define INT_STRLEN_BOUND(t) \
|
||||
((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 100 + 1 + TYPE_SIGNED (t))
|
||||
|
||||
#define TM_YEAR_BASE 1900
|
||||
|
||||
#ifndef __isleap
|
||||
/* Nonzero if YEAR is a leap year (every 4 years,
|
||||
except every 100th isn't, and every 400th is). */
|
||||
#define __isleap(year) \
|
||||
((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _LIBC
|
||||
# define gmtime_r __gmtime_r
|
||||
# define localtime_r __localtime_r
|
||||
#else
|
||||
# if ! HAVE_LOCALTIME_R
|
||||
# if ! HAVE_TM_GMTOFF
|
||||
/* Approximate gmtime_r as best we can in its absence. */
|
||||
#define gmtime_r my_gmtime_r
|
||||
static struct tm *gmtime_r __P ((const time_t *, struct tm *));
|
||||
static struct tm *
|
||||
gmtime_r (t, tp)
|
||||
const time_t *t;
|
||||
struct tm *tp;
|
||||
{
|
||||
struct tm *l = gmtime (t);
|
||||
if (! l)
|
||||
return 0;
|
||||
*tp = *l;
|
||||
return tp;
|
||||
}
|
||||
# endif /* ! HAVE_TM_GMTOFF */
|
||||
|
||||
/* Approximate localtime_r as best we can in its absence. */
|
||||
#define localtime_r my_localtime_r
|
||||
static struct tm *localtime_r __P ((const time_t *, struct tm *));
|
||||
static struct tm *
|
||||
localtime_r (t, tp)
|
||||
const time_t *t;
|
||||
struct tm *tp;
|
||||
{
|
||||
struct tm *l = localtime (t);
|
||||
if (! l)
|
||||
return 0;
|
||||
*tp = *l;
|
||||
return tp;
|
||||
}
|
||||
# endif /* ! HAVE_LOCALTIME_R */
|
||||
#endif /* ! defined (_LIBC) */
|
||||
|
||||
|
||||
#define add(n, f) \
|
||||
@@ -99,53 +172,57 @@ static unsigned int week __P ((const struct tm *const, int, int));
|
||||
} while (0)
|
||||
#define cpy(n, s) add ((n), memcpy((PTR) p, (PTR) (s), (n)))
|
||||
|
||||
#ifdef _LIBC
|
||||
#define fmt(n, args) add((n), if (sprintf args != (n)) return 0)
|
||||
#else
|
||||
#define fmt(n, args) add((n), sprintf args; if (strlen (p) != (n)) return 0)
|
||||
#endif
|
||||
#if ! HAVE_TM_GMTOFF
|
||||
/* Yield the difference between *A and *B,
|
||||
measured in seconds, ignoring leap seconds. */
|
||||
static int tm_diff __P ((const struct tm *, const struct tm *));
|
||||
static int
|
||||
tm_diff (a, b)
|
||||
const struct tm *a;
|
||||
const struct tm *b;
|
||||
{
|
||||
int ay = a->tm_year + TM_YEAR_BASE - 1;
|
||||
int by = b->tm_year + TM_YEAR_BASE - 1;
|
||||
/* Divide years by 100, rounding towards minus infinity. */
|
||||
int ac = ay / 100 - (ay % 100 < 0);
|
||||
int bc = by / 100 - (by % 100 < 0);
|
||||
int intervening_leap_days =
|
||||
((ay >> 2) - (by >> 2)) - (ac - bc) + ((ac >> 2) - (bc >> 2));
|
||||
int years = ay - by;
|
||||
int days = (365 * years + intervening_leap_days
|
||||
+ (a->tm_yday - b->tm_yday));
|
||||
return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour))
|
||||
+ (a->tm_min - b->tm_min))
|
||||
+ (a->tm_sec - b->tm_sec));
|
||||
}
|
||||
#endif /* ! HAVE_TM_GMTOFF */
|
||||
|
||||
|
||||
|
||||
/* Return the week in the year specified by TP,
|
||||
with weeks starting on STARTING_DAY. */
|
||||
#ifdef __GNUC__
|
||||
/* The number of days from the first day of the first ISO week of this
|
||||
year to the year day YDAY with week day WDAY. ISO weeks start on
|
||||
Monday; the first ISO week has the year's first Thursday. YDAY may
|
||||
be as small as YDAY_MINIMUM. */
|
||||
#define ISO_WEEK_START_WDAY 1 /* Monday */
|
||||
#define ISO_WEEK1_WDAY 4 /* Thursday */
|
||||
#define YDAY_MINIMUM (-366)
|
||||
static int iso_week_days __P ((int, int));
|
||||
#ifdef __GNUC__
|
||||
inline
|
||||
#endif
|
||||
static unsigned int
|
||||
week (tp, starting_day, max_preceding)
|
||||
const struct tm *const tp;
|
||||
int starting_day;
|
||||
int max_preceding;
|
||||
static int
|
||||
iso_week_days (yday, wday)
|
||||
int yday;
|
||||
int wday;
|
||||
{
|
||||
int wday, dl, base;
|
||||
|
||||
wday = tp->tm_wday - starting_day;
|
||||
if (wday < 0)
|
||||
wday += 7;
|
||||
|
||||
/* Set DL to the day in the year of the first day of the week
|
||||
containing the day specified in TP. */
|
||||
dl = tp->tm_yday - wday;
|
||||
|
||||
/* For the computation following ISO 8601:1988 we set the number of
|
||||
the week containing January 1st to 1 if this week has more than
|
||||
MAX_PRECEDING days in the new year. For ISO 8601 this number is
|
||||
3, for the other representation it is 7 (i.e., not to be
|
||||
fulfilled). */
|
||||
base = ((dl + 7) % 7) > max_preceding ? 1 : 0;
|
||||
|
||||
/* If DL is negative we compute the result as 0 unless we have to
|
||||
compute it according ISO 8601. In this case we have to return 53
|
||||
or 1 if the week containing January 1st has less than 4 days in
|
||||
the new year or not. If DL is not negative we calculate the
|
||||
number of complete weeks for our week (DL / 7) plus 1 (because
|
||||
only for DL < 0 we are in week 0/53 and plus the number of the
|
||||
first week computed in the last step. */
|
||||
return dl < 0 ? (dl < -max_preceding ? 53 : base)
|
||||
: base + 1 + dl / 7;
|
||||
/* Add enough to the first operand of % to make it nonnegative. */
|
||||
int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7;
|
||||
return (yday
|
||||
- (yday - wday + ISO_WEEK1_WDAY + big_enough_multiple_of_7) % 7
|
||||
+ ISO_WEEK1_WDAY - ISO_WEEK_START_WDAY);
|
||||
}
|
||||
|
||||
|
||||
#ifndef _NL_CURRENT
|
||||
static char const weekday_name[][10] =
|
||||
{
|
||||
@@ -183,6 +260,9 @@ strftime (s, maxsize, format, tp)
|
||||
size_t aw_len = strlen(a_wkday);
|
||||
size_t am_len = strlen(a_month);
|
||||
size_t ap_len = strlen (ampm);
|
||||
|
||||
const char *alt_digits = _NL_CURRENT (LC_TIME, ALT_DIGITS);
|
||||
const char *end_alt_digits = _NL_CURRENT (LC_TIME, ALT_DIGITS + 1);
|
||||
#else
|
||||
const char *const f_wkday = weekday_name[tp->tm_wday];
|
||||
const char *const f_month = month_name[tp->tm_mon];
|
||||
@@ -195,18 +275,11 @@ strftime (s, maxsize, format, tp)
|
||||
#endif
|
||||
size_t wkday_len = strlen (f_wkday);
|
||||
size_t month_len = strlen (f_month);
|
||||
const unsigned int y_week0 = week (tp, 0, 7);
|
||||
const unsigned int y_week1 = week (tp, 1, 7);
|
||||
const unsigned int y_week2 = week (tp, 1, 3);
|
||||
const char *zone;
|
||||
size_t zonelen;
|
||||
register size_t i = 0;
|
||||
register char *p = s;
|
||||
register const char *f;
|
||||
char number_fmt[5];
|
||||
|
||||
/* Initialize the buffer we will use for the sprintf format for numbers. */
|
||||
number_fmt[0] = '%';
|
||||
|
||||
zone = 0;
|
||||
#if HAVE_TM_ZONE
|
||||
@@ -216,8 +289,8 @@ strftime (s, maxsize, format, tp)
|
||||
if (!(zone && *zone) && tp->tm_isdst >= 0)
|
||||
zone = tzname[tp->tm_isdst];
|
||||
#endif
|
||||
if (!(zone && *zone))
|
||||
zone = "???";
|
||||
if (! zone)
|
||||
zone = ""; /* POSIX.2 requires the empty string here. */
|
||||
|
||||
zonelen = strlen (zone);
|
||||
|
||||
@@ -228,78 +301,170 @@ strftime (s, maxsize, format, tp)
|
||||
|
||||
for (f = format; *f != '\0'; ++f)
|
||||
{
|
||||
enum { pad_zero, pad_space, pad_none } pad; /* Padding for number. */
|
||||
unsigned int maxdigits; /* Max digits for numeric format. */
|
||||
unsigned int number_value; /* Numeric value to be printed. */
|
||||
int pad; /* Padding for number ('-', '_', or 0). */
|
||||
int modifier; /* Field modifier ('E', 'O', or 0). */
|
||||
int digits; /* Max digits for numeric format. */
|
||||
int number_value; /* Numeric value to be printed. */
|
||||
int negative_number; /* 1 if the number is negative. */
|
||||
const char *subfmt;
|
||||
char *bufp;
|
||||
char buf[1 + (sizeof (int) < sizeof (time_t)
|
||||
? INT_STRLEN_BOUND (time_t)
|
||||
: INT_STRLEN_BOUND (int))];
|
||||
|
||||
#if HAVE_MBLEN
|
||||
if (!isascii (*f))
|
||||
#if DO_MULTIBYTE
|
||||
|
||||
switch (*f)
|
||||
{
|
||||
/* Non-ASCII, may be a multibyte. */
|
||||
int len = mblen (f, strlen (f));
|
||||
if (len > 0)
|
||||
{
|
||||
cpy(len, f);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
case '%':
|
||||
break;
|
||||
|
||||
case '\a': case '\b': case '\t': case '\n':
|
||||
case '\v': case '\f': case '\r':
|
||||
case ' ': case '!': case '"': case '#': case '&': case'\'':
|
||||
case '(': case ')': 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 '<': case '=': 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 ']': 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 '}':
|
||||
case '~':
|
||||
/* The C Standard requires these 98 characters (plus '%') to
|
||||
be in the basic execution character set. None of these
|
||||
characters can start a multibyte sequence, so they need
|
||||
not be analyzed further. */
|
||||
add (1, *p = *f);
|
||||
continue;
|
||||
|
||||
default:
|
||||
/* Copy this multibyte sequence until we reach its end, find
|
||||
an error, or come back to the initial shift state. */
|
||||
{
|
||||
mbstate_t mbstate = mbstate_zero;
|
||||
size_t len = 0;
|
||||
|
||||
do
|
||||
{
|
||||
size_t bytes = mbrlen (f + len, (size_t) -1, &mbstate);
|
||||
|
||||
if (bytes == 0)
|
||||
break;
|
||||
|
||||
if (bytes == (size_t) -2 || bytes == (size_t) -1)
|
||||
{
|
||||
len++;
|
||||
break;
|
||||
}
|
||||
|
||||
len += bytes;
|
||||
}
|
||||
while (! mbsinit (&mbstate));
|
||||
|
||||
cpy (len, f);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
#else /* ! DO_MULTIBYTE */
|
||||
|
||||
/* Either multibyte encodings are not supported, or they are
|
||||
safe for formats, so any non-'%' byte can be copied through. */
|
||||
if (*f != '%')
|
||||
{
|
||||
add (1, *p = *f);
|
||||
continue;
|
||||
}
|
||||
|
||||
#endif /* ! DO_MULTIBYTE */
|
||||
|
||||
/* Check for flags that can modify a number format. */
|
||||
++f;
|
||||
switch (*f)
|
||||
{
|
||||
case '_':
|
||||
pad = pad_space;
|
||||
++f;
|
||||
break;
|
||||
case '-':
|
||||
pad = pad_none;
|
||||
++f;
|
||||
pad = *f++;
|
||||
break;
|
||||
|
||||
default:
|
||||
pad = pad_zero;
|
||||
pad = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check for modifiers. */
|
||||
switch (*f)
|
||||
{
|
||||
case 'E':
|
||||
case 'O':
|
||||
modifier = *f++;
|
||||
break;
|
||||
|
||||
default:
|
||||
modifier = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Now do the specified format. */
|
||||
switch (*f)
|
||||
{
|
||||
case '\0':
|
||||
#define DO_NUMBER(d, v) \
|
||||
digits = d; number_value = v; goto do_number
|
||||
#define DO_NUMBER_SPACEPAD(d, v) \
|
||||
digits = d; number_value = v; goto do_number_spacepad
|
||||
|
||||
case '\0': /* GNU extension: % at end of format. */
|
||||
--f;
|
||||
/* Fall through. */
|
||||
case '%':
|
||||
if (modifier != 0)
|
||||
goto bad_format;
|
||||
add (1, *p = *f);
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
if (modifier != 0)
|
||||
goto bad_format;
|
||||
cpy (aw_len, a_wkday);
|
||||
break;
|
||||
|
||||
case 'A':
|
||||
if (modifier != 0)
|
||||
goto bad_format;
|
||||
cpy (wkday_len, f_wkday);
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
case 'h': /* GNU extension. */
|
||||
case 'h': /* POSIX.2 extension. */
|
||||
if (modifier != 0)
|
||||
goto bad_format;
|
||||
cpy (am_len, a_month);
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
if (modifier != 0)
|
||||
goto bad_format;
|
||||
cpy (month_len, f_month);
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
if (modifier == 'O')
|
||||
goto bad_format;
|
||||
#ifdef _NL_CURRENT
|
||||
subfmt = _NL_CURRENT (LC_TIME, D_T_FMT);
|
||||
if (! (modifier == 'E'
|
||||
&& *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_T_FMT)) != '\0'))
|
||||
subfmt = _NL_CURRENT (LC_TIME, D_T_FMT);
|
||||
#else
|
||||
subfmt = "%a %b %d %H:%M:%S %Z %Y";
|
||||
subfmt = "%a %b %e %H:%M:%S %Z %Y";
|
||||
#endif
|
||||
|
||||
subformat:
|
||||
{
|
||||
size_t len = strftime (p, maxsize - i, subfmt, tp);
|
||||
@@ -309,91 +474,163 @@ strftime (s, maxsize, format, tp)
|
||||
}
|
||||
break;
|
||||
|
||||
#define DO_NUMBER(digits, value) \
|
||||
maxdigits = digits; number_value = value; goto do_number
|
||||
#define DO_NUMBER_SPACEPAD(digits, value) \
|
||||
maxdigits = digits; number_value = value; goto do_number_spacepad
|
||||
|
||||
case 'C':
|
||||
DO_NUMBER (2, (1900 + tp->tm_year) / 100);
|
||||
case 'C': /* POSIX.2 extension. */
|
||||
if (modifier == 'O')
|
||||
goto bad_format;
|
||||
#ifdef _NL_CURRENT
|
||||
/* XXX %EC is not implemented yet. */
|
||||
#endif
|
||||
{
|
||||
int year = tp->tm_year + TM_YEAR_BASE;
|
||||
DO_NUMBER (1, year / 100 - (year % 100 < 0));
|
||||
}
|
||||
|
||||
case 'x':
|
||||
if (modifier == 'O')
|
||||
goto bad_format;
|
||||
#ifdef _NL_CURRENT
|
||||
subfmt = _NL_CURRENT (LC_TIME, D_FMT);
|
||||
if (! (modifier == 'E'
|
||||
&& *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_FMT)) != '\0'))
|
||||
subfmt = _NL_CURRENT (LC_TIME, D_FMT);
|
||||
goto subformat;
|
||||
#endif
|
||||
/* Fall through. */
|
||||
case 'D': /* GNU extension. */
|
||||
case 'D': /* POSIX.2 extension. */
|
||||
if (modifier != 0)
|
||||
goto bad_format;
|
||||
subfmt = "%m/%d/%y";
|
||||
goto subformat;
|
||||
|
||||
case 'd':
|
||||
if (modifier == 'E')
|
||||
goto bad_format;
|
||||
|
||||
DO_NUMBER (2, tp->tm_mday);
|
||||
|
||||
case 'e': /* GNU extension: %d, but blank-padded. */
|
||||
case 'e': /* POSIX.2 extension. */
|
||||
if (modifier == 'E')
|
||||
goto bad_format;
|
||||
|
||||
DO_NUMBER_SPACEPAD (2, tp->tm_mday);
|
||||
|
||||
/* All numeric formats set MAXDIGITS and NUMBER_VALUE and then
|
||||
/* All numeric formats set DIGITS and NUMBER_VALUE and then
|
||||
jump to one of these two labels. */
|
||||
|
||||
do_number_spacepad:
|
||||
/* Force `_' flag. */
|
||||
pad = pad_space;
|
||||
pad = '_';
|
||||
|
||||
do_number:
|
||||
{
|
||||
/* Format the number according to the PAD flag. */
|
||||
/* Format the number according to the MODIFIER flag. */
|
||||
|
||||
register char *nf = &number_fmt[1];
|
||||
int printed = maxdigits;
|
||||
#ifdef _NL_CURRENT
|
||||
if (modifier == 'O')
|
||||
{
|
||||
/* ALT_DIGITS is the first entry in an array with
|
||||
alternative digit symbols. We have to find string
|
||||
number NUMBER_VALUE, but must not look beyond
|
||||
END_ALT_DIGITS. */
|
||||
int run = number_value;
|
||||
const char *cp = alt_digits;
|
||||
|
||||
switch (pad)
|
||||
{
|
||||
case pad_zero:
|
||||
*nf++ = '0';
|
||||
case pad_space:
|
||||
*nf++ = '0' + maxdigits;
|
||||
case pad_none:
|
||||
*nf++ = 'u';
|
||||
*nf = '\0';
|
||||
}
|
||||
while (run > 0 && cp < end_alt_digits)
|
||||
cp = strchr (cp, '\0') + 1;
|
||||
|
||||
#ifdef _LIBC
|
||||
add (maxdigits, printed = sprintf (p, number_fmt, number_value));
|
||||
#else
|
||||
add (maxdigits, sprintf (p, number_fmt, number_value);
|
||||
printed = strlen (p));
|
||||
if (cp < end_alt_digits)
|
||||
{
|
||||
size_t digitlen = strlen (cp);
|
||||
if (digitlen != 0)
|
||||
{
|
||||
cpy (digitlen, cp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* Back up if fewer than MAXDIGITS chars written for pad_none. */
|
||||
p -= maxdigits - printed;
|
||||
i -= maxdigits - printed;
|
||||
{
|
||||
unsigned int u = number_value;
|
||||
|
||||
break;
|
||||
}
|
||||
bufp = buf + sizeof (buf);
|
||||
negative_number = number_value < 0;
|
||||
|
||||
if (negative_number)
|
||||
u = -u;
|
||||
|
||||
do
|
||||
*--bufp = u % 10 + '0';
|
||||
while ((u /= 10) != 0);
|
||||
}
|
||||
|
||||
do_number_sign_and_padding:
|
||||
if (negative_number)
|
||||
*--bufp = '-';
|
||||
|
||||
if (pad != '-')
|
||||
{
|
||||
int padding = digits - (buf + sizeof (buf) - bufp);
|
||||
|
||||
if (pad == '_')
|
||||
{
|
||||
while (0 < padding--)
|
||||
*--bufp = ' ';
|
||||
}
|
||||
else
|
||||
{
|
||||
bufp += negative_number;
|
||||
while (0 < padding--)
|
||||
*--bufp = '0';
|
||||
if (negative_number)
|
||||
*--bufp = '-';
|
||||
}
|
||||
}
|
||||
|
||||
cpy (buf + sizeof (buf) - bufp, bufp);
|
||||
break;
|
||||
|
||||
|
||||
case 'H':
|
||||
if (modifier == 'E')
|
||||
goto bad_format;
|
||||
|
||||
DO_NUMBER (2, tp->tm_hour);
|
||||
|
||||
case 'I':
|
||||
if (modifier == 'E')
|
||||
goto bad_format;
|
||||
|
||||
DO_NUMBER (2, hour12);
|
||||
|
||||
case 'k': /* GNU extension. */
|
||||
if (modifier == 'E')
|
||||
goto bad_format;
|
||||
|
||||
DO_NUMBER_SPACEPAD (2, tp->tm_hour);
|
||||
|
||||
case 'l': /* GNU extension. */
|
||||
if (modifier == 'E')
|
||||
goto bad_format;
|
||||
|
||||
DO_NUMBER_SPACEPAD (2, hour12);
|
||||
|
||||
case 'j':
|
||||
if (modifier == 'E')
|
||||
goto bad_format;
|
||||
|
||||
DO_NUMBER (3, 1 + tp->tm_yday);
|
||||
|
||||
case 'M':
|
||||
if (modifier == 'E')
|
||||
goto bad_format;
|
||||
|
||||
DO_NUMBER (2, tp->tm_min);
|
||||
|
||||
case 'm':
|
||||
if (modifier == 'E')
|
||||
goto bad_format;
|
||||
|
||||
DO_NUMBER (2, tp->tm_mon + 1);
|
||||
|
||||
case 'n': /* GNU extension. */
|
||||
case 'n': /* POSIX.2 extension. */
|
||||
add (1, *p = '\n');
|
||||
break;
|
||||
|
||||
@@ -405,94 +642,192 @@ strftime (s, maxsize, format, tp)
|
||||
subfmt = "%H:%M";
|
||||
goto subformat;
|
||||
|
||||
case 'r': /* GNU extension. */
|
||||
case 'r': /* POSIX.2 extension. */
|
||||
#ifdef _NL_CURRENT
|
||||
subfmt = _NL_CURRENT (LC_TIME, T_FMT_AMPM);
|
||||
#else
|
||||
subfmt = "%I:%M:%S %p";
|
||||
#endif
|
||||
goto subformat;
|
||||
|
||||
case 'S':
|
||||
if (modifier == 'E')
|
||||
return 0;
|
||||
|
||||
DO_NUMBER (2, tp->tm_sec);
|
||||
|
||||
case 's': /* GNU extension. */
|
||||
{
|
||||
struct tm writable_tm = *tp;
|
||||
unsigned long int num = (unsigned long int) mktime (&writable_tm);
|
||||
/* `3 * sizeof (unsigned long int)' is an approximation of
|
||||
the size of the decimal representation of NUM, valid
|
||||
for sizes <= 16. */
|
||||
int printed = 3 * sizeof (unsigned long int);
|
||||
maxdigits = printed;
|
||||
assert (sizeof (unsigned long int) <= 16);
|
||||
#ifdef _LIBC
|
||||
add (maxdigits, printed = sprintf (p, "%lu", num));
|
||||
#else
|
||||
add (maxdigits, sprintf (p, "%lu", num); printed = strlen (p));
|
||||
#endif
|
||||
/* Back up if fewer than MAXDIGITS chars written for pad_none. */
|
||||
p -= maxdigits - printed;
|
||||
i -= maxdigits - printed;
|
||||
{
|
||||
struct tm ltm = *tp;
|
||||
time_t t = mktime (<m);
|
||||
|
||||
/* Generate string value for T using time_t arithmetic;
|
||||
this works even if sizeof (long) < sizeof (time_t). */
|
||||
|
||||
bufp = buf + sizeof (buf);
|
||||
negative_number = t < 0;
|
||||
|
||||
do
|
||||
{
|
||||
int d = t % 10;
|
||||
t /= 10;
|
||||
|
||||
if (negative_number)
|
||||
{
|
||||
d = -d;
|
||||
|
||||
/* Adjust if division truncates to minus infinity. */
|
||||
if (0 < -1 % 10 && d < 0)
|
||||
{
|
||||
t++;
|
||||
d += 10;
|
||||
}
|
||||
}
|
||||
|
||||
*--bufp = d + '0';
|
||||
}
|
||||
while (t != 0);
|
||||
|
||||
digits = 1;
|
||||
goto do_number_sign_and_padding;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'X':
|
||||
if (modifier == 'O')
|
||||
goto bad_format;
|
||||
#ifdef _NL_CURRENT
|
||||
subfmt = _NL_CURRENT (LC_TIME, T_FMT);
|
||||
if (! (modifier == 'E'
|
||||
&& *(subfmt = _NL_CURRENT (LC_TIME, ERA_T_FMT)) != '\0'))
|
||||
subfmt = _NL_CURRENT (LC_TIME, T_FMT);
|
||||
goto subformat;
|
||||
#endif
|
||||
/* Fall through. */
|
||||
case 'T': /* GNU extension. */
|
||||
case 'T': /* POSIX.2 extension. */
|
||||
subfmt = "%H:%M:%S";
|
||||
goto subformat;
|
||||
|
||||
case 't': /* GNU extension. */
|
||||
case 't': /* POSIX.2 extension. */
|
||||
add (1, *p = '\t');
|
||||
break;
|
||||
|
||||
case 'u': /* POSIX.2 extension. */
|
||||
DO_NUMBER (1, (tp->tm_wday - 1 + 7) % 7 + 1);
|
||||
|
||||
case 'U':
|
||||
DO_NUMBER (2, y_week0);
|
||||
if (modifier == 'E')
|
||||
goto bad_format;
|
||||
|
||||
DO_NUMBER (2, (tp->tm_yday - tp->tm_wday + 7) / 7);
|
||||
|
||||
case 'V':
|
||||
DO_NUMBER (2, y_week2);
|
||||
case 'g': /* GNU extension. */
|
||||
case 'G': /* GNU extension. */
|
||||
if (modifier == 'E')
|
||||
goto bad_format;
|
||||
{
|
||||
int year = tp->tm_year + TM_YEAR_BASE;
|
||||
int days = iso_week_days (tp->tm_yday, tp->tm_wday);
|
||||
|
||||
if (days < 0)
|
||||
{
|
||||
/* This ISO week belongs to the previous year. */
|
||||
year--;
|
||||
days = iso_week_days (tp->tm_yday + (365 + __isleap (year)),
|
||||
tp->tm_wday);
|
||||
}
|
||||
else
|
||||
{
|
||||
int d = iso_week_days (tp->tm_yday - (365 + __isleap (year)),
|
||||
tp->tm_wday);
|
||||
if (0 <= d)
|
||||
{
|
||||
/* This ISO week belongs to the next year. */
|
||||
year++;
|
||||
days = d;
|
||||
}
|
||||
}
|
||||
|
||||
switch (*f)
|
||||
{
|
||||
case 'g':
|
||||
DO_NUMBER (2, (year % 100 + 100) % 100);
|
||||
|
||||
case 'G':
|
||||
DO_NUMBER (1, year);
|
||||
|
||||
default:
|
||||
DO_NUMBER (2, days / 7 + 1);
|
||||
}
|
||||
}
|
||||
|
||||
case 'W':
|
||||
DO_NUMBER (2, y_week1);
|
||||
if (modifier == 'E')
|
||||
goto bad_format;
|
||||
|
||||
DO_NUMBER (2, (tp->tm_yday - (tp->tm_wday - 1 + 7) % 7 + 7) / 7);
|
||||
|
||||
case 'w':
|
||||
DO_NUMBER (2, tp->tm_wday);
|
||||
if (modifier == 'E')
|
||||
goto bad_format;
|
||||
|
||||
DO_NUMBER (1, tp->tm_wday);
|
||||
|
||||
case 'Y':
|
||||
DO_NUMBER (4, 1900 + tp->tm_year);
|
||||
#ifdef _NL_CURRENT
|
||||
if (modifier == 'E'
|
||||
&& *(subfmt = _NL_CURRENT (LC_TIME, ERA_YEAR)) != '\0')
|
||||
goto subformat;
|
||||
#endif
|
||||
if (modifier == 'O')
|
||||
goto bad_format;
|
||||
else
|
||||
DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
|
||||
|
||||
case 'y':
|
||||
DO_NUMBER (2, tp->tm_year % 100);
|
||||
#ifdef _NL_CURRENT
|
||||
/* XXX %Ey is not implemented yet. */
|
||||
#endif
|
||||
DO_NUMBER (2, (tp->tm_year % 100 + 100) % 100);
|
||||
|
||||
case 'Z':
|
||||
cpy(zonelen, zone);
|
||||
break;
|
||||
|
||||
case 'z':
|
||||
case 'z': /* GNU extension. */
|
||||
if (tp->tm_isdst < 0)
|
||||
break;
|
||||
|
||||
{
|
||||
struct tm tml = *tp;
|
||||
time_t t = mktime (&tml);
|
||||
struct tm tmg;
|
||||
int diff;
|
||||
#if HAVE_TM_GMTOFF
|
||||
diff = tp->tm_gmtoff;
|
||||
#else
|
||||
struct tm gtm;
|
||||
struct tm ltm = *tp;
|
||||
time_t lt = mktime (<m);
|
||||
|
||||
tml = *localtime (&t); /* Canonicalize the local time. */
|
||||
tmg = *gmtime (&t);
|
||||
|
||||
/* Compute the difference. */
|
||||
diff = tml.tm_min - tmg.tm_min;
|
||||
diff += 60 * (tml.tm_hour - tmg.tm_hour);
|
||||
|
||||
if (tml.tm_mon != tmg.tm_mon)
|
||||
if (lt == (time_t) -1)
|
||||
{
|
||||
/* We assume no timezone differs from UTC by more than
|
||||
+- 23 hours. This should be safe. */
|
||||
if (tmg.tm_mday == 1)
|
||||
tml.tm_mday = 0;
|
||||
else /* tml.tm_mday == 1 */
|
||||
tmg.tm_mday = 0;
|
||||
/* mktime returns -1 for errors, but -1 is also a
|
||||
valid time_t value. Check whether an error really
|
||||
occurred. */
|
||||
struct tm tm;
|
||||
localtime_r (<, &tm);
|
||||
|
||||
if ((ltm.tm_sec ^ tm.tm_sec)
|
||||
| (ltm.tm_min ^ tm.tm_min)
|
||||
| (ltm.tm_hour ^ tm.tm_hour)
|
||||
| (ltm.tm_mday ^ tm.tm_mday)
|
||||
| (ltm.tm_mon ^ tm.tm_mon)
|
||||
| (ltm.tm_year ^ tm.tm_year))
|
||||
break;
|
||||
}
|
||||
diff += 1440 * (tml.tm_mday - tmg.tm_mday);
|
||||
|
||||
if (! gmtime_r (<, >m))
|
||||
break;
|
||||
|
||||
diff = tm_diff (<m, >m);
|
||||
#endif
|
||||
|
||||
if (diff < 0)
|
||||
{
|
||||
@@ -502,13 +837,21 @@ strftime (s, maxsize, format, tp)
|
||||
else
|
||||
add (1, *p = '+');
|
||||
|
||||
pad = pad_zero;
|
||||
DO_NUMBER (4, ((diff / 60) % 24) * 100 + diff % 60);
|
||||
diff /= 60;
|
||||
DO_NUMBER (4, (diff / 60) * 100 + diff % 60);
|
||||
}
|
||||
|
||||
default:
|
||||
/* Bad format. */
|
||||
add (1, *p = *f);
|
||||
/* Unknown format; output the format, including the '%',
|
||||
since this is most likely the right thing to do if a
|
||||
multibyte string has been misparsed. */
|
||||
bad_format:
|
||||
{
|
||||
int flen;
|
||||
for (flen = 2; f[1 - flen] != '%'; flen++)
|
||||
continue;
|
||||
cpy (flen, &f[1 - flen]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,108 @@
|
||||
Mon Sep 30 20:08:45 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* lib/path-concat.c (path_concat): Use K&R style function definition.
|
||||
|
||||
Sun Sep 29 22:00:44 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* configure.in (ALL_LINGUAS): Add slovenian (sl).
|
||||
|
||||
* src/cp-aux.c (usage): Take only one argument -- like all the other
|
||||
usage functions.
|
||||
|
||||
* src/cp.c (do_copy): Give better error message when copying multiple
|
||||
files and the last one is not a directory. From Karl Berry.
|
||||
Call error (0, 0, ... then usage (1) -- instead of calling usage
|
||||
with two arguments.
|
||||
|
||||
Sat Sep 28 13:16:29 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* lib/getversion.c (backup_types): Declare const.
|
||||
(backup_args): Likewise.
|
||||
|
||||
Sat Sep 21 10:22:28 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/dircolors.c (xstrndup): Use message that's the same as the one
|
||||
you get from e.g., xmalloc. Reported by Santiago Vila.
|
||||
|
||||
Thu Sep 19 22:13:31 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* lib/Makefile.am (fu_SOURCES): Remove regex.c and rx.c.
|
||||
(EXTRA_DIST): Put them here instead.
|
||||
|
||||
* configure.in ($PACKAGE, $VERSION): Don't AC_DEFINE_UNQUOTED these.
|
||||
AM_INIT_AUTOMAKE now does it (as of automake-1.1e).
|
||||
|
||||
* lib/Makefile.am (fu_SOURCES): Move getopt.c and getopt1.c back to
|
||||
here fro EXTRA_DIST.
|
||||
* configure.in (AC_REPLACE_GNU_GETOPT): Remove it -- it's not
|
||||
necessary.
|
||||
|
||||
* acinclude.m4 (AM_SANITY_CHECK_CC, AC_SYS_POSIX_TERMIOS,
|
||||
AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL): Remove definitions.
|
||||
Now automake's aclocal includes them.
|
||||
|
||||
Sun Sep 15 23:08:48 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Remove acinclude.m4.
|
||||
|
||||
Mon Sep 9 21:39:49 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/cp.c (do_copy): Describe in a little more detail the code
|
||||
that makes `cp non-directory file/' (eventually) fail.
|
||||
|
||||
Sun Sep 8 12:54:31 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/dircolors.c (usage): Refer to LS_COLORS, not LS_COLOR.
|
||||
From Santiago Vila Doncel.
|
||||
|
||||
* src/cp.c (do_copy): Set backup_type to `none' only *after*
|
||||
calling to find_backup_file_name. Reported by Eli Zaretskii.
|
||||
|
||||
Sat Sep 7 12:25:42 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* lib/regex.c, lib/regex.h: New files.
|
||||
* lib/rx.c, lib/rx.h: New files.
|
||||
|
||||
* lib/Makefile.am (INCLUDES): Add -I../intl so compiler will find
|
||||
libintl.h for rpmatch.c.
|
||||
|
||||
* src/system.h: Add comments justifying IS* versions of ctype.h macros.
|
||||
|
||||
Thu Sep 5 18:12:44 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/chmod.c (main): Don't set verbose flag for --changes.
|
||||
(change_file_mode): If chmod succeeds and --changes was given,
|
||||
give a diagnostic describing the new permissions.
|
||||
Reported by Philippe Schnoebelen (phs@fing.edu.uy).
|
||||
|
||||
* src/cp.c (do_copy): When concatenating DEST (with a trailing `/')
|
||||
and the basename part of non-directory SOURCE, don't add a slash
|
||||
between them.
|
||||
|
||||
Wed Sep 4 21:42:32 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* lib/rpmatch.c: Make sure NULL is defined by including stddef.h
|
||||
(if STDC_HEADERS || _LIBC) or simply defining it (otherwise).
|
||||
Include sys/types.h for definition of size_t needed by regex.h.
|
||||
|
||||
* lib/Makefile.am (fu_SOURCES): Add regex.c and rx.c.
|
||||
(noinst_HEADERS): Add regex.h and rx.h.
|
||||
|
||||
* configure.in (AM_SANITY_CHECK_CC): Use it.
|
||||
(AM_WITH_REGEX): Use it.
|
||||
|
||||
* acconfig.h (WITH_REGEX): Add it.
|
||||
|
||||
Tue Sep 3 08:13:09 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* lib/rpmatch.c (rpmatch): Set yesexpr to "^[yY]" and noexpr to
|
||||
"^[nN]"; this conforms to POSIX.2. From Paul Eggert
|
||||
<eggert@twinsun.com>.
|
||||
|
||||
Mon Sep 2 10:59:10 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* POTFILES.in: Add lib/rpmatch.c.
|
||||
|
||||
* lib/rpmatch.c (ENABLE_NLS): Include libintl.h and define _ to
|
||||
gettext.
|
||||
|
||||
|
||||
@@ -1,3 +1,51 @@
|
||||
Sun Sep 22 22:41:54 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* configure.in (AC_CHECK_HEADERS): Alphabetize.
|
||||
Update for automake-1.1e.
|
||||
|
||||
Thu Sep 19 07:47:18 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* lib/regex.c: Merge with FSF version.
|
||||
* lib/getloadavg.c: Replace with FSF version.
|
||||
|
||||
Mon Sep 16 23:13:04 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* lib/strftime.c (strftime): New version, from GNU libc.
|
||||
|
||||
Sun Sep 15 23:08:48 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Remove acinclude.m4.
|
||||
|
||||
Mon Sep 9 22:10:45 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* configure.in: Improve handling of math library so -lm is used
|
||||
only when it's actually required. That makes a difference when
|
||||
using dynamic linking.
|
||||
Remove check that added -lm to LIBS.
|
||||
(SQRT_LIBM): Test for and AC_SUBST it.
|
||||
(POW_LIBM): Likewise.
|
||||
(SEQ_LIBM): Likewise.
|
||||
Motivation and suggestions from Ulrich Drepper.
|
||||
|
||||
* src/Makefile.am (factor_LDADD, printf_LDADD, seq_LDADD):
|
||||
Set these using new @SQRT_LIBM@, @POW_LIBM@, and @SEQ_LIBM@ resp.
|
||||
Also set corresponding _DEPENDENCIES variables.
|
||||
|
||||
Sat Sep 7 12:41:39 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/system.h: Add comments justifying IS* versions of ctype.h macros.
|
||||
|
||||
* lib/getdate.y: Define and use upper case variants of ctype.h
|
||||
is* macros. From Bruno Haible.
|
||||
|
||||
Thu Sep 5 22:12:20 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* lib/strftime.c: New version from glibc.
|
||||
|
||||
Wed Sep 4 23:39:51 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* configure.in (ALL_LINGUAS): Add dutch (nl).
|
||||
|
||||
Mon Sep 2 10:52:55 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/*.c (usage): Tell where to report bugs.
|
||||
|
||||
@@ -1,3 +1,82 @@
|
||||
Sun Sep 29 20:04:53 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* tests/sort-test/build-script.pl: Die if close fails.
|
||||
* tests/tr-test/build-script.pl: Likewise.
|
||||
|
||||
* configure.in (AC_OUTPUT): Add tests/cut-test/Makefile.
|
||||
* tests/Makefile.am (SUBDIRS): Add cut-test.
|
||||
* tests/cut-test: New directory.
|
||||
|
||||
Fri Sep 27 22:22:09 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* configure.in (ALL_LINGUAS): Add spanish (es).
|
||||
|
||||
Thu Sep 26 21:02:54 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/md5sum.c (usage): Remove references in --help output to
|
||||
the now-deprecated --string option. Support for it will be
|
||||
removed soon.
|
||||
|
||||
* tests/md5sum-test/md5-rfc: Rewrite to avoid use of --string option.
|
||||
|
||||
Wed Sep 25 21:43:10 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* tests/sort-test/Makefile.am (t): Factor out .in suffix.
|
||||
Include new test: t16a.
|
||||
* tests/tr-test/Makefile.am (t): Likewise.
|
||||
|
||||
* src/Makefile.am (EXTRA_DIST): Remove md5-test.rfc.
|
||||
|
||||
Mon Sep 23 10:00:50 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* tests/md5sum-test/Makefile.am (EXTRA_DIST): Distribute $(TESTS).
|
||||
|
||||
Sun Sep 22 09:24:22 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/sort.c (keycompare): Declare translate to be unsigned char *.
|
||||
Otherwise, sign extension caused misordering when using e.g. -f.
|
||||
Reported by Erick Branderhorst.
|
||||
* tests/sort-test/Test.pm: Add Erick's test for that fix.
|
||||
|
||||
* tests/Makefile.am (SUBDIRS): Add md5sum-test.
|
||||
|
||||
Sat Sep 21 13:34:59 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/Makefile.am (check): Remove tests for md5sum.
|
||||
* tests/md5sum-test: New directory. Put them here instead.
|
||||
* configure.in (AC_OUTPUT): Add tests/md5sum-test/Makefile.
|
||||
|
||||
Thu Sep 19 08:54:05 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* tests/: Rename from checks.
|
||||
* Makefile.am (SUBDIRS): Change `checks' to `tests'.
|
||||
* configure.in (AC_OUTPUT): Likewise.
|
||||
|
||||
* configure.in ($PACKAGE, $VERSION): Don't AC_DEFINE_UNQUOTED these.
|
||||
AM_INIT_AUTOMAKE now does it (as of automake-1.1e).
|
||||
|
||||
Sun Sep 15 23:08:48 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Remove acinclude.m4.
|
||||
|
||||
Thu Sep 12 17:05:23 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* lib/Makefile.am (EXTRA_DIST): Add getline.c.
|
||||
(tu_SOURCES): Remove getline.c
|
||||
From Kaveh Ghazi.
|
||||
|
||||
Sun Sep 8 13:55:18 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* checks/sort-test/build-script.pl: Prefix $in with \$srcdir/
|
||||
so make check works with VPATH build. From Uli Drepper.
|
||||
|
||||
Sat Sep 7 12:25:42 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/system.h: Add comments justifying IS* versions of ctype.h macros.
|
||||
|
||||
* src/fmt.c (check_punctuation): Use ISPUNCT instead of ispunct.
|
||||
(get_line): Use ISSPACE instead of isspace. From Bruno Haible.
|
||||
|
||||
Mon Sep 2 10:34:46 1996 Jim Meyering <meyering@na-net.ornl.gov>
|
||||
|
||||
* src/*.c (usage): Tell where to report bugs.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Changes in release 1.20
|
||||
* fix bug in treatment by sort -f of bytes with high-bit set
|
||||
* update configuration system to use automake's aclocal program
|
||||
* configure performs sanity check on CC and CFLAGS to avoid a misleading
|
||||
failure that suggested cross-compiling was the cause
|
||||
|
||||
@@ -210,7 +210,8 @@ maintainer-clean: distclean
|
||||
|
||||
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
dist distdir: update-po $(DISTFILES)
|
||||
for file in $(DISTFILES); do \
|
||||
dists="$(DISTFILES)"; \
|
||||
for file in $$dists; do \
|
||||
ln $(srcdir)/$$file $(distdir) 2> /dev/null \
|
||||
|| cp -p $(srcdir)/$$file $(distdir); \
|
||||
done
|
||||
|
||||
@@ -1,27 +1,34 @@
|
||||
/* Copyright (C) 1989, 1991, 1993, 1994 Aladdin Enterprises. All rights reserved. */
|
||||
/* Copyright (C) 1989, 1991, 1993, 1994, 1995 Aladdin Enterprises. All rights reserved. */
|
||||
|
||||
/* ansi2knr.c */
|
||||
/* Convert ANSI function declarations to K&R syntax */
|
||||
/* Convert ANSI C function definitions to K&R ("traditional C") syntax */
|
||||
|
||||
/*
|
||||
ansi2knr is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY. No author or distributor accepts responsibility
|
||||
to anyone for the consequences of using it or for whether it serves any
|
||||
particular purpose or works at all, unless he says so in writing. Refer
|
||||
to the GNU General Public License for full details.
|
||||
ansi2knr is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY. No author or distributor accepts responsibility to anyone for the
|
||||
consequences of using it or for whether it serves any particular purpose or
|
||||
works at all, unless he says so in writing. Refer to the GNU General Public
|
||||
License (the "GPL") for full details.
|
||||
|
||||
Everyone is granted permission to copy, modify and redistribute
|
||||
ansi2knr, but only under the conditions described in the GNU
|
||||
General Public License. A copy of this license is supposed to have been
|
||||
given to you along with ansi2knr so you can know your rights and
|
||||
responsibilities. It should be in a file named COPYLEFT. Among other
|
||||
things, the copyright notice and this notice must be preserved on all
|
||||
copies.
|
||||
Everyone is granted permission to copy, modify and redistribute ansi2knr,
|
||||
but only under the conditions described in the GPL. A copy of this license
|
||||
is supposed to have been given to you along with ansi2knr so you can know
|
||||
your rights and responsibilities. It should be in a file named COPYLEFT.
|
||||
Among other things, the copyright notice and this notice must be preserved
|
||||
on all copies.
|
||||
|
||||
We explicitly state here what we believe is already implied by the GPL: if
|
||||
the ansi2knr program is distributed as a separate set of sources and a
|
||||
separate executable file which are aggregated on a storage medium together
|
||||
with another program, this in itself does not bring the other program under
|
||||
the GPL, nor does the mere fact that such a program or the procedures for
|
||||
constructing it invoke the ansi2knr executable bring any other part of the
|
||||
program under the GPL.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Usage:
|
||||
ansi2knr [--varargs] input_file [output_file]
|
||||
ansi2knr input_file [output_file]
|
||||
* If no output_file is supplied, output goes to stdout.
|
||||
* There are no error messages.
|
||||
*
|
||||
@@ -30,23 +37,29 @@ copies.
|
||||
* with a right parenthesis as the last character on the line.
|
||||
* It will recognize a multi-line header provided that the last character
|
||||
* of the last line of the header is a right parenthesis,
|
||||
* and no intervening line ends with a left brace or a semicolon.
|
||||
* and no intervening line ends with a left or right brace or a semicolon.
|
||||
* These algorithms ignore whitespace and comments, except that
|
||||
* the function name must be the first thing on the line.
|
||||
* The following constructs will confuse it:
|
||||
* - Any other construct that starts at the left margin and
|
||||
* follows the above syntax (such as a macro or function call).
|
||||
* - Macros that tinker with the syntax of the function header.
|
||||
*
|
||||
* If the --varargs switch is supplied, ansi2knr will attempt to
|
||||
* convert a ... argument to va_alist and va_dcl. If this switch is not
|
||||
* supplied, ansi2knr will simply drop any such arguments.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The original and principal author of ansi2knr is L. Peter Deutsch
|
||||
* <ghost@aladdin.com>. Other authors are noted in the change history
|
||||
* that follows (in reverse chronological order):
|
||||
lpd 95-06-22 removed #ifndefs whose sole purpose was to define
|
||||
undefined preprocessor symbols as 0; changed all #ifdefs
|
||||
for configuration symbols to #ifs
|
||||
lpd 95-04-05 changed copyright notice to make it clear that
|
||||
including ansi2knr in a program does not bring the entire
|
||||
program under the GPL
|
||||
lpd 94-12-18 added conditionals for systems where ctype macros
|
||||
don't handle 8-bit characters properly, suggested by
|
||||
Francois Pinard <pinard@iro.umontreal.ca>;
|
||||
removed --varargs switch (this is now the default)
|
||||
lpd 94-10-10 removed CONFIG_BROKETS conditional
|
||||
lpd 94-07-16 added some conditionals to help GNU `configure',
|
||||
suggested by Francois Pinard <pinard@iro.umontreal.ca>;
|
||||
@@ -59,14 +72,14 @@ copies.
|
||||
/* Most of the conditionals here are to make ansi2knr work with */
|
||||
/* the GNU configure machinery. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#if HAVE_CONFIG_H
|
||||
|
||||
/*
|
||||
For properly autoconfiguring ansi2knr, use AC_CONFIG_HEADER(config.h).
|
||||
@@ -90,7 +103,7 @@ copies.
|
||||
|
||||
#endif /* not HAVE_CONFIG_H */
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#if STDC_HEADERS
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
/*
|
||||
@@ -101,9 +114,28 @@ char *malloc();
|
||||
void free();
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The ctype macros don't always handle 8-bit characters correctly.
|
||||
* Compensate for this here.
|
||||
*/
|
||||
#ifdef isascii
|
||||
# undef HAVE_ISASCII /* just in case */
|
||||
# define HAVE_ISASCII 1
|
||||
#else
|
||||
#endif
|
||||
#if STDC_HEADERS || !HAVE_ISASCII
|
||||
# define is_ascii(c) 1
|
||||
#else
|
||||
# define is_ascii(c) isascii(c)
|
||||
#endif
|
||||
|
||||
#define is_space(c) (is_ascii(c) && isspace(c))
|
||||
#define is_alpha(c) (is_ascii(c) && isalpha(c))
|
||||
#define is_alnum(c) (is_ascii(c) && isalnum(c))
|
||||
|
||||
/* Scanning macros */
|
||||
#define isidchar(ch) (isalnum(ch) || (ch) == '_')
|
||||
#define isidfirstchar(ch) (isalpha(ch) || (ch) == '_')
|
||||
#define isidchar(ch) (is_alnum(ch) || (ch) == '_')
|
||||
#define isidfirstchar(ch) (is_alpha(ch) || (ch) == '_')
|
||||
|
||||
/* Forward references */
|
||||
char *skipspace();
|
||||
@@ -120,7 +152,16 @@ main(argc, argv)
|
||||
#define bufsize 5000 /* arbitrary size */
|
||||
char *buf;
|
||||
char *line;
|
||||
int convert_varargs = 0;
|
||||
/*
|
||||
* In previous versions, ansi2knr recognized a --varargs switch.
|
||||
* If this switch was supplied, ansi2knr would attempt to convert
|
||||
* a ... argument to va_alist and va_dcl; if this switch was not
|
||||
* supplied, ansi2knr would simply drop any such arguments.
|
||||
* Now, ansi2knr always does this conversion, and we only
|
||||
* check for this switch for backward compatibility.
|
||||
*/
|
||||
int convert_varargs = 1;
|
||||
|
||||
if ( argc > 1 && argv[1][0] == '-' )
|
||||
{ if ( !strcmp(argv[1], "--varargs") )
|
||||
{ convert_varargs = 1;
|
||||
@@ -135,7 +176,7 @@ main(argc, argv)
|
||||
switch ( argc )
|
||||
{
|
||||
default:
|
||||
printf("Usage: ansi2knr [--varargs] input_file [output_file]\n");
|
||||
printf("Usage: ansi2knr input_file [output_file]\n");
|
||||
exit(0);
|
||||
case 2:
|
||||
out = stdout;
|
||||
@@ -188,7 +229,7 @@ skipspace(p, dir)
|
||||
register char *p;
|
||||
register int dir; /* 1 for forward, -1 for backward */
|
||||
{ for ( ; ; )
|
||||
{ while ( isspace(*p) ) p += dir;
|
||||
{ while ( is_space(*p) ) p += dir;
|
||||
if ( !(*p == '/' && p[dir] == '*') ) break;
|
||||
p += dir; p += dir;
|
||||
while ( !(*p == '*' && p[dir] == '/') )
|
||||
@@ -241,6 +282,7 @@ test1(buf)
|
||||
case ';': contin = 0 /*2*/; break;
|
||||
case ')': contin = 1; break;
|
||||
case '{': return 0; /* not a function */
|
||||
case '}': return 0; /* not a function */
|
||||
default: contin = -1;
|
||||
}
|
||||
while ( isidchar(*p) ) p++;
|
||||
|
||||
@@ -133,7 +133,12 @@ change_file_mode (const char *file, const struct mode_change *changes,
|
||||
{
|
||||
if (verbose)
|
||||
describe_change (file, newmode, 1);
|
||||
if (chmod (file, (int) newmode))
|
||||
if (chmod (file, (int) newmode) == 0)
|
||||
{
|
||||
if (changes_only)
|
||||
describe_change (file, newmode, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (force_silent == 0)
|
||||
error (0, errno, "%s", file);
|
||||
@@ -285,7 +290,6 @@ main (int argc, char **argv)
|
||||
recurse = 1;
|
||||
break;
|
||||
case 'c':
|
||||
verbose = 1;
|
||||
changes_only = 1;
|
||||
break;
|
||||
case 'f':
|
||||
|
||||
53
src/cp.c
53
src/cp.c
@@ -253,7 +253,7 @@ main (int argc, char **argv)
|
||||
if (i < 0)
|
||||
{
|
||||
invalid_arg (_("sparse type"), optarg, i);
|
||||
usage (2, NULL);
|
||||
usage (1);
|
||||
}
|
||||
flag_sparse = sparse_type[i];
|
||||
}
|
||||
@@ -335,7 +335,7 @@ main (int argc, char **argv)
|
||||
break;
|
||||
|
||||
default:
|
||||
usage (2, (char *) 0);
|
||||
usage (1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,10 +346,13 @@ main (int argc, char **argv)
|
||||
}
|
||||
|
||||
if (show_help)
|
||||
usage (0, NULL);
|
||||
usage (0);
|
||||
|
||||
if (flag_hard_link && flag_symbolic_link)
|
||||
usage (2, _("cannot make both hard and symbolic links"));
|
||||
{
|
||||
error (0, 0, _("cannot make both hard and symbolic links"));
|
||||
usage (1);
|
||||
}
|
||||
|
||||
if (make_backups)
|
||||
backup_type = get_version (version);
|
||||
@@ -386,9 +389,15 @@ do_copy (int argc, char **argv)
|
||||
int ret = 0;
|
||||
|
||||
if (optind >= argc)
|
||||
usage (2, _("missing file arguments"));
|
||||
{
|
||||
error (0, 0, _("missing file arguments"));
|
||||
usage (1);
|
||||
}
|
||||
if (optind >= argc - 1)
|
||||
usage (2, _("missing destination file"));
|
||||
{
|
||||
error (0, 0, _("missing destination file"));
|
||||
usage (1);
|
||||
}
|
||||
|
||||
dest = argv[argc - 1];
|
||||
|
||||
@@ -491,8 +500,11 @@ do_copy (int argc, char **argv)
|
||||
struct stat source_stats;
|
||||
|
||||
if (flag_path)
|
||||
usage (2,
|
||||
{
|
||||
error (0, 0,
|
||||
_("when preserving paths, last argument must be a directory"));
|
||||
usage (1);
|
||||
}
|
||||
|
||||
source = argv[optind];
|
||||
|
||||
@@ -507,15 +519,23 @@ do_copy (int argc, char **argv)
|
||||
&& STREQ (source, dest)
|
||||
&& !new_dst && S_ISREG (sb.st_mode))
|
||||
{
|
||||
backup_type = none;
|
||||
new_dest = find_backup_file_name (dest);
|
||||
/* Set backup_type to `none' so that the normal backup
|
||||
mechanism is not used when performing the actual copy.
|
||||
backup_type must be set to `none' only *after* the above
|
||||
call to find_backup_file_name -- that function uses
|
||||
backup_type to determine the suffix it applies. */
|
||||
backup_type = none;
|
||||
if (new_dest == NULL)
|
||||
error (1, 0, _("virtual memory exhausted"));
|
||||
}
|
||||
|
||||
/* When the destination is specified with a trailing slash and the
|
||||
source exists but is not a directory, convert the user's command
|
||||
`cp source dest/' to `cp source dest/basename(source)'. */
|
||||
`cp source dest/' to `cp source dest/basename(source)'. Doing
|
||||
this ensures that the command `cp non-directory file/' will now
|
||||
fail rather than performing the copy. COPY diagnoses the case of
|
||||
`cp directory non-directory'. */
|
||||
|
||||
else if (dest[strlen (dest) - 1] == '/'
|
||||
&& lstat (source, &source_stats) == 0
|
||||
@@ -529,9 +549,9 @@ do_copy (int argc, char **argv)
|
||||
strip_trailing_slashes (tmp_source);
|
||||
source_base = basename (tmp_source);
|
||||
|
||||
new_dest = (char *) alloca (strlen (dest) + 1 +
|
||||
strlen (source_base) + 1);
|
||||
stpcpy (stpcpy (stpcpy (new_dest, dest), "/"), source_base);
|
||||
new_dest = (char *) alloca (strlen (dest)
|
||||
+ strlen (source_base) + 1);
|
||||
stpcpy (stpcpy (new_dest, dest), source_base);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -541,8 +561,13 @@ do_copy (int argc, char **argv)
|
||||
return copy (source, new_dest, new_dst, 0, (struct dir_list *) 0);
|
||||
}
|
||||
else
|
||||
usage (2,
|
||||
_("when copying multiple files, last argument must be a directory"));
|
||||
{
|
||||
error (0, 0,
|
||||
_("copying multiple files, but last argument (%s) \
|
||||
is not a directory"),
|
||||
dest);
|
||||
usage (1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Copy the file SRC_PATH to the file DST_PATH. The files may be of
|
||||
|
||||
@@ -106,11 +106,11 @@ usage (int status)
|
||||
{
|
||||
printf (_("Usage: %s [OPTION]... [FILE]\n"), program_name);
|
||||
printf (_("\
|
||||
Output commands to set the LS_COLOR environment variable.\n\
|
||||
Output commands to set the LS_COLORS environment variable.\n\
|
||||
\n\
|
||||
Determine format of output:\n\
|
||||
-b, --sh, --bourne-shell output Bourne shell code to set LS_COLOR\n\
|
||||
-c, --csh, --c-shell output C shell code to set LS_COLOR\n\
|
||||
-b, --sh, --bourne-shell output Bourne shell code to set LS_COLORS\n\
|
||||
-c, --csh, --c-shell output C shell code to set LS_COLORS\n\
|
||||
-p, --print-data-base output defaults\n\
|
||||
--help display this help and exit\n\
|
||||
--version output version information and exit\n\
|
||||
@@ -126,7 +126,7 @@ xstrndup (const char *s, size_t n)
|
||||
{
|
||||
char *new = strndup (s, n);
|
||||
if (new == NULL)
|
||||
error (EXIT_FAILURE, 0, _("Memory exhausted"));
|
||||
error (EXIT_FAILURE, 0, _("virtual memory exhausted"));
|
||||
return new;
|
||||
}
|
||||
|
||||
|
||||
@@ -631,7 +631,7 @@ get_line (FILE *f, register int c)
|
||||
*wptr++ = c;
|
||||
c = getc (f);
|
||||
}
|
||||
while (c != EOF && !isspace (c));
|
||||
while (c != EOF && !ISSPACE (c));
|
||||
in_column += word_limit->length = wptr - word_limit->text;
|
||||
check_punctuation (word_limit);
|
||||
|
||||
@@ -715,7 +715,7 @@ check_punctuation (register WORD *w)
|
||||
start = w->text;
|
||||
finish = start + (w->length - 1);
|
||||
w->paren = isopen (*start);
|
||||
w->punct = ispunct (*finish);
|
||||
w->punct = ISPUNCT (*finish);
|
||||
while (isclose (*finish) && finish > start)
|
||||
finish--;
|
||||
w->period = isperiod (*finish);
|
||||
|
||||
@@ -104,7 +104,6 @@ usage (int status)
|
||||
printf (_("\
|
||||
Usage: %s [OPTION] [FILE]...\n\
|
||||
or: %s [OPTION] --check [FILE]\n\
|
||||
or: %s [OPTION] --string=STRING ...\n\
|
||||
Print or check MD5 checksums.\n\
|
||||
With no FILE, or when FILE is -, read standard input.\n\
|
||||
\n\
|
||||
@@ -116,7 +115,6 @@ The following two options are useful only when verifying checksums:\n\
|
||||
--status don't output anything, status code shows success\n\
|
||||
-w, --warn warn about improperly formated MD5 checksum lines\n\
|
||||
\n\
|
||||
--string=STRING compute checksum for STRING\n\
|
||||
--help display this help and exit\n\
|
||||
--version output version information and exit\n\
|
||||
\n\
|
||||
|
||||
@@ -987,7 +987,8 @@ getmonth (const char *s, int len)
|
||||
static int
|
||||
keycompare (const struct line *a, const struct line *b)
|
||||
{
|
||||
register char *texta, *textb, *lima, *limb, *translate;
|
||||
register char *texta, *textb, *lima, *limb;
|
||||
register unsigned char *translate;
|
||||
register int *ignore;
|
||||
struct keyfield *key;
|
||||
int diff = 0, iter = 0, lena, lenb;
|
||||
@@ -995,7 +996,7 @@ keycompare (const struct line *a, const struct line *b)
|
||||
for (key = keyhead.next; key; key = key->next, ++iter)
|
||||
{
|
||||
ignore = key->ignore;
|
||||
translate = key->translate;
|
||||
translate = (unsigned char *) key->translate;
|
||||
|
||||
/* Find the beginning and limit of each field. */
|
||||
if (iter || a->keybeg == NULL || b->keybeg == NULL)
|
||||
@@ -1137,7 +1138,7 @@ keycompare (const struct line *a, const struct line *b)
|
||||
|
||||
CMP_WITH_IGNORE (translate[UCHAR (*texta)], translate[UCHAR (*textb)]);
|
||||
else if (ignore)
|
||||
CMP_WITH_IGNORE (*texta, *textb);
|
||||
CMP_WITH_IGNORE (UCHAR (*texta), UCHAR (*textb));
|
||||
else if (translate)
|
||||
while (texta < lima && textb < limb)
|
||||
{
|
||||
|
||||
19
src/system.h
19
src/system.h
@@ -300,6 +300,25 @@ char *alloca ();
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
/* Jim Meyering writes:
|
||||
|
||||
"... Some ctype macros are valid only for character codes that
|
||||
isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when
|
||||
using /bin/cc or gcc but without giving an ansi option). So, all
|
||||
ctype uses should be through macros like ISPRINT... If
|
||||
STDC_HEADERS is defined, then autoconf has verified that the ctype
|
||||
macros don't need to be guarded with references to isascii. ...
|
||||
Defining isascii to 1 should let any compiler worth its salt
|
||||
eliminate the && through constant folding."
|
||||
|
||||
Bruno Haible adds:
|
||||
|
||||
"... Furthermore, isupper(c) etc. have an undefined result if c is
|
||||
outside the range -1 <= c <= 255. One is tempted to write isupper(c)
|
||||
with c being of type `char', but this is wrong if c is an 8-bit
|
||||
character >= 128 which gets sign-extended to a negative value.
|
||||
The macro ISUPPER protects against this as well." */
|
||||
|
||||
#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
|
||||
#define IN_CTYPE_DOMAIN(c) 1
|
||||
#else
|
||||
|
||||
7
tests/cut/.cvsignore
Normal file
7
tests/cut/.cvsignore
Normal file
@@ -0,0 +1,7 @@
|
||||
cut-tests
|
||||
t*.out
|
||||
t*.in
|
||||
t*.exp
|
||||
t*.err
|
||||
build-script
|
||||
Makefile
|
||||
34
tests/cut/Makefile.am
Normal file
34
tests/cut/Makefile.am
Normal file
@@ -0,0 +1,34 @@
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.1c
|
||||
|
||||
x = cut
|
||||
t = t1 t2 t3 t4 t5 t6 t7 t8 t9 tA tB tC tD ta tb tc td te tf tg th \
|
||||
ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty tz
|
||||
|
||||
in = $(t:=.in)
|
||||
exp = $(t:=.exp)
|
||||
out = $(t:=.out)
|
||||
err = $(t:=.err)
|
||||
|
||||
EXTRA_DIST = build-script.pl Test.pm $x-tests $(in) $(exp)
|
||||
noinst_SCRIPTS = $x-tests build-script
|
||||
|
||||
PERL = @PERL@
|
||||
editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,@srcdir@,g'
|
||||
|
||||
TESTS = $x-tests
|
||||
|
||||
$x-tests: @MAINT@build-script Test.pm
|
||||
./build-script ../../src/$x > $@.n
|
||||
mv $@.n $@
|
||||
chmod 755 $@
|
||||
|
||||
SUFFIXES = .pl
|
||||
|
||||
.pl:
|
||||
rm -f $@ $@.tmp
|
||||
$(editpl) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
|
||||
|
||||
MAINTAINERCLEANFILES = $x-tests $(in) $(exp)
|
||||
CLEANFILES = $(out) $(err)
|
||||
193
tests/cut/Makefile.in
Normal file
193
tests/cut/Makefile.in
Normal file
@@ -0,0 +1,193 @@
|
||||
# Makefile.in generated automatically by automake 1.1e from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy, distribute and modify it.
|
||||
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ../..
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.1c
|
||||
|
||||
x = cut
|
||||
t = t1 t2 t3 t4 t5 t6 t7 t8 t9 tA tB tC tD ta tb tc td te tf tg th \
|
||||
ti tj tk tl tm tn to tp tq tr ts tt tu tv tw tx ty tz
|
||||
|
||||
in = $(t:=.in)
|
||||
exp = $(t:=.exp)
|
||||
out = $(t:=.out)
|
||||
err = $(t:=.err)
|
||||
|
||||
EXTRA_DIST = build-script.pl Test.pm $x-tests $(in) $(exp)
|
||||
noinst_SCRIPTS = $x-tests build-script
|
||||
|
||||
PERL = @PERL@
|
||||
editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,@srcdir@,g'
|
||||
|
||||
TESTS = $x-tests
|
||||
|
||||
SUFFIXES = .pl
|
||||
|
||||
MAINTAINERCLEANFILES = $x-tests $(in) $(exp)
|
||||
CLEANFILES = $(out) $(err)
|
||||
mkinstalldirs = $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SCRIPTS = $(noinst_SCRIPTS)
|
||||
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
|
||||
$(TEXINFOS) $(INFOS) $(MANS) $(EXTRA_DIST) $(DATA)
|
||||
DEP_DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
|
||||
$(TEXINFOS) $(INFO_DEPS) $(MANS) $(EXTRA_DIST) $(DATA)
|
||||
|
||||
TAR = tar
|
||||
default: all
|
||||
|
||||
|
||||
$(srcdir)/Makefile.in: @MAINT@Makefile.am $(top_srcdir)/configure.in
|
||||
cd $(top_srcdir) && automake $(subdir)/Makefile
|
||||
|
||||
Makefile: $(top_builddir)/config.status Makefile.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = tests/cut-test
|
||||
distdir: $(DEP_DISTFILES)
|
||||
@for file in `cd $(srcdir) && echo $(DISTFILES)`; do \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $(srcdir)/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $(srcdir)/$$file $(distdir)/$$file; \
|
||||
done
|
||||
check-TESTS: $(TESTS)
|
||||
@failed=0; all=0; \
|
||||
srcdir=$(srcdir); export srcdir; \
|
||||
for tst in $(TESTS); do \
|
||||
all=`expr $$all + 1`; \
|
||||
if test -f $$tst; then dir=.; \
|
||||
else dir="$(srcdir)"; fi; \
|
||||
if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \
|
||||
echo "PASS: $$tst"; \
|
||||
else \
|
||||
failed=`expr $$failed + 1`; \
|
||||
echo "FAIL: $$tst"; \
|
||||
fi; \
|
||||
done; \
|
||||
if test "$$failed" -eq 0; then \
|
||||
echo "========================"; \
|
||||
echo "All $$all tests passed"; \
|
||||
echo "========================"; \
|
||||
else \
|
||||
echo "$$failed of $$all tests failed"; \
|
||||
fi
|
||||
info:
|
||||
|
||||
dvi:
|
||||
|
||||
check: all check-TESTS
|
||||
|
||||
installcheck:
|
||||
|
||||
install-exec:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install-data:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install: install-exec install-data all
|
||||
@:
|
||||
|
||||
uninstall:
|
||||
|
||||
all: $(SCRIPTS) Makefile
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
|
||||
installdirs:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
distclean-generic:
|
||||
rm -f Makefile $(DISTCLEANFILES)
|
||||
rm -f config.cache config.log $(CONFIG_HEADER) stamp-h
|
||||
|
||||
maintainer-clean-generic:
|
||||
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean: mostlyclean-generic
|
||||
|
||||
clean: clean-generic mostlyclean
|
||||
|
||||
distclean: distclean-generic clean
|
||||
rm -f config.status
|
||||
|
||||
maintainer-clean: maintainer-clean-generic distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
.PHONY: default tags distdir check-TESTS info dvi check installcheck \
|
||||
install-exec install-data install uninstall all installdirs \
|
||||
mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
$x-tests: @MAINT@build-script Test.pm
|
||||
./build-script ../../src/$x > $@.n
|
||||
mv $@.n $@
|
||||
chmod 755 $@
|
||||
|
||||
.pl:
|
||||
rm -f $@ $@.tmp
|
||||
$(editpl) $< > $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .pl
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
62
tests/cut/Test.pm
Executable file
62
tests/cut/Test.pm
Executable file
@@ -0,0 +1,62 @@
|
||||
package Test;
|
||||
require 5.002;
|
||||
use strict;
|
||||
|
||||
my $nl = "\n";
|
||||
@Test::t = (
|
||||
# test flags input expected output expected return code
|
||||
#
|
||||
['1', '-d: -f1,3-', "a:b:c$nl", "a:c\n", 0],
|
||||
['2', '-d: -f1,3-', "a:b:c\n", "a:c\n", 0],
|
||||
['3', '-d: -f2-', "a:b:c$nl", "b:c\n", 0],
|
||||
['4', '-d: -f4', "a:b:c$nl", "\n", 0],
|
||||
['5', '-d: -f4', "", "", 0],
|
||||
['6', '-c4', "123$nl", "\n", 0],
|
||||
['7', '-c4', "123", "\n", 0],
|
||||
['8', '-c4', "123\n1", "\n\n", 0],
|
||||
['9', '-c4', "", "", 0],
|
||||
['a', '-s -d: -f3-', "a:b:c$nl", "c\n", 0],
|
||||
['b', '-s -d: -f2,3', "a:b:c$nl", "b:c\n", 0],
|
||||
['c', '-s -d: -f1,3', "a:b:c$nl", "a:c\n", 0],
|
||||
# Trailing colon should not be output
|
||||
['d', '-s -d: -f1,3', "a:b:c:$nl", "a:c\n", 0],
|
||||
['e', '-s -d: -f3-', "a:b:c:$nl", "c:\n", 0],
|
||||
['f', '-s -d: -f3-4', "a:b:c:$nl", "c:\n", 0],
|
||||
['g', '-s -d: -f3,4', "a:b:c:$nl", "c:\n", 0],
|
||||
# Make sure -s suppresses non-delimited lines
|
||||
['h', '-s -d: -f2,3', "abc\n", "", 0],
|
||||
#
|
||||
['i', '-d: -f1-3', ":::\n", "::\n", 0],
|
||||
['j', '-d: -f1-4', ":::\n", ":::\n", 0],
|
||||
['k', '-d: -f2-3', ":::\n", ":\n", 0],
|
||||
['l', '-d: -f2-4', ":::\n", "::\n", 0],
|
||||
['m', '-s -d: -f1-3', ":::\n", "::\n", 0],
|
||||
['n', '-s -d: -f1-4', ":::\n", ":::\n", 0],
|
||||
['o', '-s -d: -f2-3', ":::\n", ":\n", 0],
|
||||
['p', '-s -d: -f2-4', ":::\n", "::\n", 0],
|
||||
['q', '-s -d: -f2-4', ":::\n:\n", "::\n\n", 0],
|
||||
['r', '-s -d: -f2-4', ":::\n:1\n", "::\n1\n", 0],
|
||||
['s', '-s -d: -f1-4', ":::\n:a\n", ":::\n:a\n", 0],
|
||||
['t', '-s -d: -f3-', ":::\n:1\n", ":\n\n", 0],
|
||||
# Make sure it handles empty input properly, with and without -s.
|
||||
['u', '-s -f3-', "", "", 0],
|
||||
['v', '-f3-', "", "", 0],
|
||||
# Make sure it handles empty input properly.
|
||||
['w', '-b 1', "", "", 0],
|
||||
['x', '-s -d: -f2-4', ":\n", "\n", 0],
|
||||
# Errors
|
||||
# -s may be used only with -f
|
||||
['y', '-s -b4', ":\n", "", 1],
|
||||
# You must specify bytes or fields (or chars)
|
||||
['z', '', ":\n", "", 1],
|
||||
# Empty field list
|
||||
['A', '-f \'\'', ":\n", "", 1],
|
||||
# Missing field list
|
||||
['B', '-f', ":\n", "", 1],
|
||||
# Empty byte list
|
||||
['C', '-b \'\'', ":\n", "", 1],
|
||||
# Missing byte list
|
||||
['D', '-b', ":\n", "", 1],
|
||||
);
|
||||
|
||||
1;
|
||||
81
tests/cut/build-script.pl
Executable file
81
tests/cut/build-script.pl
Executable file
@@ -0,0 +1,81 @@
|
||||
#! @PERL@ -w
|
||||
# -*- perl -*-
|
||||
# @configure_input@
|
||||
|
||||
require 5.002;
|
||||
|
||||
BEGIN { push @INC, '@srcdir@' if '@srcdir@' ne '.'; }
|
||||
use strict;
|
||||
use Test;
|
||||
|
||||
$| = 1;
|
||||
|
||||
my $xx = $ARGV[0];
|
||||
|
||||
print <<EOF;
|
||||
#! /bin/sh
|
||||
# This script was generated automatically by build-script.
|
||||
case \$# in
|
||||
0) xx='$xx';;
|
||||
*) xx="\$1";;
|
||||
esac
|
||||
test "\$VERBOSE" && echo=echo || echo=:
|
||||
\$echo testing program: \$xx
|
||||
errors=0
|
||||
test "\$srcdir" || srcdir=.
|
||||
test "\$VERBOSE" && \$xx --version 2> /dev/null
|
||||
EOF
|
||||
|
||||
my %seen;
|
||||
|
||||
my $test_vector;
|
||||
foreach $test_vector (@Test::t)
|
||||
{
|
||||
my ($test_name, $flags, $input, $expected, $e_ret_code)
|
||||
= @{$test_vector};
|
||||
die "$0: $.: duplicate test name \`$test_name'\n"
|
||||
if (defined ($seen{$test_name}));
|
||||
$seen{$test_name} = 1;
|
||||
my $in = "t$test_name.in";
|
||||
my $exp_name = "t$test_name.exp";
|
||||
my $out = "t$test_name.out";
|
||||
|
||||
open (IN, ">$in") || die "$0: $in: $!\n";
|
||||
print IN $input;
|
||||
close (IN) || die "$0: $in: $!\n";
|
||||
open (EXP, ">$exp_name") || die "$0: $exp_name: $!\n";
|
||||
print EXP $expected;
|
||||
close (EXP) || die "$0: $exp_name: $!\n";
|
||||
|
||||
my $err_output = "t$test_name.err";
|
||||
my $cmd = "\$xx $flags \$srcdir/$in > $out 2> $err_output";
|
||||
$exp_name = "\$srcdir/$exp_name";
|
||||
print <<EOF ;
|
||||
$cmd
|
||||
code=\$?
|
||||
if test \$code != $e_ret_code ; then
|
||||
\$echo Test $test_name failed: $xx return code \$code differs from expected value $e_ret_code 1>&2
|
||||
errors=`expr \$errors + 1`
|
||||
else
|
||||
cmp $out $exp_name
|
||||
case \$? in
|
||||
0) if test "\$VERBOSE" ; then \$echo passed $test_name; fi ;; # equal files
|
||||
1) \$echo Test $test_name failed: files $out and $exp_name differ 1>&2;
|
||||
errors=`expr \$errors + 1` ;;
|
||||
2) \$echo Test $test_name may have failed. 1>&2;
|
||||
\$echo The command \"cmp $out $exp_name\" failed. 1>&2 ;
|
||||
errors=`expr \$errors + 1` ;;
|
||||
esac
|
||||
fi
|
||||
test -s $err_output || rm -f $err_output
|
||||
EOF
|
||||
}
|
||||
print <<EOF2 ;
|
||||
if test \$errors = 0 ; then
|
||||
\$echo Passed all tests. 1>&2
|
||||
else
|
||||
\$echo Failed \$errors tests. 1>&2
|
||||
fi
|
||||
test \$errors = 0 || errors=1
|
||||
exit \$errors
|
||||
EOF2
|
||||
6
tests/md5sum/Makefile.am
Normal file
6
tests/md5sum/Makefile.am
Normal file
@@ -0,0 +1,6 @@
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.1
|
||||
|
||||
TESTS = md5-rfc
|
||||
EXTRA_DIST = $(TESTS)
|
||||
162
tests/md5sum/Makefile.in
Normal file
162
tests/md5sum/Makefile.in
Normal file
@@ -0,0 +1,162 @@
|
||||
# Makefile.in generated automatically by automake 1.1e from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy, distribute and modify it.
|
||||
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ../..
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.1
|
||||
|
||||
TESTS = md5-rfc
|
||||
EXTRA_DIST = $(TESTS)
|
||||
mkinstalldirs = $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
|
||||
$(TEXINFOS) $(INFOS) $(MANS) $(EXTRA_DIST) $(DATA)
|
||||
DEP_DISTFILES = $(DIST_COMMON) $(SOURCES) $(BUILT_SOURCES) $(HEADERS) \
|
||||
$(TEXINFOS) $(INFO_DEPS) $(MANS) $(EXTRA_DIST) $(DATA)
|
||||
|
||||
TAR = tar
|
||||
default: all
|
||||
|
||||
|
||||
$(srcdir)/Makefile.in: @MAINT@Makefile.am $(top_srcdir)/configure.in
|
||||
cd $(top_srcdir) && automake $(subdir)/Makefile
|
||||
|
||||
Makefile: $(top_builddir)/config.status Makefile.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = tests/md5sum-test
|
||||
distdir: $(DEP_DISTFILES)
|
||||
@for file in `cd $(srcdir) && echo $(DISTFILES)`; do \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $(srcdir)/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $(srcdir)/$$file $(distdir)/$$file; \
|
||||
done
|
||||
check-TESTS: $(TESTS)
|
||||
@failed=0; all=0; \
|
||||
srcdir=$(srcdir); export srcdir; \
|
||||
for tst in $(TESTS); do \
|
||||
all=`expr $$all + 1`; \
|
||||
if test -f $$tst; then dir=.; \
|
||||
else dir="$(srcdir)"; fi; \
|
||||
if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \
|
||||
echo "PASS: $$tst"; \
|
||||
else \
|
||||
failed=`expr $$failed + 1`; \
|
||||
echo "FAIL: $$tst"; \
|
||||
fi; \
|
||||
done; \
|
||||
if test "$$failed" -eq 0; then \
|
||||
echo "========================"; \
|
||||
echo "All $$all tests passed"; \
|
||||
echo "========================"; \
|
||||
else \
|
||||
echo "$$failed of $$all tests failed"; \
|
||||
fi
|
||||
info:
|
||||
|
||||
dvi:
|
||||
|
||||
check: all check-TESTS
|
||||
|
||||
installcheck:
|
||||
|
||||
install-exec:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install-data:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install: install-exec install-data all
|
||||
@:
|
||||
|
||||
uninstall:
|
||||
|
||||
all: Makefile
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
|
||||
installdirs:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
distclean-generic:
|
||||
rm -f Makefile $(DISTCLEANFILES)
|
||||
rm -f config.cache config.log $(CONFIG_HEADER) stamp-h
|
||||
|
||||
maintainer-clean-generic:
|
||||
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean: mostlyclean-generic
|
||||
|
||||
clean: clean-generic mostlyclean
|
||||
|
||||
distclean: distclean-generic clean
|
||||
rm -f config.status
|
||||
|
||||
maintainer-clean: maintainer-clean-generic distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
.PHONY: default tags distdir check-TESTS info dvi check installcheck \
|
||||
install-exec install-data install uninstall all installdirs \
|
||||
mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
41
tests/md5sum/md5-rfc
Executable file
41
tests/md5sum/md5-rfc
Executable file
@@ -0,0 +1,41 @@
|
||||
#! /bin/sh
|
||||
|
||||
md5sum=${MD5SUM:-md5sum}
|
||||
|
||||
test "$VERBOSE" = yes && $md5sum --version
|
||||
|
||||
set - \
|
||||
1 d41d8cd98f00b204e9800998ecf8427e "" \
|
||||
2 0cc175b9c0f1b6a831c399e269772661 a \
|
||||
3 900150983cd24fb0d6963f7d28e17f72 abc \
|
||||
4 f96b697d7cb7938d525a2f31aaf161d0 'message digest' \
|
||||
5 c3fcd3d76192e4007dfb496cca67e13b abcdefghijklmnopqrstuvwxyz \
|
||||
6 d174ab98d277d9f5a5611c2c9f419d9f ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 \
|
||||
7 57edf4a22be3c955ac49da2e2107b67a 12345678901234567890123456789012345678901234567890123456789012345678901234567890 \
|
||||
LAST NA NA
|
||||
|
||||
fail=0
|
||||
while :; do
|
||||
test_name=$1
|
||||
test x$test_name = xLAST && break
|
||||
expected_result="$2 -"
|
||||
string=$3
|
||||
tmp=md-$$
|
||||
tmp_exp=$tmp.exp
|
||||
tmp_out=$tmp.out
|
||||
tmp_files="$tmp_exp $tmp_out"
|
||||
rm -f $tmp_files
|
||||
if test "$VERBOSE" = yes; then
|
||||
#echo "testing \`$nice $args $nice\` = $expected_result ..."
|
||||
echo "test $test_name... " | tr -d '\012'
|
||||
fi
|
||||
echo "$string"|tr -d '\012'| $md5sum - > $tmp_out
|
||||
echo "$expected_result" > $tmp_exp
|
||||
${DIFF:-diff} $tmp_out $tmp_exp \
|
||||
&& ok=ok || ok=FAIL fail=1
|
||||
test "$VERBOSE" = yes && echo $ok
|
||||
rm -f $tmp_files
|
||||
shift; shift; shift
|
||||
done
|
||||
|
||||
exit $fail
|
||||
@@ -3,20 +3,17 @@
|
||||
AUTOMAKE_OPTIONS = 1.1
|
||||
|
||||
x = sort
|
||||
in = \
|
||||
t01a.in t02a.in t02b.in t02c.in t02d.in t02e.in t02f.in t03a.in \
|
||||
t03b.in t03c.in t03d.in t03e.in t03f.in t03g.in t03h.in t03i.in \
|
||||
t04a.in t04b.in t04c.in t04d.in t04e.in t05a.in t05b.in t05c.in \
|
||||
t05d.in t05e.in t05f.in t06a.in t06b.in t06c.in t06d.in t06e.in \
|
||||
t06f.in t07a.in t07b.in t07c.in t07d.in t08a.in t08b.in t09a.in \
|
||||
t09b.in t09c.in t09d.in t10a.in t10a0.in t10a1.in t10a2.in t10b.in \
|
||||
t10c.in t10d.in t10e.in t10f.in t10g.in t11a.in t11b.in t11c.in \
|
||||
t11d.in t12a.in t12b.in t12c.in t12d.in t13a.in t13b.in t14a.in \
|
||||
t14b.in t15a.in t15b.in t15c.in t15d.in t15e.in
|
||||
t = \
|
||||
t01a t02a t02b t02c t02d t02e t02f t03a t03b t03c t03d t03e t03f t03g \
|
||||
t03h t03i t04a t04b t04c t04d t04e t05a t05b t05c t05d t05e t05f t06a t06b \
|
||||
t06c t06d t06e t06f t07a t07b t07c t07d t08a t08b t09a t09b t09c t09d t10a \
|
||||
t10a0 t10a1 t10a2 t10b t10c t10d t10e t10f t10g t11a t11b t11c t11d t12a \
|
||||
t12b t12c t12d t13a t13b t14a t14b t15a t15b t15c t15d t15e t16a
|
||||
|
||||
exp = $(in:.in=.exp)
|
||||
out = $(in:.in=.out)
|
||||
err = $(in:.in=.err)
|
||||
in = $(t:=.in)
|
||||
exp = $(t:=.exp)
|
||||
out = $(t:=.out)
|
||||
err = $(t:=.err)
|
||||
|
||||
EXTRA_DIST = build-script.pl Test.pm $x-tests $(in) $(exp)
|
||||
noinst_SCRIPTS = $x-tests
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Makefile.in generated automatically by automake 1.1c from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.1e from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
@@ -41,20 +41,17 @@ transform = @program_transform_name@
|
||||
AUTOMAKE_OPTIONS = 1.1
|
||||
|
||||
x = sort
|
||||
in = \
|
||||
t01a.in t02a.in t02b.in t02c.in t02d.in t02e.in t02f.in t03a.in \
|
||||
t03b.in t03c.in t03d.in t03e.in t03f.in t03g.in t03h.in t03i.in \
|
||||
t04a.in t04b.in t04c.in t04d.in t04e.in t05a.in t05b.in t05c.in \
|
||||
t05d.in t05e.in t05f.in t06a.in t06b.in t06c.in t06d.in t06e.in \
|
||||
t06f.in t07a.in t07b.in t07c.in t07d.in t08a.in t08b.in t09a.in \
|
||||
t09b.in t09c.in t09d.in t10a.in t10a0.in t10a1.in t10a2.in t10b.in \
|
||||
t10c.in t10d.in t10e.in t10f.in t10g.in t11a.in t11b.in t11c.in \
|
||||
t11d.in t12a.in t12b.in t12c.in t12d.in t13a.in t13b.in t14a.in \
|
||||
t14b.in t15a.in t15b.in t15c.in t15d.in t15e.in
|
||||
t = \
|
||||
t01a t02a t02b t02c t02d t02e t02f t03a t03b t03c t03d t03e t03f t03g \
|
||||
t03h t03i t04a t04b t04c t04d t04e t05a t05b t05c t05d t05e t05f t06a t06b \
|
||||
t06c t06d t06e t06f t07a t07b t07c t07d t08a t08b t09a t09b t09c t09d t10a \
|
||||
t10a0 t10a1 t10a2 t10b t10c t10d t10e t10f t10g t11a t11b t11c t11d t12a \
|
||||
t12b t12c t12d t13a t13b t14a t14b t15a t15b t15c t15d t15e t16a
|
||||
|
||||
exp = $(in:.in=.exp)
|
||||
out = $(in:.in=.out)
|
||||
err = $(in:.in=.err)
|
||||
in = $(t:=.in)
|
||||
exp = $(t:=.exp)
|
||||
out = $(t:=.out)
|
||||
err = $(t:=.err)
|
||||
|
||||
EXTRA_DIST = build-script.pl Test.pm $x-tests $(in) $(exp)
|
||||
noinst_SCRIPTS = $x-tests
|
||||
@@ -99,7 +96,7 @@ TAGS:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = checks/sort-test
|
||||
subdir = tests/sort-test
|
||||
distdir: $(DEP_DISTFILES)
|
||||
@for file in `cd $(srcdir) && echo $(DISTFILES)`; do \
|
||||
test -f $(distdir)/$$file \
|
||||
@@ -136,8 +133,10 @@ check: all check-TESTS
|
||||
installcheck:
|
||||
|
||||
install-exec:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install-data:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install: install-exec install-data all
|
||||
@:
|
||||
|
||||
@@ -120,6 +120,13 @@ use strict;
|
||||
["15c", '-i -u', "a\1\na\n", "a\1\n", 0],
|
||||
["15d", '-i -u', "\1a\na\n", "\1a\n", 0],
|
||||
["15e", '-i -u', "a\n\1\1\1\1\1a\1\1\1\1\n", "a\n", 0],
|
||||
|
||||
# From Erick Branderhorst -- fixed around 1.19e
|
||||
["16a", '-f',
|
||||
"éminence\nüberhaupt\n's-Gravenhage\naëroclub\nAag\naagtappels\n",
|
||||
"'s-Gravenhage\nAag\naagtappels\naëroclub\néminence\nüberhaupt\n",
|
||||
0],
|
||||
|
||||
);
|
||||
|
||||
1;
|
||||
|
||||
@@ -42,13 +42,13 @@ foreach $test_vector (@Test::t)
|
||||
|
||||
open (IN, ">$in") || die "$0: $in: $!\n";
|
||||
print IN $input;
|
||||
close (IN);
|
||||
open (EXP, ">$exp_name") || die "$0: $in: $!\n";
|
||||
close (IN) || die "$0: $in: $!\n";
|
||||
open (EXP, ">$exp_name") || die "$0: $exp_name: $!\n";
|
||||
print EXP $expected;
|
||||
close (EXP);
|
||||
close (EXP) || die "$0: $exp_name: $!\n";
|
||||
my $err_output = "t$test_name.err";
|
||||
|
||||
my $cmd = "\$xx $flags $in > $out 2> $err_output";
|
||||
my $cmd = "\$xx $flags \$srcdir/$in > $out 2> $err_output";
|
||||
$exp_name = "\$srcdir/$exp_name";
|
||||
print <<EOF ;
|
||||
$cmd
|
||||
|
||||
@@ -9,7 +9,7 @@ $echo testing program: $xx
|
||||
errors=0
|
||||
test "$srcdir" || srcdir=.
|
||||
test "$VERBOSE" && $xx --version 2> /dev/null
|
||||
$xx t01a.in > t01a.out 2> t01a.err
|
||||
$xx $srcdir/t01a.in > t01a.out 2> t01a.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 01a failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -26,7 +26,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t01a.err || rm -f t01a.err
|
||||
$xx -c t02a.in > t02a.out 2> t02a.err
|
||||
$xx -c $srcdir/t02a.in > t02a.out 2> t02a.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 02a failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -43,7 +43,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t02a.err || rm -f t02a.err
|
||||
$xx -c t02b.in > t02b.out 2> t02b.err
|
||||
$xx -c $srcdir/t02b.in > t02b.out 2> t02b.err
|
||||
code=$?
|
||||
if test $code != 1 ; then
|
||||
$echo Test 02b failed: ../../src/sort return code $code differs from expected value 1 1>&2
|
||||
@@ -60,7 +60,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t02b.err || rm -f t02b.err
|
||||
$xx -cu t02c.in > t02c.out 2> t02c.err
|
||||
$xx -cu $srcdir/t02c.in > t02c.out 2> t02c.err
|
||||
code=$?
|
||||
if test $code != 1 ; then
|
||||
$echo Test 02c failed: ../../src/sort return code $code differs from expected value 1 1>&2
|
||||
@@ -77,7 +77,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t02c.err || rm -f t02c.err
|
||||
$xx -cu t02d.in > t02d.out 2> t02d.err
|
||||
$xx -cu $srcdir/t02d.in > t02d.out 2> t02d.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 02d failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -94,7 +94,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t02d.err || rm -f t02d.err
|
||||
$xx -cu t02e.in > t02e.out 2> t02e.err
|
||||
$xx -cu $srcdir/t02e.in > t02e.out 2> t02e.err
|
||||
code=$?
|
||||
if test $code != 1 ; then
|
||||
$echo Test 02e failed: ../../src/sort return code $code differs from expected value 1 1>&2
|
||||
@@ -111,7 +111,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t02e.err || rm -f t02e.err
|
||||
$xx -cu t02f.in > t02f.out 2> t02f.err
|
||||
$xx -cu $srcdir/t02f.in > t02f.out 2> t02f.err
|
||||
code=$?
|
||||
if test $code != 1 ; then
|
||||
$echo Test 02f failed: ../../src/sort return code $code differs from expected value 1 1>&2
|
||||
@@ -128,7 +128,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t02f.err || rm -f t02f.err
|
||||
$xx -k1 t03a.in > t03a.out 2> t03a.err
|
||||
$xx -k1 $srcdir/t03a.in > t03a.out 2> t03a.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 03a failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -145,7 +145,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t03a.err || rm -f t03a.err
|
||||
$xx -k1,1 t03b.in > t03b.out 2> t03b.err
|
||||
$xx -k1,1 $srcdir/t03b.in > t03b.out 2> t03b.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 03b failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -162,7 +162,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t03b.err || rm -f t03b.err
|
||||
$xx -k1 -k2 t03c.in > t03c.out 2> t03c.err
|
||||
$xx -k1 -k2 $srcdir/t03c.in > t03c.out 2> t03c.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 03c failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -179,7 +179,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t03c.err || rm -f t03c.err
|
||||
$xx -k0 t03d.in > t03d.out 2> t03d.err
|
||||
$xx -k0 $srcdir/t03d.in > t03d.out 2> t03d.err
|
||||
code=$?
|
||||
if test $code != 2 ; then
|
||||
$echo Test 03d failed: ../../src/sort return code $code differs from expected value 2 1>&2
|
||||
@@ -196,7 +196,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t03d.err || rm -f t03d.err
|
||||
$xx -k1.0 t03e.in > t03e.out 2> t03e.err
|
||||
$xx -k1.0 $srcdir/t03e.in > t03e.out 2> t03e.err
|
||||
code=$?
|
||||
if test $code != 2 ; then
|
||||
$echo Test 03e failed: ../../src/sort return code $code differs from expected value 2 1>&2
|
||||
@@ -213,7 +213,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t03e.err || rm -f t03e.err
|
||||
$xx -k1.1,-k0 t03f.in > t03f.out 2> t03f.err
|
||||
$xx -k1.1,-k0 $srcdir/t03f.in > t03f.out 2> t03f.err
|
||||
code=$?
|
||||
if test $code != 2 ; then
|
||||
$echo Test 03f failed: ../../src/sort return code $code differs from expected value 2 1>&2
|
||||
@@ -230,7 +230,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t03f.err || rm -f t03f.err
|
||||
$xx -k1.1,1.0 t03g.in > t03g.out 2> t03g.err
|
||||
$xx -k1.1,1.0 $srcdir/t03g.in > t03g.out 2> t03g.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 03g failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -247,7 +247,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t03g.err || rm -f t03g.err
|
||||
$xx -k1.1,1 t03h.in > t03h.out 2> t03h.err
|
||||
$xx -k1.1,1 $srcdir/t03h.in > t03h.out 2> t03h.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 03h failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -264,7 +264,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t03h.err || rm -f t03h.err
|
||||
$xx -k1,1 t03i.in > t03i.out 2> t03i.err
|
||||
$xx -k1,1 $srcdir/t03i.in > t03i.out 2> t03i.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 03i failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -281,7 +281,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t03i.err || rm -f t03i.err
|
||||
$xx -nc t04a.in > t04a.out 2> t04a.err
|
||||
$xx -nc $srcdir/t04a.in > t04a.out 2> t04a.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 04a failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -298,7 +298,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t04a.err || rm -f t04a.err
|
||||
$xx -n t04b.in > t04b.out 2> t04b.err
|
||||
$xx -n $srcdir/t04b.in > t04b.out 2> t04b.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 04b failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -315,7 +315,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t04b.err || rm -f t04b.err
|
||||
$xx -k1n t04c.in > t04c.out 2> t04c.err
|
||||
$xx -k1n $srcdir/t04c.in > t04c.out 2> t04c.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 04c failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -332,7 +332,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t04c.err || rm -f t04c.err
|
||||
$xx -k1 t04d.in > t04d.out 2> t04d.err
|
||||
$xx -k1 $srcdir/t04d.in > t04d.out 2> t04d.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 04d failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -349,7 +349,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t04d.err || rm -f t04d.err
|
||||
$xx -k2 t04e.in > t04e.out 2> t04e.err
|
||||
$xx -k2 $srcdir/t04e.in > t04e.out 2> t04e.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 04e failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -366,7 +366,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t04e.err || rm -f t04e.err
|
||||
$xx -k1,2 t05a.in > t05a.out 2> t05a.err
|
||||
$xx -k1,2 $srcdir/t05a.in > t05a.out 2> t05a.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 05a failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -383,7 +383,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t05a.err || rm -f t05a.err
|
||||
$xx -k1,2 t05b.in > t05b.out 2> t05b.err
|
||||
$xx -k1,2 $srcdir/t05b.in > t05b.out 2> t05b.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 05b failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -400,7 +400,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t05b.err || rm -f t05b.err
|
||||
$xx -k1 -k2 t05c.in > t05c.out 2> t05c.err
|
||||
$xx -k1 -k2 $srcdir/t05c.in > t05c.out 2> t05c.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 05c failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -417,7 +417,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t05c.err || rm -f t05c.err
|
||||
$xx -k2,2 t05d.in > t05d.out 2> t05d.err
|
||||
$xx -k2,2 $srcdir/t05d.in > t05d.out 2> t05d.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 05d failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -434,7 +434,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t05d.err || rm -f t05d.err
|
||||
$xx -k2,2 t05e.in > t05e.out 2> t05e.err
|
||||
$xx -k2,2 $srcdir/t05e.in > t05e.out 2> t05e.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 05e failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -451,7 +451,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t05e.err || rm -f t05e.err
|
||||
$xx -k2,2 t05f.in > t05f.out 2> t05f.err
|
||||
$xx -k2,2 $srcdir/t05f.in > t05f.out 2> t05f.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 05f failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -468,7 +468,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t05f.err || rm -f t05f.err
|
||||
$xx -k 1,2 t06a.in > t06a.out 2> t06a.err
|
||||
$xx -k 1,2 $srcdir/t06a.in > t06a.out 2> t06a.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 06a failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -485,7 +485,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t06a.err || rm -f t06a.err
|
||||
$xx -k 1,2 t06b.in > t06b.out 2> t06b.err
|
||||
$xx -k 1,2 $srcdir/t06b.in > t06b.out 2> t06b.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 06b failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -502,7 +502,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t06b.err || rm -f t06b.err
|
||||
$xx -k 1 -k 2 t06c.in > t06c.out 2> t06c.err
|
||||
$xx -k 1 -k 2 $srcdir/t06c.in > t06c.out 2> t06c.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 06c failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -519,7 +519,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t06c.err || rm -f t06c.err
|
||||
$xx -k 2,2 t06d.in > t06d.out 2> t06d.err
|
||||
$xx -k 2,2 $srcdir/t06d.in > t06d.out 2> t06d.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 06d failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -536,7 +536,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t06d.err || rm -f t06d.err
|
||||
$xx -k 2,2 t06e.in > t06e.out 2> t06e.err
|
||||
$xx -k 2,2 $srcdir/t06e.in > t06e.out 2> t06e.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 06e failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -553,7 +553,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t06e.err || rm -f t06e.err
|
||||
$xx -k 2,2 t06f.in > t06f.out 2> t06f.err
|
||||
$xx -k 2,2 $srcdir/t06f.in > t06f.out 2> t06f.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 06f failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -570,7 +570,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t06f.err || rm -f t06f.err
|
||||
$xx -k 2,3 t07a.in > t07a.out 2> t07a.err
|
||||
$xx -k 2,3 $srcdir/t07a.in > t07a.out 2> t07a.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 07a failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -587,7 +587,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t07a.err || rm -f t07a.err
|
||||
$xx -k 2,3 t07b.in > t07b.out 2> t07b.err
|
||||
$xx -k 2,3 $srcdir/t07b.in > t07b.out 2> t07b.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 07b failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -604,7 +604,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t07b.err || rm -f t07b.err
|
||||
$xx -k 2,3 t07c.in > t07c.out 2> t07c.err
|
||||
$xx -k 2,3 $srcdir/t07c.in > t07c.out 2> t07c.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 07c failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -621,7 +621,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t07c.err || rm -f t07c.err
|
||||
$xx +1 -3 t07d.in > t07d.out 2> t07d.err
|
||||
$xx +1 -3 $srcdir/t07d.in > t07d.out 2> t07d.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 07d failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -638,7 +638,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t07d.err || rm -f t07d.err
|
||||
$xx -k 2.,3 t08a.in > t08a.out 2> t08a.err
|
||||
$xx -k 2.,3 $srcdir/t08a.in > t08a.out 2> t08a.err
|
||||
code=$?
|
||||
if test $code != 2 ; then
|
||||
$echo Test 08a failed: ../../src/sort return code $code differs from expected value 2 1>&2
|
||||
@@ -655,7 +655,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t08a.err || rm -f t08a.err
|
||||
$xx -k 2, t08b.in > t08b.out 2> t08b.err
|
||||
$xx -k 2, $srcdir/t08b.in > t08b.out 2> t08b.err
|
||||
code=$?
|
||||
if test $code != 2 ; then
|
||||
$echo Test 08b failed: ../../src/sort return code $code differs from expected value 2 1>&2
|
||||
@@ -672,7 +672,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t08b.err || rm -f t08b.err
|
||||
$xx -g t09a.in > t09a.out 2> t09a.err
|
||||
$xx -g $srcdir/t09a.in > t09a.out 2> t09a.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 09a failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -689,7 +689,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t09a.err || rm -f t09a.err
|
||||
$xx -n t09b.in > t09b.out 2> t09b.err
|
||||
$xx -n $srcdir/t09b.in > t09b.out 2> t09b.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 09b failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -706,7 +706,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t09b.err || rm -f t09b.err
|
||||
$xx -n t09c.in > t09c.out 2> t09c.err
|
||||
$xx -n $srcdir/t09c.in > t09c.out 2> t09c.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 09c failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -723,7 +723,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t09c.err || rm -f t09c.err
|
||||
$xx -k2g t09d.in > t09d.out 2> t09d.err
|
||||
$xx -k2g $srcdir/t09d.in > t09d.out 2> t09d.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 09d failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -740,7 +740,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t09d.err || rm -f t09d.err
|
||||
$xx -t : -k 2.2,2.2 t10a.in > t10a.out 2> t10a.err
|
||||
$xx -t : -k 2.2,2.2 $srcdir/t10a.in > t10a.out 2> t10a.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 10a failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -757,7 +757,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t10a.err || rm -f t10a.err
|
||||
$xx -t : +1.1 -1.2 t10b.in > t10b.out 2> t10b.err
|
||||
$xx -t : +1.1 -1.2 $srcdir/t10b.in > t10b.out 2> t10b.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 10b failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -774,7 +774,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t10b.err || rm -f t10b.err
|
||||
$xx -t : -k 2.2,2.2 t10c.in > t10c.out 2> t10c.err
|
||||
$xx -t : -k 2.2,2.2 $srcdir/t10c.in > t10c.out 2> t10c.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 10c failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -791,7 +791,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t10c.err || rm -f t10c.err
|
||||
$xx -t : +1.1 -1.2 t10d.in > t10d.out 2> t10d.err
|
||||
$xx -t : +1.1 -1.2 $srcdir/t10d.in > t10d.out 2> t10d.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 10d failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -808,7 +808,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t10d.err || rm -f t10d.err
|
||||
$xx -k 2.3,2.3 t10a0.in > t10a0.out 2> t10a0.err
|
||||
$xx -k 2.3,2.3 $srcdir/t10a0.in > t10a0.out 2> t10a0.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 10a0 failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -825,7 +825,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t10a0.err || rm -f t10a0.err
|
||||
$xx -k 1.2,1.2 t10a1.in > t10a1.out 2> t10a1.err
|
||||
$xx -k 1.2,1.2 $srcdir/t10a1.in > t10a1.out 2> t10a1.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 10a1 failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -842,7 +842,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t10a1.err || rm -f t10a1.err
|
||||
$xx -b -k 2.2,2.2 t10a2.in > t10a2.out 2> t10a2.err
|
||||
$xx -b -k 2.2,2.2 $srcdir/t10a2.in > t10a2.out 2> t10a2.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 10a2 failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -859,7 +859,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t10a2.err || rm -f t10a2.err
|
||||
$xx -k 1.2,1.2 t10e.in > t10e.out 2> t10e.err
|
||||
$xx -k 1.2,1.2 $srcdir/t10e.in > t10e.out 2> t10e.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 10e failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -876,7 +876,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t10e.err || rm -f t10e.err
|
||||
$xx -t : -k 1.3,1.3 t10f.in > t10f.out 2> t10f.err
|
||||
$xx -t : -k 1.3,1.3 $srcdir/t10f.in > t10f.out 2> t10f.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 10f failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -893,7 +893,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t10f.err || rm -f t10f.err
|
||||
$xx -k 1.4,1.4 t10g.in > t10g.out 2> t10g.err
|
||||
$xx -k 1.4,1.4 $srcdir/t10g.in > t10g.out 2> t10g.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 10g failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -910,7 +910,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t10g.err || rm -f t10g.err
|
||||
$xx -t: -k1,1b -k2,2 t11a.in > t11a.out 2> t11a.err
|
||||
$xx -t: -k1,1b -k2,2 $srcdir/t11a.in > t11a.out 2> t11a.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 11a failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -927,7 +927,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t11a.err || rm -f t11a.err
|
||||
$xx -t: -k1,1b -k2,2 t11b.in > t11b.out 2> t11b.err
|
||||
$xx -t: -k1,1b -k2,2 $srcdir/t11b.in > t11b.out 2> t11b.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 11b failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -944,7 +944,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t11b.err || rm -f t11b.err
|
||||
$xx -t: -k2,2b -k3,3 t11c.in > t11c.out 2> t11c.err
|
||||
$xx -t: -k2,2b -k3,3 $srcdir/t11c.in > t11c.out 2> t11c.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 11c failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -961,7 +961,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t11c.err || rm -f t11c.err
|
||||
$xx -t: -k2,2b -k3,3 t11d.in > t11d.out 2> t11d.err
|
||||
$xx -t: -k2,2b -k3,3 $srcdir/t11d.in > t11d.out 2> t11d.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 11d failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -978,7 +978,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t11d.err || rm -f t11d.err
|
||||
$xx -n -t: +1 t12a.in > t12a.out 2> t12a.err
|
||||
$xx -n -t: +1 $srcdir/t12a.in > t12a.out 2> t12a.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 12a failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -995,7 +995,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t12a.err || rm -f t12a.err
|
||||
$xx -n -t: +1 t12b.in > t12b.out 2> t12b.err
|
||||
$xx -n -t: +1 $srcdir/t12b.in > t12b.out 2> t12b.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 12b failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -1012,7 +1012,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t12b.err || rm -f t12b.err
|
||||
$xx -n -t: +1 t12c.in > t12c.out 2> t12c.err
|
||||
$xx -n -t: +1 $srcdir/t12c.in > t12c.out 2> t12c.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 12c failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -1029,7 +1029,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t12c.err || rm -f t12c.err
|
||||
$xx -n -t: +1 t12d.in > t12d.out 2> t12d.err
|
||||
$xx -n -t: +1 $srcdir/t12d.in > t12d.out 2> t12d.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 12d failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -1046,7 +1046,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t12d.err || rm -f t12d.err
|
||||
$xx +0.1n t13a.in > t13a.out 2> t13a.err
|
||||
$xx +0.1n $srcdir/t13a.in > t13a.out 2> t13a.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 13a failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -1063,7 +1063,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t13a.err || rm -f t13a.err
|
||||
$xx +0.1n t13b.in > t13b.out 2> t13b.err
|
||||
$xx +0.1n $srcdir/t13b.in > t13b.out 2> t13b.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 13b failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -1080,7 +1080,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t13b.err || rm -f t13b.err
|
||||
$xx -d -u t14a.in > t14a.out 2> t14a.err
|
||||
$xx -d -u $srcdir/t14a.in > t14a.out 2> t14a.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 14a failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -1097,7 +1097,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t14a.err || rm -f t14a.err
|
||||
$xx -f -d -u t14b.in > t14b.out 2> t14b.err
|
||||
$xx -f -d -u $srcdir/t14b.in > t14b.out 2> t14b.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 14b failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -1114,7 +1114,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t14b.err || rm -f t14b.err
|
||||
$xx -i -u t15a.in > t15a.out 2> t15a.err
|
||||
$xx -i -u $srcdir/t15a.in > t15a.out 2> t15a.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 15a failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -1131,7 +1131,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t15a.err || rm -f t15a.err
|
||||
$xx -i -u t15b.in > t15b.out 2> t15b.err
|
||||
$xx -i -u $srcdir/t15b.in > t15b.out 2> t15b.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 15b failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -1148,7 +1148,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t15b.err || rm -f t15b.err
|
||||
$xx -i -u t15c.in > t15c.out 2> t15c.err
|
||||
$xx -i -u $srcdir/t15c.in > t15c.out 2> t15c.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 15c failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -1165,7 +1165,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t15c.err || rm -f t15c.err
|
||||
$xx -i -u t15d.in > t15d.out 2> t15d.err
|
||||
$xx -i -u $srcdir/t15d.in > t15d.out 2> t15d.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 15d failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -1182,7 +1182,7 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t15d.err || rm -f t15d.err
|
||||
$xx -i -u t15e.in > t15e.out 2> t15e.err
|
||||
$xx -i -u $srcdir/t15e.in > t15e.out 2> t15e.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 15e failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
@@ -1199,6 +1199,23 @@ else
|
||||
esac
|
||||
fi
|
||||
test -s t15e.err || rm -f t15e.err
|
||||
$xx -f $srcdir/t16a.in > t16a.out 2> t16a.err
|
||||
code=$?
|
||||
if test $code != 0 ; then
|
||||
$echo Test 16a failed: ../../src/sort return code $code differs from expected value 0 1>&2
|
||||
errors=`expr $errors + 1`
|
||||
else
|
||||
cmp t16a.out $srcdir/t16a.exp
|
||||
case $? in
|
||||
0) if test "$VERBOSE" ; then $echo passed 16a; fi ;; # equal files
|
||||
1) $echo Test 16a failed: files t16a.out and $srcdir/t16a.exp differ 1>&2;
|
||||
errors=`expr $errors + 1` ;;
|
||||
2) $echo Test 16a may have failed. 1>&2;
|
||||
$echo The command "cmp t16a.out $srcdir/t16a.exp" failed. 1>&2 ;
|
||||
errors=`expr $errors + 1` ;;
|
||||
esac
|
||||
fi
|
||||
test -s t16a.err || rm -f t16a.err
|
||||
if test $errors = 0 ; then
|
||||
$echo Passed all tests. 1>&2
|
||||
else
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
# -*-perl-*-
|
||||
package Test;
|
||||
require 5.002;
|
||||
use strict;
|
||||
|
||||
@Test::t = (
|
||||
#test options input expected-output expected-return-code
|
||||
#
|
||||
["01a", '', "A\nB\nC\n", "A\nB\nC\n", 0],
|
||||
#
|
||||
["02a", '-c', "A\nB\nC\n", '', 0],
|
||||
["02b", '-c', "A\nC\nB\n", '', 1],
|
||||
# This should fail because there are duplicate keys
|
||||
["02c", '-cu', "A\nA\n", '', 1],
|
||||
["02d", '-cu', "A\nB\n", '', 0],
|
||||
["02e", '-cu', "A\nB\nB\n", '', 1],
|
||||
["02f", '-cu', "B\nA\nB\n", '', 1],
|
||||
#
|
||||
["03a", '-k1', "B\nA\n", "A\nB\n", 0],
|
||||
["03b", '-k1,1', "B\nA\n", "A\nB\n", 0],
|
||||
["03c", '-k1 -k2', "A b\nA a\n", "A a\nA b\n", 0],
|
||||
# FIXME: fail with a diagnostic when -k specifies field == 0
|
||||
["03d", '-k0', "", "", 2],
|
||||
# FIXME: fail with a diagnostic when -k specifies character == 0
|
||||
["03e", '-k1.0', "", "", 2],
|
||||
["03f", '-k1.1,-k0', "", "", 2],
|
||||
# This is ok.
|
||||
["03g", '-k1.1,1.0', "", "", 0],
|
||||
# This is equivalent to 3f.
|
||||
["03h", '-k1.1,1', "", "", 0],
|
||||
# This too, is equivalent to 3f.
|
||||
["03i", '-k1,1', "", "", 0],
|
||||
#
|
||||
["04a", '-nc', "2\n11\n", "", 0],
|
||||
["04b", '-n', "11\n2\n", "2\n11\n", 0],
|
||||
["04c", '-k1n', "11\n2\n", "2\n11\n", 0],
|
||||
["04d", '-k1', "11\n2\n", "11\n2\n", 0],
|
||||
["04e", '-k2', "ignored B\nz-ig A\n", "z-ig A\nignored B\n", 0],
|
||||
#
|
||||
["05a", '-k1,2', "A B\nA A\n", "A A\nA B\n", 0],
|
||||
["05b", '-k1,2', "A B A\nA A Z\n", "A A Z\nA B A\n", 0],
|
||||
["05c", '-k1 -k2', "A B A\nA A Z\n", "A A Z\nA B A\n", 0],
|
||||
["05d", '-k2,2', "A B A\nA A Z\n", "A A Z\nA B A\n", 0],
|
||||
["05e", '-k2,2', "A B Z\nA A A\n", "A A A\nA B Z\n", 0],
|
||||
["05f", '-k2,2', "A B A\nA A Z\n", "A A Z\nA B A\n", 0],
|
||||
#
|
||||
["06a", '-k 1,2', "A B\nA A\n", "A A\nA B\n", 0],
|
||||
["06b", '-k 1,2', "A B A\nA A Z\n", "A A Z\nA B A\n", 0],
|
||||
["06c", '-k 1 -k 2', "A B A\nA A Z\n", "A A Z\nA B A\n", 0],
|
||||
["06d", '-k 2,2', "A B A\nA A Z\n", "A A Z\nA B A\n", 0],
|
||||
["06e", '-k 2,2', "A B Z\nA A A\n", "A A A\nA B Z\n", 0],
|
||||
["06f", '-k 2,2', "A B A\nA A Z\n", "A A Z\nA B A\n", 0],
|
||||
#
|
||||
["07a", '-k 2,3', "9 a b\n7 a a\n", "7 a a\n9 a b\n", 0],
|
||||
["07b", '-k 2,3', "a a b\nz a a\n", "z a a\na a b\n", 0],
|
||||
["07c", '-k 2,3', "y k b\nz k a\n", "z k a\ny k b\n", 0],
|
||||
["07d", '+1 -3', "y k b\nz k a\n", "z k a\ny k b\n", 0],
|
||||
#
|
||||
# FIXME: report an error for `.' but missing char spec
|
||||
["08a", '-k 2.,3', "", "", 2],
|
||||
# FIXME: report an error for `,' but missing POS2
|
||||
["08b", '-k 2,', "", "", 2],
|
||||
#
|
||||
# Test new -g option.
|
||||
["09a", '-g', "1e2\n2e1\n", "2e1\n1e2\n", 0],
|
||||
# Make sure -n works how we expect.
|
||||
["09b", '-n', "1e2\n2e1\n", "1e2\n2e1\n", 0],
|
||||
["09c", '-n', "2e1\n1e2\n", "1e2\n2e1\n", 0],
|
||||
["09d", '-k2g', "a 1e2\nb 2e1\n", "b 2e1\na 1e2\n", 0],
|
||||
#
|
||||
# Bug reported by Roger Peel" <R.Peel@ee.surrey.ac.uk>
|
||||
["10a", '-t : -k 2.2,2.2', ":ba\n:ab\n", ":ba\n:ab\n", 0],
|
||||
# Equivalent to above, but using obsolescent `+pos -pos' option syntax.
|
||||
["10b", '-t : +1.1 -1.2', ":ba\n:ab\n", ":ba\n:ab\n", 0],
|
||||
#
|
||||
# The same as the preceding two, but with input lines reversed.
|
||||
["10c", '-t : -k 2.2,2.2', ":ab\n:ba\n", ":ba\n:ab\n", 0],
|
||||
# Equivalent to above, but using obsolescent `+pos -pos' option syntax.
|
||||
["10d", '-t : +1.1 -1.2', ":ab\n:ba\n", ":ba\n:ab\n", 0],
|
||||
# Try without -t...
|
||||
# But note that we have to count the delimiting space at the beginning
|
||||
# of each field that has it.
|
||||
["10a0", '-k 2.3,2.3', "z ba\nz ab\n", "z ba\nz ab\n", 0],
|
||||
["10a1", '-k 1.2,1.2', "ba\nab\n", "ba\nab\n", 0],
|
||||
["10a2", '-b -k 2.2,2.2', "z ba\nz ab\n", "z ba\nz ab\n", 0],
|
||||
#
|
||||
# An even simpler example demonstrating the bug.
|
||||
["10e", '-k 1.2,1.2', "ab\nba\n", "ba\nab\n", 0],
|
||||
#
|
||||
["10f", '-t : -k 1.3,1.3', ":ab\n:ba\n", ":ab\n:ba\n", 0],
|
||||
["10g", '-k 1.4,1.4', "a ab\nb ba\n", "a ab\nb ba\n", 0],
|
||||
#
|
||||
# Exercise bug re using -b to skip trailing blanks.
|
||||
["11a", '-t: -k1,1b -k2,2', "a\t:a\na :b\n", "a\t:a\na :b\n", 0],
|
||||
["11b", '-t: -k1,1b -k2,2', "a :b\na\t:a\n", "a\t:a\na :b\n", 0],
|
||||
["11c", '-t: -k2,2b -k3,3', "z:a\t:a\na :b\n", "z:a\t:a\na :b\n", 0],
|
||||
["11d", '-t: -k2,2b -k3,3', "z:a :b\na\t:a\n", "a\t:a\nz:a :b\n", 0],
|
||||
#
|
||||
# Exercise bug re comparing `-' and integers.
|
||||
["12a", '-n -t: +1', "a:1\nb:-\n", "b:-\na:1\n", 0],
|
||||
["12b", '-n -t: +1', "b:-\na:1\n", "b:-\na:1\n", 0],
|
||||
# Try some other (e.g. `X') invalid character.
|
||||
["12c", '-n -t: +1', "a:1\nb:X\n", "b:X\na:1\n", 0],
|
||||
["12d", '-n -t: +1', "b:X\na:1\n", "b:X\na:1\n", 0],
|
||||
# From Karl Heuer
|
||||
["13a", '+0.1n', "axx\nb-1\n", "b-1\naxx\n", 0],
|
||||
["13b", '+0.1n', "b-1\naxx\n", "b-1\naxx\n", 0],
|
||||
#
|
||||
# From Carl Johnson <carlj@cjlinux.home.org>
|
||||
["14a", '-d -u', "mal\nmal-\nmala\n", "mal\nmala\n", 0],
|
||||
# Be sure to fix the (translate && ignore) case in keycompare.
|
||||
["14b", '-f -d -u', "mal\nmal-\nmala\n", "mal\nmala\n", 0],
|
||||
#
|
||||
# Experiment with -i.
|
||||
["15a", '-i -u', "a\na\1\n", "a\n", 0],
|
||||
["15b", '-i -u', "a\n\1a\n", "a\n", 0],
|
||||
["15c", '-i -u', "a\1\na\n", "a\1\n", 0],
|
||||
["15d", '-i -u', "\1a\na\n", "\1a\n", 0],
|
||||
["15e", '-i -u', "a\n\1\1\1\1\1a\1\1\1\1\n", "a\n", 0],
|
||||
);
|
||||
|
||||
1;
|
||||
@@ -3,16 +3,15 @@
|
||||
AUTOMAKE_OPTIONS = 1.1c
|
||||
|
||||
x = tr
|
||||
in = \
|
||||
t1.in t2.in t3.in t4.in t5.in t6.in t7.in t8.in t9.in tA.in tB.in \
|
||||
tC.in tD.in tE.in tF.in tG.in tH.in tI.in tR0.0.in tR0.1.in tR1.0.in \
|
||||
tR1.1.in tR2.in tR3.in tR4.in tR5.in tR6.in ta.in tb.in tc.in td.in \
|
||||
te.in tf.in tg.in th.in ti.in tj.in tk.in tl.in tm.in tn.in to.in \
|
||||
tp.in tq.in tr.in ts.in tt.in tu.in tv.in tw.in tx.in ty.in tz.in
|
||||
t = \
|
||||
t1 t2 t3 t4 t5 t6 t7 t8 t9 tA tB tC tD tE tF tG tH tI tR0.0 tR0.1 tR1.0 \
|
||||
tR1.1 tR2 tR3 tR4 tR5 tR6 ta tb tc td te tf tg th ti tj tk tl tm tn to \
|
||||
tp tq tr ts tt tu tv tw tx ty tz
|
||||
|
||||
exp = $(in:.in=.exp)
|
||||
out = $(in:.in=.out)
|
||||
err = $(in:.in=.err)
|
||||
in = $(t:=.in)
|
||||
exp = $(t:=.exp)
|
||||
out = $(t:=.out)
|
||||
err = $(t:=.err)
|
||||
|
||||
EXTRA_DIST = build-script.pl Test.pm $x-tests $(in) $(exp)
|
||||
noinst_SCRIPTS = $x-tests
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Makefile.in generated automatically by automake 1.1c from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.1e from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
@@ -41,16 +41,15 @@ transform = @program_transform_name@
|
||||
AUTOMAKE_OPTIONS = 1.1c
|
||||
|
||||
x = tr
|
||||
in = \
|
||||
t1.in t2.in t3.in t4.in t5.in t6.in t7.in t8.in t9.in tA.in tB.in \
|
||||
tC.in tD.in tE.in tF.in tG.in tH.in tI.in tR0.0.in tR0.1.in tR1.0.in \
|
||||
tR1.1.in tR2.in tR3.in tR4.in tR5.in tR6.in ta.in tb.in tc.in td.in \
|
||||
te.in tf.in tg.in th.in ti.in tj.in tk.in tl.in tm.in tn.in to.in \
|
||||
tp.in tq.in tr.in ts.in tt.in tu.in tv.in tw.in tx.in ty.in tz.in
|
||||
t = \
|
||||
t1 t2 t3 t4 t5 t6 t7 t8 t9 tA tB tC tD tE tF tG tH tI tR0.0 tR0.1 tR1.0 \
|
||||
tR1.1 tR2 tR3 tR4 tR5 tR6 ta tb tc td te tf tg th ti tj tk tl tm tn to \
|
||||
tp tq tr ts tt tu tv tw tx ty tz
|
||||
|
||||
exp = $(in:.in=.exp)
|
||||
out = $(in:.in=.out)
|
||||
err = $(in:.in=.err)
|
||||
in = $(t:=.in)
|
||||
exp = $(t:=.exp)
|
||||
out = $(t:=.out)
|
||||
err = $(t:=.err)
|
||||
|
||||
EXTRA_DIST = build-script.pl Test.pm $x-tests $(in) $(exp)
|
||||
noinst_SCRIPTS = $x-tests
|
||||
@@ -95,7 +94,7 @@ TAGS:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = checks/tr-test
|
||||
subdir = tests/tr-test
|
||||
distdir: $(DEP_DISTFILES)
|
||||
@for file in `cd $(srcdir) && echo $(DISTFILES)`; do \
|
||||
test -f $(distdir)/$$file \
|
||||
@@ -132,8 +131,10 @@ check: all check-TESTS
|
||||
installcheck:
|
||||
|
||||
install-exec:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install-data:
|
||||
$(NORMAL_INSTALL)
|
||||
|
||||
install: install-exec install-data all
|
||||
@:
|
||||
|
||||
@@ -42,10 +42,11 @@ foreach $test_vector (@Test::t)
|
||||
|
||||
open (IN, ">$in") || die "$0: $in: $!\n";
|
||||
print IN $input;
|
||||
close (IN);
|
||||
open (EXP, ">$exp_name") || die "$0: $in: $!\n";
|
||||
close (IN) || die "$0: $in: $!\n";
|
||||
open (EXP, ">$exp_name") || die "$0: $exp_name: $!\n";
|
||||
print EXP $expected;
|
||||
close (EXP);
|
||||
close (EXP) || die "$0: $exp_name: $!\n";
|
||||
|
||||
my $err_output = "t$test_name.err";
|
||||
my $arg2 = ($s2 ? " '$s2'" : '');
|
||||
my $cmd = "\$xx $flags \'$s1\'$arg2 < \$srcdir/$in > $out 2> $err_output";
|
||||
|
||||
Reference in New Issue
Block a user