Browse Source

src/main.c, prompt(), rewrite

pre-master-46
rlar 11 years ago
parent
commit
42d0e42e0d
  1. 12
      src/main.c

12
src/main.c

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

Loading…
Cancel
Save