diff options
author | dgp <dgp@users.sourceforge.net> | 2011-04-28 14:44:47 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-04-28 14:44:47 (GMT) |
commit | 2df55486c49d238b2f888339b84efa9766b4d94a (patch) | |
tree | c826199d351b0c6f0746a66124227d102686a420 /generic/tclListObj.c | |
parent | 2435833802cb8f2de9590380a2aa3e200c9840ab (diff) | |
parent | 311dd13184c02f63bc2e2a474f28bfbb7d31ef0a (diff) | |
download | tcl-2df55486c49d238b2f888339b84efa9766b4d94a.zip tcl-2df55486c49d238b2f888339b84efa9766b4d94a.tar.gz tcl-2df55486c49d238b2f888339b84efa9766b4d94a.tar.bz2 |
New utility routines: TclIsSpaceProc() and TclCountSpaceRuns()
Use to replace calls to isspace() and their /* INTL */ risk.
Diffstat (limited to 'generic/tclListObj.c')
-rw-r--r-- | generic/tclListObj.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/generic/tclListObj.c b/generic/tclListObj.c index 88b3a0b..9437f7e 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -1789,13 +1789,7 @@ SetListFromAny( * elements by counting the number of space characters in the list. */ - limit = string + length; - estCount = 1; - for (p = string; p < limit; p++) { - if (isspace(UCHAR(*p))) { /* INTL: ISO space. */ - estCount++; - } - } + estCount = TclCountSpaceRuns(string, length, &limit) + 1; /* * Allocate a new List structure with enough room for "estCount" elements. |