summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <jan.nijtmans@noemail.net>2015-11-13 08:40:54 (GMT)
committerjan.nijtmans <jan.nijtmans@noemail.net>2015-11-13 08:40:54 (GMT)
commit8bcc67eb00d6d5526731c74649075d0b2c25fd24 (patch)
treeaa8a9db232881758b1798d6acc889f24e1a8b139
parenta6e03da305020eb2b57bf953f9e6e9c3523ad001 (diff)
downloadtcl-8bcc67eb00d6d5526731c74649075d0b2c25fd24.zip
tcl-8bcc67eb00d6d5526731c74649075d0b2c25fd24.tar.gz
tcl-8bcc67eb00d6d5526731c74649075d0b2c25fd24.tar.bz2
Fix [https://www.sqlite.org/src/info/34eb6911afee09e7|34eb6911af], taken over from SQLite: Fix uses of ctype functions (ex: isspace()) on signed characters in test programs and in some obscure extensions. No changes to the core.
FossilOrigin-Name: 642858bfbe0912d50e86d867eb2dddfee8714fd0
-rw-r--r--win/nmakehlp.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/win/nmakehlp.c b/win/nmakehlp.c
index d0edcf0..84cf75c 100644
--- a/win/nmakehlp.c
+++ b/win/nmakehlp.c
@@ -498,9 +498,10 @@ GetVersionFromFile(
p = strstr(szBuffer, match);
if (p != NULL) {
/*
- * Skip to first digit.
+ * Skip to first digit after the match.
*/
+ p += strlen(match);
while (*p && !isdigit(*p)) {
++p;
}
@@ -605,8 +606,8 @@ SubstituteFile(
sp = fopen(substitutions, "rt");
if (sp != NULL) {
while (fgets(szBuffer, cbBuffer, sp) != NULL) {
- char *ks, *ke, *vs, *ve;
- ks = szBuffer;
+ unsigned char *ks, *ke, *vs, *ve;
+ ks = (unsigned char*)szBuffer;
while (ks && *ks && isspace(*ks)) ++ks;
ke = ks;
while (ke && *ke && !isspace(*ke)) ++ke;
@@ -615,7 +616,7 @@ SubstituteFile(
ve = vs;
while (ve && *ve && !(*ve == '\r' || *ve == '\n')) ++ve;
*ke = 0, *ve = 0;
- list_insert(&substPtr, ks, vs);
+ list_insert(&substPtr, (char*)ks, (char*)vs);
}
fclose(sp);
}
@@ -630,11 +631,11 @@ SubstituteFile(
}
}
#endif
-
+
/*
* Run the substitutions over each line of the input
*/
-
+
while (fgets(szBuffer, cbBuffer, fp) != NULL) {
list_item_t *p = NULL;
for (p = substPtr; p != NULL; p = p->nextPtr) {
@@ -654,7 +655,7 @@ SubstituteFile(
}
printf(szBuffer);
}
-
+
list_free(&substPtr);
}
fclose(fp);