projects
/
platform
/
upstream
/
make.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
31cbc49
)
fix whitespace tokenization
author
Anas Nashif
<anas.nashif@intel.com>
Mon, 5 Nov 2012 19:21:10 +0000
(11:21 -0800)
committer
Anas Nashif
<anas.nashif@intel.com>
Mon, 5 Nov 2012 19:21:10 +0000
(11:21 -0800)
function.c
patch
|
blob
|
history
diff --git
a/function.c
b/function.c
index
e2f6c8c
..
680e954
100644
(file)
--- a/
function.c
+++ b/
function.c
@@
-1133,19
+1133,14
@@
func_sort (char *o, char **argv, const char *funcname UNUSED)
/* Find the maximum number of words we'll have. */
t = argv[0];
- wordi =
1
;
- while (
*t != '\0'
)
+ wordi =
0
;
+ while (
(p = find_next_token (&t, &len)) != 0
)
{
- char c = *(t++);
-
- if (! isspace ((unsigned char)c))
- continue;
-
- ++wordi;
-
- while (isspace ((unsigned char)*t))
- ++t;
+ ++t;
+ wordi++;
}
+ if (! wordi)
+ wordi = 1;
words = xmalloc (wordi * sizeof (char *));