From b824c204a6a8016f954865f5b6d002e603eba489 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Sun, 19 Nov 2023 12:11:54 +0100 Subject: [PATCH] parser: fix IPv6 detection Signed-off-by: Simon Rozman --- include/stdex/parser.hpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/stdex/parser.hpp b/include/stdex/parser.hpp index c38e1d2c5..095d1e9c0 100644 --- a/include/stdex/parser.hpp +++ b/include/stdex/parser.hpp @@ -2627,7 +2627,9 @@ namespace stdex bool is_empty = true; if (m_separator->match(text, this->interval.end, end, flags)) { - if (m_separator->match(text, m_separator->interval.end, end, flags)) { + // : found + this->interval.end = m_separator->interval.end; + if (m_separator->match(text, this->interval.end, end, flags)) { // :: found if (compaction_i == SIZE_MAX) { // Zero compaction start @@ -2640,11 +2642,7 @@ namespace stdex break; } } - else if (i) { - // Inner : found - this->interval.end = m_separator->interval.end; - } - else { + else if (!i) { // Leading : found goto error; }