ar(1) chokes on this very simple file

Kevin O'Gorman kevin at kosman.UUCP
Sat Jun 17 13:22:08 AEST 1989


I'm using ar(1) to make an archive of program sources, for an interpreter
that works best searching such archives.  Of 800-some-odd programs, one
causes ar(1) to choke and foul up.

I'm running 3.51, using the new archive stuff.

Does anyone have the slightest idea what it is about this one file that
makes ar start acting so weird?  I'm inclosing a shar of 2 of the files.
FSE2K.m is the culprit.  It's 16 bytes long, and like all of the files,
it is pure printable ASCII.  I don't even think they have TAB characters.

Fortunately, as you'll see from the contents of the file, it is dispensable
and exists just to explain a (possible) error message when running the
programs.  I will dispense with it, but such things worry me.

To get the problem I have been seeing, unshar the stuff below, and do

	ar qv ARCHIVE *.m

It should complain of a badly formed archive.  You also get errors on
using a key of rv.

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  A.m FSE2K.m
# Wrapped by kevin at kosman on Fri Jun 16 20:17:11 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'A.m' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'A.m'\"
else
echo shar: Extracting \"'A.m'\" \(664 characters\)
sed "s/^X//" >'A.m' <<'END_OF_FILE'
XA ;MAW,KSR;11 NOV 82/3    ;TOTAL SALES FOR A BOOK
X K  R "BOOK CODE: ",BC,!,"BOOK YEAR: ",BY,!
X S GL=$$zn(4,"^C","B",BC,BY),V=GL,%S=6
XB S GL=$$zo2(.CUS,$$zn(1,GL))
X I $$zn2(4,1,GL)'=V W !!,"TOTAL SALES = ",$J(T,0,2),! Q 
X N L,LS S L=$L($$zn2(%S-1,1,GL)),LS=$L($$zn2(%S,1,GL)) S %D=$E(GL,L+(%S>1)+(%S=2),LS-(%S>1)) S:$E(%D)="""" %D=$E(%D,2,$L(%D)-1) K L,LS
X S T=T+^ARL(0,CUS,"RO",%D,"B")
X G B
X Q  ;insulate from trailer
Xzn(knt,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,%,pos,plc,char,req) s %debug=$ZN g zn^%zlib
Xzn2(req,knt,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,%,pos,plc,char) s %debug=$ZN g zn2^%zlib
Xzo2(val,arg) s %debug=$ZN g zo2^%zlib
END_OF_FILE
if test 664 -ne `wc -c <'A.m'`; then
    echo shar: \"'A.m'\" unpacked with wrong size!
fi
# end of 'A.m'
fi
if test -f 'FSE2K.m' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'FSE2K.m'\"
else
echo shar: Extracting \"'FSE2K.m'\" \(16 characters\)
sed "s/^X//" >'FSE2K.m' <<'END_OF_FILE'
XFSE2K ;obsolete
END_OF_FILE
if test 16 -ne `wc -c <'FSE2K.m'`; then
    echo shar: \"'FSE2K.m'\" unpacked with wrong size!
fi
# end of 'FSE2K.m'
fi
echo shar: End of shell archive.
exit 0



More information about the Unix-pc.general mailing list