From 32875713867d69224625a55f8bacd258776a5c18 Mon Sep 17 00:00:00 2001 From: tg Date: Sat, 20 Sep 2008 14:17:30 +0000 Subject: [PATCH] Do not push lines beginning (at the $PS1) with an IFS White Space (space, tab, newline) or an IFS Character ($IFS) into the history at all. --- lex.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lex.c b/lex.c index e3c1c1d..ae1cdb1 100644 --- a/lex.c +++ b/lex.c @@ -2,7 +2,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.66 2008/07/12 16:56:39 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.67 2008/09/20 14:17:30 tg Exp $"); /* * states while lexing word @@ -1241,10 +1241,7 @@ getsc_line(Source *s) s->str = NULL; } else if (interactive) { char *p = Xstring(s->xs, xp); - if (cur_prompt == PS1) - while (*p && ctype(*p, C_IFS) && ctype(*p, C_IFSWS)) - p++; - if (*p) { + if (*p && (cur_prompt != PS1 || !ctype(*p, C_IFS | C_IFSWS))) { s->line++; histsave(s->line, s->str, 1); }