From a4489e74fb5171236420c878ed083e51036416bb Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 24 Jan 2014 00:10:04 +0000 Subject: Fix STRIP_TRAILING to work fully when COLLAPSE isn't requested. --- src/core/string.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/string.c b/src/core/string.c index 9df2cd3..3c2037f 100644 --- a/src/core/string.c +++ b/src/core/string.c @@ -1076,10 +1076,14 @@ dom_exception dom_string_whitespace_op(dom_string *s, } if (op & DOM_WHITESPACE_STRIP_TRAILING) { - if (temp_pos > temp) { + while (temp_pos > temp) { temp_pos--; - if (*temp_pos != ' ') + if (*temp_pos != ' ' && *temp_pos != '\t' && + *temp_pos != '\n' && *temp_pos != '\r' && + *temp_pos != '\f') { temp_pos++; + break; + } } } -- cgit v1.2.3