summaryrefslogtreecommitdiff
path: root/bin/ksh
diff options
context:
space:
mode:
authorVadim Zhukov <zhuk@cvs.openbsd.org>2015-07-30 14:59:13 +0000
committerVadim Zhukov <zhuk@cvs.openbsd.org>2015-07-30 14:59:13 +0000
commitcba5db0a604f4c2c68e90eed556d3f2f1433c590 (patch)
treed76e264df9b242392060a127a155df15de1801aa /bin/ksh
parent3cf3b9b8f56af752140afdddeca8b2a04e492644 (diff)
Fix the baskslash-escaped codes ('\nnn') usage in PS1.
Report and initial proposal from Vadim Ushakov on bugs@, tweaked by me. okay deraadt@
Diffstat (limited to 'bin/ksh')
-rw-r--r--bin/ksh/lex.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/ksh/lex.c b/bin/ksh/lex.c
index c27462e1876..c90aca6061e 100644
--- a/bin/ksh/lex.c
+++ b/bin/ksh/lex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lex.c,v 1.49 2013/12/17 16:37:06 deraadt Exp $ */
+/* $OpenBSD: lex.c,v 1.50 2015/07/30 14:59:12 zhuk Exp $ */
/*
* lexical analysis and source input
@@ -1370,7 +1370,8 @@ dopprompt(const char *sp, int ntruncate, const char **spp, int doprint)
"\\%c", *cp);
break;
}
- n = cp[0] * 8 * 8 + cp[1] * 8 + cp[2];
+ n = (cp[0] - '0') * 8 * 8 + (cp[1] - '0') * 8 +
+ (cp[2] - '0');
snprintf(strbuf, sizeof strbuf, "%c", n);
cp += 2;
break;