mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-24 12:12:19 +03:00
Ticket #1496 (Search backwards is broken)
fix: file edit/editcmd.c backward search is broken
This commit is contained in:
parent
646b11a7ce
commit
2a586710b7
@ -1289,11 +1289,12 @@ editcmd_find (WEdit *edit, gsize *len)
|
|||||||
gsize search_end;
|
gsize search_end;
|
||||||
|
|
||||||
if (edit->replace_backwards) {
|
if (edit->replace_backwards) {
|
||||||
search_end = edit->curs1-1;
|
search_end = edit->last_byte;
|
||||||
while ((int) search_start >= 0) {
|
while ((int) search_start >= 0) {
|
||||||
if (search_end - search_start > edit->search->original_len && mc_search_is_fixed_search_str(edit->search))
|
if (search_end > search_start + edit->search->original_len && mc_search_is_fixed_search_str(edit->search))
|
||||||
search_end = search_start + edit->search->original_len +1;
|
search_end = search_start + edit->search->original_len;
|
||||||
if ( mc_search_run(edit->search, (void *) edit, search_start, search_end, len))
|
if ( mc_search_run(edit->search, (void *) edit, search_start, search_end, len)
|
||||||
|
&& edit->search->normal_offset == search_start )
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user