diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-11-10 21:13:55 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-11-10 21:13:55 +0000 |
commit | 82ad4c586d8e11d48b9dfb5b1bac1cc7b40132ed (patch) | |
tree | 941f0571d64956c54a6db32c82980d9cb2333e2e /bin/ksh/lex.c | |
parent | 801e23caf9245d90b43fcd1fccb89fc487e26132 (diff) |
defer ! and !! handling till prompt printing, like real ksh, and this now
means even less fallout from the prompt expansion changes; ok jmc
Diffstat (limited to 'bin/ksh/lex.c')
-rw-r--r-- | bin/ksh/lex.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/bin/ksh/lex.c b/bin/ksh/lex.c index 195cf9e45ee..044e19eabfb 100644 --- a/bin/ksh/lex.c +++ b/bin/ksh/lex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lex.c,v 1.21 2004/11/06 20:36:44 deraadt Exp $ */ +/* $OpenBSD: lex.c,v 1.22 2004/11/10 21:13:54 deraadt Exp $ */ /* * lexical analysis and source input @@ -1118,11 +1118,6 @@ set_prompt(to, s) switch (to) { case PS1: /* command */ #ifdef KSH - /* Substitute ! and !! here, before substitutions are done - * so ! in expanded variables are not expanded. - * NOTE: this is not what at&t ksh does (it does it after - * substitutions, POSIX doesn't say which is to be done. - */ { struct shf *shf; char * volatile ps1; @@ -1131,13 +1126,8 @@ set_prompt(to, s) ps1 = str_val(global("PS1")); shf = shf_sopen((char *) 0, strlen(ps1) * 2, SHF_WR | SHF_DYNAMIC, (struct shf *) 0); - while (*ps1) { - if (*ps1 != '!' || *++ps1 == '!') - shf_putchar(*ps1++, shf); - else - shf_fprintf(shf, "%d", - s ? s->line + 1 : 0); - } + while (*ps1) + shf_putchar(*ps1++, shf); ps1 = shf_sclose(shf); saved_atemp = ATEMP; newenv(E_ERRH); |