tweaks: chuck an assert, and then condense the code and a comment

master
Benno Schulenberg 2017-09-19 21:14:05 +02:00
parent 5561d22f19
commit f6b396f206
1 changed files with 3 additions and 10 deletions

View File

@ -65,21 +65,14 @@ void regexp_cleanup(void)
}
}
/* Indicate on the statusbar that the string at str was not found by the
* last search. */
/* Report on the status bar that the given string was not found. */
void not_found_msg(const char *str)
{
char *disp;
size_t numchars;
assert(str != NULL);
disp = display_string(str, 0, (COLS / 2) + 1, FALSE);
numchars = actual_x(disp, strnlenpt(disp, COLS / 2));
char *disp = display_string(str, 0, (COLS / 2) + 1, FALSE);
size_t numchars = actual_x(disp, strnlenpt(disp, COLS / 2));
statusline(HUSH, _("\"%.*s%s\" not found"), numchars, disp,
(disp[numchars] == '\0') ? "" : "...");
free(disp);
}