* Build.sh: fix accidental CR-LF catastrophe
(yeah, that's what you get from developing with a 16-bit MS-DOS(R) executable of your favourite text editor) * lex.c, mksh.1: do not print the delimiting character for not-to-be-counted character sequences (i.e. ANSI escapes) in prompts any more, mostly because ASCII 01h is printable on both Interix and Cygwin and I'm lazy (this also fixes prompt width counting if a printable character such as 'x' is used as delimiting character) * lex.c: through printing the prompt character by character, also print the delimited sequences if skipping, fixes some prompt redrawal not honouring colours stuff while not totally redrawing the entire prompt
This commit is contained in:
15
lex.c
15
lex.c
@ -2,7 +2,7 @@
|
||||
|
||||
#include "sh.h"
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.18 2006/08/01 14:59:51 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.19 2006/08/02 10:41:03 tg Exp $");
|
||||
|
||||
/* Structure to keep track of the lexing state and the various pieces of info
|
||||
* needed for each particular state. */
|
||||
@ -1106,13 +1106,6 @@ dopprompt(const char *cp, int ntruncate, const char **spp, int doprint)
|
||||
cp += 2;
|
||||
}
|
||||
for (; *cp; cp++) {
|
||||
if (ntruncate) {
|
||||
if (!(indelimit || (*cp == delimiter)))
|
||||
--ntruncate;
|
||||
} else if (doprint) {
|
||||
shf_puts(cp, shl_out);
|
||||
doprint = 0;
|
||||
}
|
||||
if (indelimit && *cp != delimiter)
|
||||
;
|
||||
else if (*cp == '\n' || *cp == '\r') {
|
||||
@ -1128,6 +1121,12 @@ dopprompt(const char *cp, int ntruncate, const char **spp, int doprint)
|
||||
indelimit = !indelimit;
|
||||
else
|
||||
count++;
|
||||
if (*cp != delimiter) {
|
||||
if (ntruncate && !indelimit)
|
||||
--ntruncate;
|
||||
else if (doprint)
|
||||
shf_putc(*cp, shl_out);
|
||||
}
|
||||
}
|
||||
if (spp)
|
||||
*spp = sp;
|
||||
|
Reference in New Issue
Block a user