• syn.c: replace expanded use of str_save() with the actual macro

• others: fix 6 (!) cases of non-constant or side-effect arguments
  to the str_save() or str_nsave() macros, and other abuse of them
• also fix some cosmetics and other un-nice code while here
This commit is contained in:
tg
2008-07-12 16:56:40 +00:00
parent 9eae0851ef
commit 0b4f34e0a8
7 changed files with 40 additions and 37 deletions

9
lex.c
View File

@@ -2,7 +2,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.65 2008/07/09 21:32:43 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.66 2008/07/12 16:56:39 tg Exp $");
/*
* states while lexing word
@@ -1290,9 +1290,10 @@ set_prompt(int to, Source *s)
* unwinding its stack through this code as it
* exits.
*/
} else
prompt = str_save(substitute(ps1, 0),
saved_atemp);
} else {
char *cp = substitute(ps1, 0);
prompt = str_save(cp, saved_atemp);
}
quitenv(NULL);
}
break;