summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tcl.decls2
-rw-r--r--generic/tclUtf.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 61a71bd..6a34a53 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -2544,7 +2544,7 @@ export {
export {
void Tcl_InitSubsystems(void)
}
-export {
+export {
int TclZipfs_AppHook(int *argc, char ***argv)
}
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index fde30c5..f56abd8 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -92,6 +92,8 @@ static const unsigned char complete[256] = {
#if TCL_UTF_MAX > 3
4,4,4,4,4,
#else
+ /* Tcl_UtfToUniChar() accesses src[1] and src[2] to check whether
+ * the UTF-8 sequence is valid, so we cannot use 1 here. */
3,3,3,3,3,
#endif
1,1,1,1,1,1,1,1,1,1,1
@@ -971,6 +973,10 @@ Tcl_UtfNext(
const char *next;
if (((*src) & 0xC0) == 0x80) {
+ /* Continuation byte, so we start 'inside' a (possible valid) UTF-8
+ * sequence. Since we are not allowed to access src[-1], we cannot
+ * check if the sequence is actually valid, the best we can do is
+ * just assume it is valid and locate the end. */
if ((((*++src) & 0xC0) == 0x80) && (((*++src) & 0xC0) == 0x80)) {
++src;
}