alias expansion
SCCS-vsn: bin/csh/lex.c 5.7
-static char *sccsid = "@(#)lex.c 5.6 (Berkeley) %G%";
+static char *sccsid = "@(#)lex.c 5.7 (Berkeley) %G%";
register struct wordent *lp = hp->Hlex.next;
int argno = 0;
register struct wordent *lp = hp->Hlex.next;
int argno = 0;
+ /*
+ * The entries added by alias substitution don't
+ * have a newline but do have a negative event number.
+ * Savehist() trims off these entries, but it happens
+ * before alias expansion, too early to delete those
+ * from the previous command.
+ */
+ if (hp->Hnum < 0)
+ continue;
if (lp->word[0] == '\n')
continue;
if (!anyarg) {
if (lp->word[0] == '\n')
continue;
if (!anyarg) {