tweaks: chuck an assert, and then condense the code and a comment
parent
5561d22f19
commit
f6b396f206
13
src/search.c
13
src/search.c
|
@ -65,21 +65,14 @@ void regexp_cleanup(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Indicate on the statusbar that the string at str was not found by the
|
/* Report on the status bar that the given string was not found. */
|
||||||
* last search. */
|
|
||||||
void not_found_msg(const char *str)
|
void not_found_msg(const char *str)
|
||||||
{
|
{
|
||||||
char *disp;
|
char *disp = display_string(str, 0, (COLS / 2) + 1, FALSE);
|
||||||
size_t numchars;
|
size_t numchars = actual_x(disp, strnlenpt(disp, COLS / 2));
|
||||||
|
|
||||||
assert(str != NULL);
|
|
||||||
|
|
||||||
disp = display_string(str, 0, (COLS / 2) + 1, FALSE);
|
|
||||||
numchars = actual_x(disp, strnlenpt(disp, COLS / 2));
|
|
||||||
|
|
||||||
statusline(HUSH, _("\"%.*s%s\" not found"), numchars, disp,
|
statusline(HUSH, _("\"%.*s%s\" not found"), numchars, disp,
|
||||||
(disp[numchars] == '\0') ? "" : "...");
|
(disp[numchars] == '\0') ? "" : "...");
|
||||||
|
|
||||||
free(disp);
|
free(disp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue