From:	AITGW::"ake%DAYTON.SAIC.COM@VM1.NoDak.EDU" "Earle Ake" 11-AUG-1991 22:44:02.08
To:	Multiple recipients of list ANU-NEWS <ANU-NEWS@NDSUVM1>
CC:	
Subj:	FIX for incorrect VMS version in Relay-Version lineREFRESH

Received: by AITGW.DECnet (utk-mail11 v1.5) ; Sun, 11 Aug 91 22:41:27 EDT
Received: from vm1.NoDak.edu by aitgw.ge.com (5.61/GE Gateway 1.3)
	id AA19011; Sun, 11 Aug 91 22:41:13 -0400
Message-Id: <9108120241.AA19011@aitgw.ge.com>
Received: from NDSUVM1.BITNET by VM1.NoDak.EDU (IBM VM SMTP R1.2.1MX) with BSMTP id 6528; Sun, 11 Aug 91 21:39:49 CDT
Received: from NDSUVM1.BITNET by NDSUVM1.BITNET (Mailer R2.07) with BSMTP id
 7802; Sun, 11 Aug 91 21:39:48 CDT
Date:         Mon, 12 Aug 1991 00:59:53 GMT
Reply-To: Earle Ake <ake%DAYTON.SAIC.COM@VM1.NoDak.EDU>
Sender: ANU-NEWS Discussion <ANU-NEWS@VM1.NoDak.EDU>
From: Earle Ake <ake%DAYTON.SAIC.COM@VM1.NoDak.EDU>
Subject:      FIX for incorrect VMS version in Relay-Version lineREFRESH
To: Multiple recipients of list ANU-NEWS <ANU-NEWS@NDSUVM1>
 
        Below is a small patch to have the "Relay-Version" news header reflect
the ACTUAL VMS version of the system.  Currently even if you are running VMS
5.4-2, the header shows up as:
 
 
Relay-Version: VMS News - V6.0-3 14/03/91 VAX/VMS V5.4;
 
 
        With this patch, the header will now read:
 
 
Relay-Version: VMS News - V6.0-3 14/03/91 VAX/VMS V5.4-2;
 
 
It isn't really important, just something that bugged me so I fixed it.
 
Earle
_____________________________________________________________________________
             ____ ____    ___
Earle Ake   /___ /___/ / /     Science Applications International Corporation
           ____//   / / /__                 Dayton, Ohio
-----------------------------------------------------------------------------
Internet: ake@dayton.saic.com        uucp: dayvb!ake         SPAN: 28284::ake
 
 
$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
$!
$! This archive created by VMS_SHARE Version 7.2-007  22-FEB-1990
$!   On 11-AUG-1991 20:54:10.75   By user AKE (Earle Ake - SAIC (513) 429-6500)
$!
$! This VMS_SHARE Written by:
$!    Andy Harper, Kings College London UK
$!
$! Acknowledgements to:
$!    James Gray       - Original VMS_SHARE
$!    Michael Bednarek - Original Concept and implementation
$!
$! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
$! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
$!
$! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
$!       1. VMS-VERSION.PATCH;1
$!
$set="set"
$set symbol/scope=(nolocal,noglobal)
$f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
$e="write sys$error  ""%UNPACK"", "
$w="write sys$output ""%UNPACK"", "
$ if f$trnlnm("SHARE_LOG") then $ w = "!"
$ ve=f$getsyi("version")
$ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START
$ e "-E-OLDVER, Must run at least VMS 4.4"
$ v=f$verify(v)
$ exit 44
$UNPACK: SUBROUTINE ! P1=filename, P2=checksum
$ if f$search(P1) .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped."
$ delete 'f'*
$ exit
$file_absent:
$ if f$parse(P1) .nes. "" then $ goto dirok
$ dn=f$parse(P1,,,"DIRECTORY")
$ w "-I-CREDIR, Creating directory ''dn'."
$ create/dir 'dn'
$ if $status then $ goto dirok
$ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
$ delete 'f'*
$ exit
$dirok:
$ w "-I-PROCESS, Processing file ''P1'."
$ if .not. f$verify() then $ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:=
CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b));
LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1);
IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE;
MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1;
ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")=
1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF";
POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r);
ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1;
COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE,
"output_file"));ENDPROCEDURE;Unpacker;QUIT;
$ delete/nolog 'f'*
$ CHECKSUM 'P1'
$ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
$ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ ENDSUBROUTINE
$START:
$ create 'f'
X*** newsvariables.h-old
X--- newsvariables.h
X**************
X*** 152,158
X        nntp_node`5Biv(256)`5D,`09/* nntp reader variable */
X        n_class_name`5Biv(256)`5D,
X        profile_dirstr`5Biv(132)`5D,
X!       scangroups`5B512`5D;
X `20
X `20
X  global_var
X--- 152,159 -----
X        nntp_node`5Biv(256)`5D,`09/* nntp reader variable */
X        n_class_name`5Biv(256)`5D,
X        profile_dirstr`5Biv(132)`5D,
X!       scangroups`5B512`5D,
X!       VMS_VERS`5B11`5D;`09`09/* holds VMS version string */
X `20
X `20
X  global_var
X*** newssite.c-old;0
X--- newssite.c
X**************
X*** 60,66
X  static char mgrid`5B256`5D,
X              nopostid`5B256`5D,
X              postid`5B256`5D,
X!             version`5B4`5D;
X `20
X  static struct itv `7B
X      short bl;
X--- 60,66 -----
X  static char mgrid`5B256`5D,
X              nopostid`5B256`5D,
X              postid`5B256`5D,
X!             version`5B11`5D;
X `20
X  static struct itv `7B
X      short bl;
X**************
X*** 67,73
X      short code;
X      char *ba;
X      unsigned short *rl;
X!     `7D ver_item`5B`5D= `7B`7B4,SYI$_VERSION,(char *) &version,0`7D, `7B0,
V0,0,0`7D`7D;
X  `0C
X  /*
X   *  site_get_env
X--- 67,73 -----
X      short code;
X      char *ba;
X      unsigned short *rl;
X!     `7D ver_item`5B`5D= `7B`7B10,SYI$_VERSION,(char *) &version,0`7D, `7B0
V,0,0,0`7D`7D;
X  `0C
X  /*
X   *  site_get_env
X**************
X*** 97,102
X  `20
X    sys$getsyiw(0,0,0,ver_item,0,0,0);
X    sscanf(version,"V%d.%d",&vms_major,&vms_minor);
X    sprintf(Post_file,"SYS$SCRATCH:POST_NEWS_%X.TMP",getpid());
X    sprintf(Mail_file,"SYS$SCRATCH:MAIL_NEWS_%X.TMP",getpid());
X    strcpy(Extract_file,getenv("SYS$LOGIN"));
X--- 97,107 -----
X  `20
X    sys$getsyiw(0,0,0,ver_item,0,0,0);
X    sscanf(version,"V%d.%d",&vms_major,&vms_minor);
X+   strcpy(VMS_VERS,version);
X+   if (p = strchr(VMS_VERS,' '))
X+     *p = '\0';
X+   else
X+     VMS_VERS`5B10`5D = '\0';
X    sprintf(Post_file,"SYS$SCRATCH:POST_NEWS_%X.TMP",getpid());
X    sprintf(Mail_file,"SYS$SCRATCH:MAIL_NEWS_%X.TMP",getpid());
X    strcpy(Extract_file,getenv("SYS$LOGIN"));
X*** newsadd.c-old;1
X--- newsadd.c
X**************
X*** 392,399
X    char oline`5B1024`5D, head`5B30`5D;
X    int i;
X `20
X!   sprintf(oline,"%s%s %s VAX/VMS V%d.%d; site %s\n",fheaders`5BRELAY_VERSI
VON`5D,
X!         NEWS_VERSION,NEWS_DDATE, vms_major,vms_minor,Node_address);
X    fout_line(oline,fpl);
X    for (i = 0; i < OHEADERS; ++i) `7B
X      if (i == PATH) `7B
X--- 392,399 -----
X    char oline`5B1024`5D, head`5B30`5D;
X    int i;
X `20
X!   sprintf(oline,"%s%s %s VAX/VMS %s; site %s\n",fheaders`5BRELAY_VERSION`5
VD,
X!         NEWS_VERSION,NEWS_DDATE, VMS_VERS,Node_address);
X    fout_line(oline,fpl);
X    for (i = 0; i < OHEADERS; ++i) `7B
X      if (i == PATH) `7B
X**************
X*** 1303,1309
X      `7D
X `20
X    /*----- write out the relay version immediately */
X!   sprintf(inbuf,"%s %s VAX/VMS V%d.%d; site %s",NEWS_VERSION,NEWS_DDATE, v
Vms_major,vms_minor,Node_address);
X    strcpy((known_headers`5BRELAY_VERSION`5D = malloc(strlen(inbuf) + 1)),in
Vbuf);
X    fprintf(outfile,"%s%s\n",fheaders`5BRELAY_VERSION`5D,inbuf);
X    ++o_line_count;
X--- 1303,1309 -----
X      `7D
X `20
X    /*----- write out the relay version immediately */
X!   sprintf(inbuf,"%s %s VAX/VMS %s; site %s",NEWS_VERSION,NEWS_DDATE, VMS_V
VERS,Node_address);
X    strcpy((known_headers`5BRELAY_VERSION`5D = malloc(strlen(inbuf) + 1)),in
Vbuf);
X    fprintf(outfile,"%s%s\n",fheaders`5BRELAY_VERSION`5D,inbuf);
X    ++o_line_count;
$ CALL UNPACK VMS-VERSION.PATCH;1 658501238
$ v=f$verify(v)
$ EXIT
