diff options
author | dgp <dgp@users.sourceforge.net> | 2011-04-28 14:39:42 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-04-28 14:39:42 (GMT) |
commit | 311dd13184c02f63bc2e2a474f28bfbb7d31ef0a (patch) | |
tree | 0d25400a3f10a579b1905153391d01db6cb2a9d4 /generic/tclListObj.c | |
parent | f12a5f957f0abf3155399f8902c9e4787013ce3d (diff) | |
download | tcl-311dd13184c02f63bc2e2a474f28bfbb7d31ef0a.zip tcl-311dd13184c02f63bc2e2a474f28bfbb7d31ef0a.tar.gz tcl-311dd13184c02f63bc2e2a474f28bfbb7d31ef0a.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 3b9dce6..d3465b0 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -1765,13 +1765,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. |