src/main.c, prompt(), rewrite

This commit is contained in:
rlar 2015-01-03 20:19:00 +01:00
parent 15a04192da
commit 42d0e42e0d
1 changed files with 6 additions and 6 deletions

View File

@ -526,20 +526,20 @@ prompt(void)
s = "->";
while (*s) {
switch (strip(*s)) {
char c = (char) strip(*s++);
switch (c) {
case '!':
p += sprintf(p, "%d", where_history() + 1);
break;
case '\\':
if (s[1])
s++;
if (*s)
c = (char) strip(*s++);
default:
*p = (char) strip(*s); ++p;
*p++ = c;
break;
}
s++;
}
*p = 0;
*p = '\0';
return pbuf;
}
#endif /* HAVE_GNUREADLINE || HAVE_BSDEDITLINE */