Re: htdig: core problem with modified htsearch :(


Doug (DougB@simplenet.com)
Wed, 20 Jan 1999 18:45:36 -0800


Gilles Detillieux wrote:

> Yikes! NO! You can't just overwrite the string returned by
> match->getURL(), as you're doing with strncat(), because you have no idea
> how much extra memory is available in the string. I haven't tested this,
> but I think what you want is something more like:
>
> char *url = match->getURL();
> String *new_url = new String(url);
> *new_url << "?track=00101.00015.005.00012.001-99010613001212638";
> vars.Add("URL", new_url);

        As I expressed to him in a private reply, Gilles is a lifesaver. :)
This was indeed my problem, and after long experimentation I finally hit
on a slightly different solution that works very well, but I wouldn't
have gotten where I am were it not for the help I received.

        What I ended up doing is passing the string I want to append as a CGI
variable, sucking that into htsearch.cc, then setting up a htdig
variable in Display.cc with that value. Now I can use my tracking number
string in the header/footer/syntax/nomatch documents, and I've created a
template for the results that does exactly what I want. If there is
interest I will post a patch, but as all good solutions are *after* you
arrive at them it turned out to be very simple. :)

many many thanks,

Doug
----------------------------------------------------------------------
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 Mon Jan 25 1999 - 08:15:23 PST