summaryrefslogtreecommitdiffstats
path: root/generic/tclUtf.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-01-11 22:08:59 (GMT)
committerhobbs <hobbs>2000-01-11 22:08:59 (GMT)
commitdba4ade20672f9434ee5f1c871cc0e3454dc6fd0 (patch)
treee0ed0df0d95c75b6ebbf3e1d7269c0165c1e8d48 /generic/tclUtf.c
parent40c309568a00ef2f5cd2db5618f02f075d9cda5b (diff)
downloadtcl-dba4ade20672f9434ee5f1c871cc0e3454dc6fd0.zip
tcl-dba4ade20672f9434ee5f1c871cc0e3454dc6fd0.tar.gz
tcl-dba4ade20672f9434ee5f1c871cc0e3454dc6fd0.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
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;