From:	SMTP%"bailey@HMIVAX.HUMGEN.UPENN.EDU" 27-MAY-1994 08:37:06.04
To:	EVERHART
CC:	
Subj:	Patch: /DotNewsRC qual should override profile

Message-Id: <9405270906.AA15969@uu7.psi.com>
Date:         Fri, 27 May 1994 02:27:13 EDT
Reply-To: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU>
Sender: ANU-NEWS Discussion <ANU-NEWS@VM1.NoDak.EDU>
From: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU>
Organization: HHMI/Human Genetics, Univ of Pa.
Subject:      Patch: /DotNewsRC qual should override profile
To: Multiple recipients of list ANU-NEWS <ANU-NEWS@VM1.NoDak.EDU>

This patch fixes a minor bug in the handling of the /DotNewsRC qualifier, which
caused the profile DotNewsRC setting to override the command line qualifier
once startup for the current session was complete.  News.Hlp states (correctly)
that the reverse should happen - the qualifier should override the profile
setting for the duration of the current session.

                    Regards,
                    Charles Bailey

!-------------------------------------------------------------------------------
!              Computational Biology and Informatics Laboratory
!         Dept. of Genetics, Univ. of Pennsylvania School of Medicine
!              Philadelphia, PA USA 19104     Tel. (215) 573-3112
!          Internet: bailey@genetics.upenn.edu  (IN 128.91.200.37)
!-------------------------------------------------------------------------------
$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_UNPACK_VERIFY"))'
$!
$! This archive created:
$!  Name : 940526_NEWSRC.PATCH
$!  By   : bailey@genetics.upenn.edu
$!  Date : 27-MAY-1994 01:34:19.30
$!  Using: VMS_SHARE 8.4, (C) 1993 Andy Harper, Kings College London UK
$!
$! Credit is due to these people for their original ideas:
$!    James Gray, Michael Bednarek
$!
$! 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. 940526_NEWSRC.PATCH
$!
$ set="set"
$ set symbol/scope=(nolocal,noglobal)
$ f=f$parse("SHARE_UNPACK_TEMP","SYS$SCRATCH:."+f$getjpi("","PID"))
$ e="write sys$error  ""%UNPACK"", "
$ w="write sys$output ""%UNPACK"", "
$ if .not. f$trnlnm("SHARE_UNPACK_LOG") then $ w = "!"
$ if f$getsyi("CPU") .gt. 127 then $ goto start
$ 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, P3=attributes,P4=size
$ 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:
$ x=f$search(P1)
$ if x .eqs. "" then $ goto file_absent
$ e "-W-HIGHVERS, Creating higher version of ", P1
$file_absent:
$ w "-I-UNPACK, Unpacking ", P5, " of ", P6, " - ", P1, " - ", P4, " Blocks"
$ n=P1
$ if P3 .nes. "" then $ n=f
$ if .not. f$verify() then $ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT/NOJOURNAL 'f'/OUT='n'
PROCEDURE GetHex(s,p)LOCAL x1,x2;x1:=INDEX(t,SUBSTR(s,p,1))-1;x2:=INDEX(t,
SUBSTR(s,p+1,1))-1;RETURN 16*x1+x2;ENDPROCEDURE;PROCEDURE SkipPartsep LOCAL m;
LOOP m:=MARK(NONE);EXITIF m=END_OF(b);DELETE(m);EXITIF INDEX(ERASE_LINE,
"-+-+-+-+-+-+-+-+")=1;ENDLOOP;ENDPROCEDURE;PROCEDURE ProcessLine LOCAL c,s,l,b,
n,p;c := ERASE_CHARACTER(1);s := ERASE_LINE;IF c = "X" THEN SPLIT_LINE; ENDIF;
MOVE_HORIZONTAL(-1);l := LENGTH(s);p := 1;LOOP EXITIF p > l;c := SUBSTR(s,p,1);
p := p+1;CASE c FROM ' ' TO '`' ['`']: COPY_TEXT(ASCII(GetHex(s,p))); p:=p+2;[
' ']: p:=p+1;[INRANGE,OUTRANGE]: COPY_TEXT(c);ENDCASE;ENDLOOP;ENDPROCEDURE;
PROCEDURE Decode LOCAL m;POSITION(BEGINNING_OF(b));LOOP m:=MARK(NONE);EXITIF m=
END_OF(b);DELETE(m);IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+-")=
1 THEN SkipPartSep;ELSE ProcessLine;MOVE_HORIZONTAL(1);ENDIF;ENDLOOP;
ENDPROCEDURE;SET(FACILITY_NAME,"UNPACK");SET(SUCCESS,OFF);SET(INFORMATIONAL,
OFF);t:="0123456789ABCDEF";f:=GET_INFO(COMMAND_LINE,"file_name");b:=
CREATE_BUFFER(f,f);Decode;WRITE_FILE(b,GET_INFO(COMMAND_LINE,"output_file"));
QUIT;
$ if p3 .eqs. "" then $ goto dl
$ open/write fdl &f
$ write fdl "RECORD"
$ write fdl P3
$ close fdl
$ w "-I-CONVRFM, Converting record format to ", P3
$ convert/fdl=&f &f-1 &P1
$dl: delete 'f'*
$ checksum 'P1'
$ if checksum$checksum .nes. P2 then $ -
  e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ exit
$ endsubroutine
$start:
$!
$ create 'f'
XANU`20News`20Patch
XPatch`20ID:`20940526_newsrc.c!bailey@genetics.upenn.edu
XDate:`2026-May-1994
XAuthor:`20Charles`20Bailey`20`20bailey@genetics.upenn.edu
XNews`20Version:`206.1beta9
XNews`20Files:`20NewsRC.C
XDescription:`20If`20the`20/DotNewsRC`20qualifier`20was`20specified`20when`20in
Vvoking`20News,`20it
Xshould`20override`20the`20profile`20setting`20DotNewsRC`20for`20the`20current
V`20session.`20`20This
Xpatch`20fixed`20a`20bug`20which`20caused`20the`20profile`20setting`20to`20over
Vride`20the`20command
Xline`20setting`20after`20initial`20startup`20was`20complete.
X***`20newsrc.c
X---`20newsrc_new.c
X**************
X***`2046,48
X`20`20**--
X`20`20**/
X`20`20`0C
X---`2046,51`20-----
X+`20**`09V6.1b9`0926-May-1994`09bailey@genetics.upenn.edu
X+`20**`09-`20fixed`20bug`20which`20caused`20profile`20DotNewsRc`20setting`20to
V`20override`20/DotNewsRC
X+`20**`09`20`20qualifier`20on`20News`20CL`20once`20startup`20was`20completed
X`20`20**--
X`20`20**/
X`20`20`0C
X**************
X***`20147,152
X`20`20`20*`20`20a`20call`20to`20init_screen`20after`20read_reg_file`20is`20inv
Voked)
X`20`20`20*/
X`20`20
X`20`20int`20read_reg_file()
X`20`20`7B
X`20`20`20`20char`20*in_line,`20*itm_list,`20new_name`5B128`5D,`20*old_dir_typ;
V
X---`20150,159`20-----
X`20`20`20*`20`20a`20call`20to`20init_screen`20after`20read_reg_file`20is`20inv
Voked)
X`20`20`20*/
X`20`20
X+`20/*`20preserve`20News`20CL`20setting`20of`20usedotnewsrc`20across
X+`20`20`20`20read_reg_file`20into`20reg_context`20*/
X+`20static`20int`20clusedotnewsrc;
X+`20
X`20`20int`20read_reg_file()
X`20`20`7B
X`20`20`20`20char`20*in_line,`20*itm_list,`20new_name`5B128`5D,`20*old_dir_typ;
V
X**************
X***`20217,223
X`20`20
X`20`20`20`20if`20(chop_str(in_line,'`7C'))`20profile_flags`20`7C=`20PROFILE_DO
VTNEWSRC;
X`20`20`20`20usedotnewsrc`20=`20(usedotnewsrc`20<`202)`20?`20profile_flags`20
V`26`20PROFILE_DOTNEWSRC
X!`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20:`20usedotnewsrc`20-`202;
X`20`20`20`20if`20(usedotnewsrc)`20`7B
X`20`20`20`20`20`20if`20(dotnewsrc`20=`20fopen("sys$login:.newsrc","r"))`20`7B
V
X`20`20`20`20`20`20`20`20dotnewsrcexists`20=`20_ck_open_r(dotnewsrc,"sys$login:
V.newsrc");
X---`20224,230`20-----
X`20`20
X`20`20`20`20if`20(chop_str(in_line,'`7C'))`20profile_flags`20`7C=`20PROFILE_DO
VTNEWSRC;
X`20`20`20`20usedotnewsrc`20=`20(usedotnewsrc`20<`202)`20?`20profile_flags`20
V`26`20PROFILE_DOTNEWSRC
X!`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20`20`20`20`20:`20(clusedotnewsrc`20=`20usedotnewsrc)`20
V-`202;
X`20`20`20`20if`20(usedotnewsrc)`20`7B
X`20`20`20`20`20`20if`20(dotnewsrc`20=`20fopen("sys$login:.newsrc","r"))`20`7B
V
X`20`20`20`20`20`20`20`20dotnewsrcexists`20=`20_ck_open_r(dotnewsrc,"sys$login:
V.newsrc");
X**************
X***`20503,509
X`20`20`20`20struct`20dir_class`20*ch`20=`20c_head;
X`20`20
X`20`20`20`20line_editing`20=`20(profile_flags`20`26`20PROFILE_LINEEDIT)`20!=
V`200;
X!`20`20`20usedotnewsrc`20=`20(profile_flags`20`26`20PROFILE_DOTNEWSRC)`20!=`20
V0;
X`20`20`20`20curr_class`20=`200;
X`20`20`20`20if`20(*n_class_name)`20`7B
X`20`20`20`20`20`20while`20(ch)`20`7B
X---`20510,520`20-----
X`20`20`20`20struct`20dir_class`20*ch`20=`20c_head;
X`20`20
X`20`20`20`20line_editing`20=`20(profile_flags`20`26`20PROFILE_LINEEDIT)`20!=
V`200;
X!`20`20`20if`20(clusedotnewsrc)`20`7B
X!`20`20`20`20`20usedotnewsrc`20=`20clusedotnewsrc`20-`202;
X!`20`20`20`20`20clusedotnewsrc`20=`200;
X!`20`20`20`7D
X!`20`20`20else`20usedotnewsrc`20=`20(profile_flags`20`26`20PROFILE_DOTNEWSRC)
V`20!=`200;
X`20`20`20`20curr_class`20=`200;
X`20`20`20`20if`20(*n_class_name)`20`7B
X`20`20`20`20`20`20while`20(ch)`20`7B
X***`20patchlist.h;-1
X---`20patchlist.h
X**************
X***`201,1
X`20`20=+=+=`20End`20=+=+=
X---`201,2`20-----
X+`20940526_newsrc.c!bailey@genetics.upenn.edu
X`20`20=+=+=`20End`20=+=+=
$ call unpack 940526_NEWSRC.PATCH -
 2020439941 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 6 1 1
$ v=f$verify(v)
$ exit
