From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 29-AUG-1989 13:55
To:	MRGATE::"ARISIA::EVERHART"
Subj:	TAR REreREreDISTR - notice for Stephan Hippler - also posted to infovax/comp.os.vms

Message-Id:  <8908291747.AA26463@crdgw1.ge.com>
Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Tue, 29 AUG 89 10:18:39 PDT
Received: from CUSPIF.TN.CORNELL.EDU by KL.SRI.COM with TCP; Tue, 29 Aug 89 09:53:25 PDT
Date: 29 Aug 1989 12:54:54 EST
From: Brian.T.Carcich@CUSPIF.TN.CORNELL.EDU
To: hippler%dhdmpi50.bitnet@cornellc, info-vax@kl.sri.com
Subject: TAR REreREreDISTR - notice for Stephan Hippler - also posted to infovax/comp.os.vms
X-Vms-Original-To: INET%"hippler%dhdmpi50.bitnet@cornellc",INET%"info-vax@kl.sri.com",CARCICH     


$ aver=f$verify(0)
$ on error then $ goto errex
$ !
$ ! Stefan,
$ ! My gut feel is that the files came over to you ok, but
$ ! somehow were not extracted/save from mail/readnews and put together
$ ! properly.  I have put together the following program which fixes 
$ ! most incorrect linebreaks in VMS_SHAR files that seem to occur when mixing
$ ! VMS and Eunuchs(tm) files.  To use it:
$ !
$ ! Extract this mail message without headers as rfxshar.com 
$ ! in the directory that has the VMS_SHAR .COM file in it.   
$ !
$ ! Edit the first section of that file to ensure that it has proper 
$ ! linebreaks in it up to the "$START:" label after the UNPACK subroutine.
$ !
$ ! @RFXSHAR (this file) and give it just the filename (i.e. exclude
$ ! the filetype) and let it run.
$ !
$ ! Good Luck, Brian Carcich
$ !
$ set="set"
$ set=="set"
$ set symbol/scope=(nolocal,noglobal)
$ !
$ type sys$input

*** FIXSHAR.COM ***

Fixes most incorrect linebreaks in VMS_SHAR.COM files

Please ensure the input VMS_SHAR file (concatenated from "MAIL> EXTRACT" or 
"READNEWS> s"):

  (1) has proper linebreaks up to the "$START:" label;
  (2) has filetype ".COM"

$ read/end=skip0 sys$command aaa/prompt=-
"Hit <CR> to exit and manually confirm/fix the above; hit ^Z to continue:"
$ exit
$ !
$skip0:
$ close/nolog aaa
$ infil="''p1'"
$ if infil .eqs. "" then $ inquire infil "Enter filename (must be .COM)"
$ innam=f$parse(infil,,,"name")
$ open/wri aaa for000.dat
$ write aaa innam
$ close aaa
$ !
$ if f$search("fixshar.exe") .nes. "" then $ goto skipbld
$ creates fixshar.for
$DECK
        LOGICAL CHECKIT /.FALSE./
        CHARACTER INCHAR1*100, INCHAR2*100, INCHAR*100, COMBQUERY*1
        PARAMETER CHKSTR = '$START:'
C
00001        READ (0, 90000) LINP, INCHAR
90000        FORMAT(Q,A)
        IF ( LINP .LT. 1) GOTO 00001
        CALL LIB$GET_LUN( IOIN)
        CALL LIB$GET_LUN( IOOUT)
        OPEN( IOIN, READONLY, STATUS='OLD', FILE=INCHAR(:LINP)//'.COM')
        OPEN( IOOUT, STATUS='NEW', FILE=INCHAR(:LINP)//'FIXED.COM'
     &                , CARRIAGECONTROL='LIST', DISP='DELETE')
        READ( IOIN, 90000) LINP1, INCHAR1
00002        CONTINUE
        READ( IOIN, 90000, END=00006) LINP2, INCHAR2
        IF ( LINP2 .LT. 1) GOTO 00002
        IF ( .NOT. CHECKIT) GOTO 00005
        IF ( INDEX( 'X$V', INCHAR2(:1)) .NE. 0) GOTO 00005
        IF ( INCHAR1(LINP1:LINP1) .EQ. '-' 
     &                .AND. INCHAR1(:1) .EQ. '$') GOTO 00005

00003        CONTINUE
        TYPE *, 'COMBINE "' // INCHAR1(:LINP1) //'"'
        TYPE *, 'AND     "' // INCHAR2(:LINP2) //'"'
        IF ( COMBQUERY .EQ. 'A') GOTO 00004
        TYPE *, '^Z FOR YES; <CR> FOR NO'
        READ ( *, 90000, END=00004) LINP, INCHAR
        IF ( LINP .EQ. 0) GOTO 00005
        IF ( LINP .NE. 1 
     &                .OR. INCHAR(:1) .NE. 'A' .OR. INCHAR(:1) .NE. 'a')
     &                        GOTO 00003
        IF ( INCHAR(:1) .EQ. 'A' .OR. INCHAR(:1) .EQ. 'a')
     &                COMBQUERY = 'A'

00004        CONTINUE
        INCHAR1 = INCHAR1(:LINP1) // INCHAR2( :LINP2)
        LINP1 = LINP1 + LINP2
        GOTO 00002

00005        CONTINUE
        WRITE( IOOUT, 90001) INCHAR1(:LINP1)
90001        FORMAT( A)
        INCHAR1 = INCHAR2
        LINP1 = LINP2
        IF ( INCHAR1( :LEN(CHKSTR)) .EQ. CHKSTR) CHECKIT = .TRUE.
        GOTO 00002

00006        CONTINUE
        IF ( LINP1 .GT. 0) WRITE( IOOUT, 90001) INCHAR1(:LINP1)
        CLOSE( IOIN)
        CLOSE( IOOUT, DISP='KEEP')
        END
$EOD
$ !
$ fortran fixshar
$ link fixshar
$ !
$skipbld:
$ define/user sys$input nl:
$ run fixshar
$ !
$errex:
$ aver='f$verify(aver)'

