summaryrefslogtreecommitdiffstats
path: root/generic/tclUtf.c
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2000-01-11 22:08:59 (GMT)
committerhobbs <hobbs@noemail.net>2000-01-11 22:08:59 (GMT)
commit9a976f9912ff1d0ea722bba62275875986b6d013 (patch)
treee0ed0df0d95c75b6ebbf3e1d7269c0165c1e8d48 /generic/tclUtf.c
parentd5406d280071c162b6ac0a8d4ca62f69a75909cc (diff)
downloadtcl-9a976f9912ff1d0ea722bba62275875986b6d013.zip
tcl-9a976f9912ff1d0ea722bba62275875986b6d013.tar.gz
tcl-9a976f9912ff1d0ea722bba62275875986b6d013.tar.bz2
* generic/tclUtf.c: changed Tcl_UtfBackslash to not allow
non-octal digits (8,9) in \ooo substs. [Bug: 3975] * generic/tcl.h: noted need to change win/tcl.m4 and tools/tclSplash.bmp for minor version changes FossilOrigin-Name: f664655d336629ba00d54f4714d380c88fa73a24
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r--generic/tclUtf.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index 8a2354e..5fe3c41 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUtf.c,v 1.10 1999/07/22 01:08:05 redman Exp $
+ * RCS: @(#) $Id: tclUtf.c,v 1.11 2000/01/11 22:09:00 hobbs Exp $
*/
#include "tclInt.h"
@@ -864,16 +864,19 @@ Tcl_UtfBackslash(src, readPtr, dst)
count = 1;
break;
default:
- if (isdigit(UCHAR(*p))) { /* INTL: digit */
+ /*
+ * Check for an octal number \oo?o?
+ */
+ if (isdigit(UCHAR(*p)) && (UCHAR(*p) < '8')) { /* INTL: digit */
result = (unsigned char)(*p - '0');
p++;
- if (!isdigit(UCHAR(*p))) { /* INTL: digit */
+ if (!isdigit(UCHAR(*p)) || (UCHAR(*p) >= '8')) { /* INTL: digit */
break;
}
count = 3;
result = (unsigned char)((result << 3) + (*p - '0'));
p++;
- if (!isdigit(UCHAR(*p))) { /* INTL: digit */
+ if (!isdigit(UCHAR(*p)) || (UCHAR(*p) >= '8')) { /* INTL: digit */
break;
}
count = 4;