summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-06-04 14:38:54 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-06-04 14:38:54 (GMT)
commitee793dfa1eadb249a50933784a47bacc5d63ca14 (patch)
tree1eee2a98637cdd00e322237630bb02f26658e730 /generic
parente1737976f9cb91cc83d3a65cfb2e00ce00e83afa (diff)
parent1d722dd564f086e6aeda78f707816ebb3869146f (diff)
downloadtcl-ee793dfa1eadb249a50933784a47bacc5d63ca14.zip
tcl-ee793dfa1eadb249a50933784a47bacc5d63ca14.tar.gz
tcl-ee793dfa1eadb249a50933784a47bacc5d63ca14.tar.bz2
Merge 8.6
Diffstat (limited to 'generic')
-rw-r--r--generic/tclParse.c35
-rw-r--r--generic/tclStrToD.c4
2 files changed, 18 insertions, 21 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c
index 132e804..7f32cfa 100644
--- a/generic/tclParse.c
+++ b/generic/tclParse.c
@@ -220,6 +220,10 @@ Tcl_ParseCommand(
* point to char after terminating one. */
int scanned;
+ if (numBytes < 0 && start) {
+ numBytes = strlen(start);
+ }
+ TclParseInit(interp, start, numBytes, parsePtr);
if ((start == NULL) && (numBytes != 0)) {
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
@@ -227,10 +231,6 @@ Tcl_ParseCommand(
}
return TCL_ERROR;
}
- if (numBytes < 0) {
- numBytes = strlen(start);
- }
- TclParseInit(interp, start, numBytes, parsePtr);
parsePtr->commentStart = NULL;
parsePtr->commentSize = 0;
parsePtr->commandStart = NULL;
@@ -1347,16 +1347,15 @@ Tcl_ParseVarName(
int varIndex;
unsigned array;
- if ((numBytes == 0) || (start == NULL)) {
- return TCL_ERROR;
- }
- if (numBytes < 0) {
+ if (numBytes < 0 && start) {
numBytes = strlen(start);
}
-
if (!append) {
TclParseInit(interp, start, numBytes, parsePtr);
}
+ if ((numBytes == 0) || (start == NULL)) {
+ return TCL_ERROR;
+ }
/*
* Generate one token for the variable, an additional token for the name,
@@ -1629,16 +1628,15 @@ Tcl_ParseBraces(
const char *src;
int startIndex, level, length;
- if ((numBytes == 0) || (start == NULL)) {
- return TCL_ERROR;
- }
- if (numBytes < 0) {
+ if (numBytes < 0 && start) {
numBytes = strlen(start);
}
-
if (!append) {
TclParseInit(interp, start, numBytes, parsePtr);
}
+ if ((numBytes == 0) || (start == NULL)) {
+ return TCL_ERROR;
+ }
src = start;
startIndex = parsePtr->numTokens;
@@ -1827,16 +1825,15 @@ Tcl_ParseQuotedString(
* the quoted string's terminating close-quote
* if the parse succeeds. */
{
- if ((numBytes == 0) || (start == NULL)) {
- return TCL_ERROR;
- }
- if (numBytes < 0) {
+ if (numBytes < 0 && start) {
numBytes = strlen(start);
}
-
if (!append) {
TclParseInit(interp, start, numBytes, parsePtr);
}
+ if ((numBytes == 0) || (start == NULL)) {
+ return TCL_ERROR;
+ }
if (TCL_OK != ParseTokens(start+1, numBytes-1, TYPE_QUOTE, TCL_SUBST_ALL,
parsePtr)) {
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index 85b660d..6444823 100644
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -537,7 +537,7 @@ TclParseNumber(
mp_err err = MP_OKAY;
int under = 0; /* Flag trailing '_' as error if true once
* number is accepted. */
-
+
#define ALL_BITS ((Tcl_WideUInt)-1)
#define MOST_BITS (ALL_BITS >> 1)
@@ -1256,7 +1256,7 @@ TclParseNumber(
}
} else {
/*
- * Back up to the last accepting state in the lexer.
+ * Back up to the last accepting state in the lexer.
* If the last char seen is the numeric whitespace character '_',
* backup to that.
*/