From:	CSBVAX::MRGATE!JOE%FHCRCVAX.BITNET@CUNYVM.CUNY.EDU@SMTP  5-APR-1988 19:55
To:	ARISIA::EVERHART
Subj:	INDEX (FIND) bug fix


Received: from oly.acs.washington.edu by KL.SRI.COM with TCP; Mon 4 Apr 88 14:47:16-PDT
Received: from UWAVM.ACS.WASHINGTON.EDU by oly.acs.washington.edu ; Mon, 04 Apr 88 14:47:16 PDT
Received: from UWAVM.ACS.WASHINGTON.EDU by UWAVM.ACS.WASHINGTON.EDU (Mailer
 X1.25) with BSMTP id 9437; Mon, 04 Apr 88 14:42:47 PDT
P1-Message-Id: US**EDU;UWAVM.ACS.WASHINGTON.EDU:LJe6evmw
Date:         Mon, 4 Apr 88 14:41-0700
X400-Trace:   US**EDU; arrival Mon, 4 Apr 88 14:41-0700 action Relayed
X400-Trace:   US**EDU; arrival Mon, 4 Apr 88 14:42-0700 action Relayed
From:         Joe Meadows<JOE%FHCRCVAX.BITNET@oly.acs.washington.edu>
Subject:      INDEX (FIND) bug fix
To:           <info-vax@kl.sri.COM>
Message-Id:   <UWAVM.ACS.WASHINGTON.EDU:LJe6evmw*>
X-VMS-To: IN%"info-vax@kl.sri.com"

This is a modification for the INDEX / FIND utility. Note that INDEX and
FIND are the same utility, only the name is different.  This utility can
be found on the Fall '87 Decus tape, under [VAX87E.MEADOWS.INDEX], and was
posted previously to info-vax.

This fixes behaviour of /CHARACTERISTICS qualifier.

--- In search.c , find the following -----------
  if (search->si_v_char) {
    if (((search->si_l_charset & fh2->fh2$l_filechar) == search->si_l_charset)
     && ((search->si_l_charclr & fh2->fh2$l_filechar) == search->si_l_charclr))
--- and change to ------------------------------
  if (search->si_v_char) {
    if ((search->si_l_charset & fh2->fh2$l_filechar)
     && (!(search->si_l_charclr & fh2->fh2$l_filechar)))
------------------------------------------------

        This solves two problems at once, the previous code would force all
negated keywords to behave as though they were not negated, and all present
keywords would have to be true (i.e. /CHAR=(READ,WRITE) would only match if
the file had BOTH read and write verify set, whereas the help said it would
be EITHER).

        The behaviour with this modification is as documented, if any of the
present keywords hold true and if none of the negated keywords hold true
for the file, then the file is displayed.

        A possible future modification would be to modify it so that
you can ask that BOTH need to be set. Perhaps I could change it so that
/CHARACTERISTICS=(READ+WRITE) would test for read AND write, and
/CHARACTERISTICS=(READ,WRITE) would test for read OR write. No one has
written to me asking for such a modification, so perhaps it's not such a
wanted item..

  Joe Meadows Jr.
  VAX/VMS System Manager / guru in training
  Fred Hutchinson Cancer Research Center
  1124 Columbia St.
  Seattle Wa. 98104
     bitnet - JOE@FHCRCVAX
     arpa   - JOE%FHCRCVAX.BITNET@WISCVM.WISC.EDU
     voice  - (206) 467-4970
