[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fix a crash in stand-alone Info due to bad indexing of a string
From: |
Eli Zaretskii |
Subject: |
Re: Fix a crash in stand-alone Info due to bad indexing of a string |
Date: |
Thu, 21 Mar 2013 05:49:14 +0200 |
> Date: Wed, 20 Mar 2013 23:28:08 GMT
> From: address@hidden (Karl Berry)
>
> 1) My first attempts did not reproduce it, though of course I don't
> doubt there is a problem.
What did you try to reproduce? A crash is specific to the malloc/free
implementation; even for me it happens only on one system to which I
have access, while others simply don't show the up-cased characters.
> 2) Your change has an undesirable side effect for me. For example:
> info hello
> i Exa
> outputs
> Found `EXAmples' in ...
> instead of the present (and correct)
> Found `examples' in ...
>
> (Analogous thing happens with lowercase search strings and uppercase
> index entries.)
This is how the stand-alone Info reader behaved for ages. That's what
this code fragment is about (note the comment):
/* If we had a partial match, indicate to the user which part of the
string matched. */
match = xstrdup (index_index[i]->label);
if (partial && show_index_match)
{
int k, ls, start, upper;
ls = strlen (index_search);
start = partial - ls;
upper = isupper (match[start]) ? 1 : 0;
for (k = 0; k < ls; k++)
if (upper)
match[k + start] = info_tolower (match[k + start]);
else
match[k + start] = info_toupper (match[k + start]);
}
Try 'info' from Texinfo 4.13, and you will see the same case changes.
The bug in 5.0 inadvertently removed this feature.
> Will take a look when I can, probably you or Sergey will get there first ...
Thanks.
Re: Fix a crash in stand-alone Info due to bad indexing of a string, Sergey Poznyakoff, 2013/03/21