diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-05-31 12:50:04 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-05-31 12:50:04 (GMT) |
commit | 84b9d03fb02b9ee744e03775f590d49f105d23f8 (patch) | |
tree | 5744c424eb00548acf667916895305f874909917 /generic/tclUtil.c | |
parent | 2ed71e62a0e1b2fc0b0dca264ffa417ba2d9b159 (diff) | |
parent | a2a03ea8fb6718cc472cc7dcb44f8e68aadb24ba (diff) | |
download | tcl-84b9d03fb02b9ee744e03775f590d49f105d23f8.zip tcl-84b9d03fb02b9ee744e03775f590d49f105d23f8.tar.gz tcl-84b9d03fb02b9ee744e03775f590d49f105d23f8.tar.bz2 |
TIP 537 implementation: Enable 64-bit indexes in regexp matching
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r-- | generic/tclUtil.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 7373085..c9eb8d2 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -2637,10 +2637,10 @@ Tcl_DStringInit( char * Tcl_DStringAppend( Tcl_DString *dsPtr, /* Structure describing dynamic string. */ - const char *bytes, /* String to append. If length is -1 then this - * must be null-terminated. */ + const char *bytes, /* String to append. If length is + * TCL_AUTO_LENGTH then this must be null-terminated. */ size_t length) /* Number of bytes from "bytes" to append. If - * -1, then append all of bytes, up to null + * TCL_AUTO_LENGTH, then append all of bytes, up to null * at end. */ { size_t newSize; @@ -2664,18 +2664,18 @@ Tcl_DStringAppend( memcpy(newString, dsPtr->string, dsPtr->length); dsPtr->string = newString; } else { - size_t offset = TCL_AUTO_LENGTH; + size_t index = TCL_INDEX_NONE; /* See [16896d49fd] */ if (bytes >= dsPtr->string && bytes <= dsPtr->string + dsPtr->length) { - offset = bytes - dsPtr->string; + index = bytes - dsPtr->string; } dsPtr->string = Tcl_Realloc(dsPtr->string, dsPtr->spaceAvl); - if (offset != TCL_AUTO_LENGTH) { - bytes = dsPtr->string + offset; + if (index != TCL_INDEX_NONE) { + bytes = dsPtr->string + index; } } } |