* view.c (block_search): Return the position where the block was

found as declared in comment.
(hex_search): Don't increase pos, block_search returns now right
position.
This commit is contained in:
Andrew V. Samoilov 2001-08-06 15:33:38 +00:00
parent 22861f9737
commit 7b568914ec

View File

@ -1644,7 +1644,7 @@ block_search (WView *view, char *buffer, int len)
search_update_steps (view);
update_activate = 0;
for (; e < view->last_byte; e++){
while (e < view->last_byte){
if (e >= update_activate){
update_activate += update_steps;
if (verbose){
@ -1654,18 +1654,18 @@ block_search (WView *view, char *buffer, int len)
if (got_interrupt ())
break;
}
b = get_byte (view, e);
b = get_byte (view, e++);
if (*d == b){
d++;
if (d - buffer == len){
disable_interrupt_key ();
return e - len;
}
} else {
e -= d - buffer;
d = buffer;
}
if (d - buffer == len){
disable_interrupt_key ();
return e - len;
}
}
disable_interrupt_key ();
return -1;
@ -1740,7 +1740,7 @@ hex_search (WView *view, char *text)
return;
}
view->search_start = pos + 1;
view->search_start = pos;
view->found_len = block_len;
/* Set the edit cursor to the search position, left nibble */
view->edit_cursor = view->search_start;