commit bb9fc6f905abaa403825acb76593b3b93c0a9074 parent f69e0c660aadda02f69398a8423b2c9466d4f1c1 Author: Gert Goet <gert@thinkcreate.dk> Date: Sat, 11 Feb 2023 18:03:02 +0100 Always stop at first whitespace Diffstat:
M | damus-c/damus.c | | | 4 | ++-- |
M | damusTests/damusTests.swift | | | 2 | +- |
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/damus-c/damus.c b/damus-c/damus.c @@ -55,8 +55,8 @@ static int consume_until_whitespace(struct cursor *cur, int or_end) { while (cur->p < cur->end) { c = *cur->p; - if (is_whitespace(c) && consumedAtLeastOne) - return 1; + if (is_whitespace(c)) + return consumedAtLeastOne; cur->p++; consumedAtLeastOne = true; diff --git a/damusTests/damusTests.swift b/damusTests/damusTests.swift @@ -141,7 +141,7 @@ class damusTests: XCTestCase { } func testNoParseUrlWithOnlyWhitespace() { - let testString = "https:// " + let testString = "https:// " let parsed = parse_mentions(content: testString, tags: []) XCTAssertNotNil(parsed)