diff options
Diffstat (limited to 'src/UriParse.c')
-rw-r--r-- | src/UriParse.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/UriParse.c b/src/UriParse.c index 59a398b..e3cdc68 100644 --- a/src/UriParse.c +++ b/src/UriParse.c @@ -709,8 +709,20 @@ static const URI_CHAR * URI_FUNC(ParseIPv6address2)(URI_TYPE(ParserState) * stat { int setZipper = 0; + if (digitCount > 0) { + if (zipperEver) { + uriWriteQuadToDoubleByte(digitHistory, digitCount, quadsAfterZipper + 2 * quadsAfterZipperCount); + quadsAfterZipperCount++; + } else { + uriWriteQuadToDoubleByte(digitHistory, digitCount, state->uri->hostData.ip6->data + 2 * quadsDone); + } + quadsDone++; + digitCount = 0; + } + letterAmong = 0; + /* Too many quads? */ - if (quadsDone > 8 - zipperEver) { + if (quadsDone >= 8 - zipperEver) { URI_FUNC(StopSyntax)(state, first); return NULL; } @@ -743,17 +755,6 @@ static const URI_CHAR * URI_FUNC(ParseIPv6address2)(URI_TYPE(ParserState) * stat return NULL; /* ":::+ "*/ } } - if (digitCount > 0) { - if (zipperEver) { - uriWriteQuadToDoubleByte(digitHistory, digitCount, quadsAfterZipper + 2 * quadsAfterZipperCount); - quadsAfterZipperCount++; - } else { - uriWriteQuadToDoubleByte(digitHistory, digitCount, state->uri->hostData.ip6->data + 2 * quadsDone); - } - quadsDone++; - digitCount = 0; - } - letterAmong = 0; if (setZipper) { zipperEver = 1; |