|
From: Gilles D. <gr...@sc...> - 2003-11-13 18:23:09
|
According to Jim Cole:
> On Nov 12, 2003, at 3:28 PM, Gilles Detillieux wrote:
> > According to Jim Cole:
> >> I did come across one minor bug in Display.cc involving start_ellipses
> >> and end_ellipses; but I think that it only manifests itself when
> >> max_excerpts is greater than one (a non-default setting). I will post
> >> a
> >> bug report later this week.
> >
> > I think I see the cause of this bug. In Display::buildExcerpts() it
> > mistakenly uses config->Value() instead of config->Find() to get the
> > string from the start_ellipses and end_ellipses attributes. This code
> > is
> > only used if max_excerpts is not 1 and the search word(s) is(are)
> > found.
> > So did the ellipses simply not show up, or did a 0 appear in their
> > place?
>
> Your diagnosis is correct. I came to the same conclusion, and changing
> from Value to Find did in fact solve the problem. Prior to the change a
> 0 appeared in place of the ellipses. I was just holding off submitting
> an official bug report until I had a chance to look at the 3.1.x code
> and see what changed. I just took a quick look and it appears that at
> some point there was a move away from using operator[] to access the
> start_ and end_ellipses settings, at which time Value was substituted.
Yes, the operator [] works on a {Ht,}Configuration object, but not on a
pointer to that object. In 3.2, we moved to using a pointer to the object
in most of the code, so config["foo"] had to become config->Find("foo").
I think the changes were made in one fell swoop, but as stuff got moved
back and forth between the 3.1 and 3.2 branches later, there was of
course the potential of getting it wrong when manually going from one
to the other. I guess that's what the beta testing is for!
For completeness, here's the patch...
--- htsearch/Display.cc.orig 2003-10-25 07:40:23.000000000 -0500
+++ htsearch/Display.cc 2003-11-13 11:33:43.000000000 -0600
@@ -1776,7 +1776,7 @@
}
else
{
- text << config->Value("start_ellipses");
+ text << config->Find("start_ellipses");
while ( *start && HtIsStrictWordChar( *start ) )
{
@@ -1806,7 +1806,7 @@
*end = '\0';
text << hilight(match, start, urlanchor, fanchor);
- text << config->Value("end_ellipses");
+ text << config->Find("end_ellipses");
*end = endChar;
}
--
Gilles R. Detillieux E-mail: <gr...@sc...>
Spinal Cord Research Centre WWW: http://www.scrc.umanitoba.ca/
Dept. Physiology, U. of Manitoba Winnipeg, MB R3E 3J7 (Canada)
|