Re: htdig: Re: 'exclude' and 'restrict'


Gilles Detillieux (grdetil@scrc.umanitoba.ca)
Wed, 25 Nov 1998 10:33:54 -0600 (CST)


According to William Rhee:
> After a little poking around in htsearch.cc, some Socratic advice from
> Geoff, and some more poking around, I made a 'caveman' patch which fixes
> the behavior. If anyone with some real experience with C++ wants to make
> it prettier please do.
...
> Patch for htsearch.cc:
>
> 133,141d132
> < char *sep;
> < while (sep = strchr(input["restrict"], '\001'))
> < {
> < if (sep == NULL)
> < {
> < break;
> < }
> < *sep = '|';
> < }
> 146,154d136
> < char *sep;
> < while (sep = strchr(input["exclude"], '\001'))
> < {
> < if (sep == NULL)
> < {
> < break;
> < }
> < *sep = '|';
> < }

I'm no C++ expert, but here's some prettier C:

      char *sep = input["exclude"];
      while ((sep = strchr(sep, '\001')) != NULL)
          *sep++ = '|';

-- 
Gilles R. Detillieux              E-mail: <grdetil@scrc.umanitoba.ca>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930
----------------------------------------------------------------------
To unsubscribe from the htdig mailing list, send a message to
htdig-request@sdsu.edu containing the single word "unsubscribe" in
the body of the message.



This archive was generated by hypermail 2.0b3 on Sat Jan 02 1999 - 16:28:53 PST