The intention of this function is to avoid recording no-op command lines
in the history. This is exactly the set of commands containing just
regular tabs and spaces.
It is inappropriate to use the locale-sensitive isblank for this, as
this may be a little bit different. In practice there is probably no
meaningful difference, but as isblank is a C99 feature losing this call
also helps when building against older C libraries that lack it.
printf(_("Report bugs to <%s>.\n"), PACKAGE_BUGREPORT);
}
-static bool is_blank_line(const char *line)
+static int is_blank_line(const char *line)
{
- for (size_t i = 0; line[i]; i++) {
- if (!isblank((unsigned char)line[i]))
- return false;
- }
-
- return true;
+ return !line[strspn(line, " \t")];
}
static int repl(void)