summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pugixpath.cpp3
-rw-r--r--tests/test_xpath_functions.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/pugixpath.cpp b/src/pugixpath.cpp
index ba447dd..70fe612 100644
--- a/src/pugixpath.cpp
+++ b/src/pugixpath.cpp
@@ -3401,8 +3401,7 @@ namespace pugi
// This is either a function call, or not - if not, we shall proceed with location path
const char* state = m_lexer.state();
- // $$$ signed char
- while (*state && *state <= 32) ++state;
+ while (is_chartype(*state, ct_space)) ++state;
if (*state != '(') return parse_location_path();
diff --git a/tests/test_xpath_functions.cpp b/tests/test_xpath_functions.cpp
index e34fac1..a0c59b8 100644
--- a/tests/test_xpath_functions.cpp
+++ b/tests/test_xpath_functions.cpp
@@ -682,6 +682,9 @@ TEST(xpath_function_arguments)
// lack of commas
CHECK_XPATH_FAIL("substring(1 2)");
+
+ // whitespace after function name
+ CHECK_XPATH_BOOLEAN(c, "true ()", true);
}
TEST_XML_FLAGS(xpath_string_value, "<node><c1>pcdata</c1><c2><child/></c2><c3 attr='avalue'/><c4><?target pivalue?></c4><c5><!--comment--></c5><c6><![CDATA[cdata]]></c6></node>", parse_default | parse_pi | parse_comments)