From c5cd0e491238397bd9cafff2707773146305a528 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Thu, 31 May 2018 15:32:09 +0200 Subject: updated bundled version of uriparser to 0.8.5 --- ACKNOWLEDGEMENTS | 2 +- plugins/uriparser/Uri.h | 10 ++++++---- plugins/uriparser/UriBase.h | 4 ++-- plugins/uriparser/UriCommon.c | 2 +- plugins/uriparser/UriCompare.c | 2 +- plugins/uriparser/UriDefsAnsi.h | 2 +- plugins/uriparser/UriDefsConfig.h | 4 ++-- plugins/uriparser/UriDefsUnicode.h | 2 +- plugins/uriparser/UriEscape.c | 2 +- plugins/uriparser/UriFile.c | 4 ++-- plugins/uriparser/UriIp4.c | 2 +- plugins/uriparser/UriIp4.h | 2 +- plugins/uriparser/UriIp4Base.c | 2 +- plugins/uriparser/UriNormalize.c | 4 ++-- plugins/uriparser/UriNormalizeBase.c | 2 +- plugins/uriparser/UriParse.c | 10 +++++----- plugins/uriparser/UriParseBase.c | 2 +- plugins/uriparser/UriQuery.c | 2 +- plugins/uriparser/UriRecompose.c | 2 +- plugins/uriparser/UriResolve.c | 6 ++++-- plugins/uriparser/UriShorten.c | 4 ++-- 21 files changed, 38 insertions(+), 34 deletions(-) diff --git a/ACKNOWLEDGEMENTS b/ACKNOWLEDGEMENTS index 06e84e25..a8c4ba0f 100644 --- a/ACKNOWLEDGEMENTS +++ b/ACKNOWLEDGEMENTS @@ -39,7 +39,7 @@ https://github.com/h2o/picohttpparser Use of the library for HTTP header parsing in check_curl. Copyright (C) 2007, Weijia Song -Copyright (C) 2007, Sebastian Pipping +Copyright (C) 2007, Sebastian Pipping All rights reserved. uriparser - RFC 3986 URI parsing library http://uriparser.sourceforge.net/ diff --git a/plugins/uriparser/Uri.h b/plugins/uriparser/Uri.h index 4a185808..a3f7914b 100644 --- a/plugins/uriparser/Uri.h +++ b/plugins/uriparser/Uri.h @@ -1,8 +1,9 @@ -/* +/* f9ca23a99fc1c8ff610e2bdc0bff3c4bb4d883ccbff5851fe7a1398f9b6aca57 (0.8.5+) + * * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -157,7 +158,8 @@ typedef struct URI_TYPE(UriStruct) { URI_TYPE(PathSegment) * pathTail; /**< Tail of the list behind pathHead */ URI_TYPE(TextRange) query; /**< Query without leading "?" */ URI_TYPE(TextRange) fragment; /**< Query without leading "#" */ - UriBool absolutePath; /**< Absolute path flag, distincting "a" and "/a" */ + UriBool absolutePath; /**< Absolute path flag, distincting "a" and "/a"; + always URI_FALSE for URIs with host */ UriBool owner; /**< Memory owner flag */ void * reserved; /**< Reserved to the parser */ @@ -567,7 +569,7 @@ int URI_FUNC(UriStringToUnixFilename)(const URI_CHAR * uriString, /** * Extracts a Windows filename from a %URI string. - * The destination buffer must be large enough to hold len(uriString) + 1 - 8 + * The destination buffer must be large enough to hold len(uriString) + 1 - 5 * characters in case of an absolute %URI or len(uriString) + 1 in case * of a relative %URI. * diff --git a/plugins/uriparser/UriBase.h b/plugins/uriparser/UriBase.h index bc63b059..45ba5abd 100644 --- a/plugins/uriparser/UriBase.h +++ b/plugins/uriparser/UriBase.h @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,7 +55,7 @@ /* Version */ #define URI_VER_MAJOR 0 #define URI_VER_MINOR 8 -#define URI_VER_RELEASE 4 +#define URI_VER_RELEASE 5 #define URI_VER_SUFFIX_ANSI "" #define URI_VER_SUFFIX_UNICODE URI_ANSI_TO_UNICODE(URI_VER_SUFFIX_ANSI) diff --git a/plugins/uriparser/UriCommon.c b/plugins/uriparser/UriCommon.c index 37d6b39d..571d6d48 100644 --- a/plugins/uriparser/UriCommon.c +++ b/plugins/uriparser/UriCommon.c @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/uriparser/UriCompare.c b/plugins/uriparser/UriCompare.c index 6896f64e..35f5a13d 100644 --- a/plugins/uriparser/UriCompare.c +++ b/plugins/uriparser/UriCompare.c @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/uriparser/UriDefsAnsi.h b/plugins/uriparser/UriDefsAnsi.h index deaefaa5..d6dbcad1 100644 --- a/plugins/uriparser/UriDefsAnsi.h +++ b/plugins/uriparser/UriDefsAnsi.h @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/uriparser/UriDefsConfig.h b/plugins/uriparser/UriDefsConfig.h index d87ccb63..9f7ac65f 100644 --- a/plugins/uriparser/UriDefsConfig.h +++ b/plugins/uriparser/UriDefsConfig.h @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -88,7 +88,7 @@ /* http://predef.sourceforge.net/precomp.html#sec32 */ /* http://msdn2.microsoft.com/en-us/library/ms882281.aspx */ # define URI_INLINE __forceinline -#elif (__STDC_VERSION__ >= 199901L) +#elif (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) /* C99, "inline" is a keyword */ # define URI_INLINE inline #else diff --git a/plugins/uriparser/UriDefsUnicode.h b/plugins/uriparser/UriDefsUnicode.h index fa4befcd..8bb8bc2b 100644 --- a/plugins/uriparser/UriDefsUnicode.h +++ b/plugins/uriparser/UriDefsUnicode.h @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/uriparser/UriEscape.c b/plugins/uriparser/UriEscape.c index 79ee3a68..17f8badf 100644 --- a/plugins/uriparser/UriEscape.c +++ b/plugins/uriparser/UriEscape.c @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/uriparser/UriFile.c b/plugins/uriparser/UriFile.c index 9cf788fc..332f6a9f 100644 --- a/plugins/uriparser/UriFile.c +++ b/plugins/uriparser/UriFile.c @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -83,7 +83,7 @@ static URI_INLINE int URI_FUNC(FilenameToUriString)(const URI_CHAR * filename, is_windows_network = (filename[0] == _UT('\\')) && (filename[1] == _UT('\\')); absolute = fromUnix ? (filename[0] == _UT('/')) - : ((filename[0] != _UT('\0')) && (filename[1] == _UT(':')) + : (((filename[0] != _UT('\0')) && (filename[1] == _UT(':'))) || is_windows_network); if (absolute) { diff --git a/plugins/uriparser/UriIp4.c b/plugins/uriparser/UriIp4.c index c00910bb..ee067d32 100644 --- a/plugins/uriparser/UriIp4.c +++ b/plugins/uriparser/UriIp4.c @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/uriparser/UriIp4.h b/plugins/uriparser/UriIp4.h index 885a35ca..9251c490 100644 --- a/plugins/uriparser/UriIp4.h +++ b/plugins/uriparser/UriIp4.h @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/uriparser/UriIp4Base.c b/plugins/uriparser/UriIp4Base.c index 5cd298fa..f0662465 100644 --- a/plugins/uriparser/UriIp4Base.c +++ b/plugins/uriparser/UriIp4Base.c @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/uriparser/UriNormalize.c b/plugins/uriparser/UriNormalize.c index 49db9fff..d68c3718 100644 --- a/plugins/uriparser/UriNormalize.c +++ b/plugins/uriparser/UriNormalize.c @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -434,8 +434,8 @@ static URI_INLINE UriBool URI_FUNC(MakeOwner)(URI_TYPE(Uri) * uri, && (ranger->text.afterLast != NULL) && (ranger->text.afterLast > ranger->text.first)) { free((URI_CHAR *)ranger->text.first); - free(ranger); } + free(ranger); ranger = next; } diff --git a/plugins/uriparser/UriNormalizeBase.c b/plugins/uriparser/UriNormalizeBase.c index bac58886..8dbe7fd1 100644 --- a/plugins/uriparser/UriNormalizeBase.c +++ b/plugins/uriparser/UriNormalizeBase.c @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/uriparser/UriParse.c b/plugins/uriparser/UriParse.c index e3cdc68d..5eee16d3 100644 --- a/plugins/uriparser/UriParse.c +++ b/plugins/uriparser/UriParse.c @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -193,7 +193,7 @@ static UriBool URI_FUNC(OnExitOwnPortUserInfo)(URI_TYPE(ParserState) * state, co static UriBool URI_FUNC(OnExitSegmentNzNcOrScheme2)(URI_TYPE(ParserState) * state, const URI_CHAR * first); static void URI_FUNC(OnExitPartHelperTwo)(URI_TYPE(ParserState) * state); -static void URI_FUNC(ResetParserState)(URI_TYPE(ParserState) * state); +static void URI_FUNC(ResetParserStateExceptUri)(URI_TYPE(ParserState) * state); static UriBool URI_FUNC(PushPathSegment)(URI_TYPE(ParserState) * state, const URI_CHAR * first, const URI_CHAR * afterLast); @@ -2022,7 +2022,7 @@ static const URI_CHAR * URI_FUNC(ParseZeroMoreSlashSegs)(URI_TYPE(ParserState) * -static URI_INLINE void URI_FUNC(ResetParserState)(URI_TYPE(ParserState) * state) { +static URI_INLINE void URI_FUNC(ResetParserStateExceptUri)(URI_TYPE(ParserState) * state) { URI_TYPE(Uri) * const uriBackup = state->uri; memset(state, 0, sizeof(URI_TYPE(ParserState))); state->uri = uriBackup; @@ -2071,7 +2071,7 @@ int URI_FUNC(ParseUriEx)(URI_TYPE(ParserState) * state, const URI_CHAR * first, uri = state->uri; /* Init parser */ - URI_FUNC(ResetParserState)(state); + URI_FUNC(ResetParserStateExceptUri)(state); URI_FUNC(ResetUri)(uri); /* Parse */ @@ -2211,9 +2211,9 @@ UriBool URI_FUNC(_TESTING_ONLY_ParseIpSix)(const URI_CHAR * text) { const URI_CHAR * const afterIpSix = text + URI_STRLEN(text); const URI_CHAR * res; - URI_FUNC(ResetParserState)(&parser); URI_FUNC(ResetUri)(&uri); parser.uri = &uri; + URI_FUNC(ResetParserStateExceptUri)(&parser); parser.uri->hostData.ip6 = malloc(1 * sizeof(UriIp6)); res = URI_FUNC(ParseIPv6address2)(&parser, text, afterIpSix); URI_FUNC(FreeUriMembers)(&uri); diff --git a/plugins/uriparser/UriParseBase.c b/plugins/uriparser/UriParseBase.c index 75e47613..1d4ef6e2 100644 --- a/plugins/uriparser/UriParseBase.c +++ b/plugins/uriparser/UriParseBase.c @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/uriparser/UriQuery.c b/plugins/uriparser/UriQuery.c index 7adb0736..f0cd4f83 100644 --- a/plugins/uriparser/UriQuery.c +++ b/plugins/uriparser/UriQuery.c @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/uriparser/UriRecompose.c b/plugins/uriparser/UriRecompose.c index 09daee07..9678aac2 100644 --- a/plugins/uriparser/UriRecompose.c +++ b/plugins/uriparser/UriRecompose.c @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/plugins/uriparser/UriResolve.c b/plugins/uriparser/UriResolve.c index 3660b6b2..bb1d21a8 100644 --- a/plugins/uriparser/UriResolve.c +++ b/plugins/uriparser/UriResolve.c @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -152,6 +152,8 @@ static int URI_FUNC(AddBaseUriImpl)(URI_TYPE(Uri) * absDest, const URI_TYPE(Uri) * relSource, const URI_TYPE(Uri) * absBase, UriResolutionOptions options) { + UriBool relSourceHasScheme; + if (absDest == NULL) { return URI_ERROR_NULL; } @@ -169,7 +171,7 @@ static int URI_FUNC(AddBaseUriImpl)(URI_TYPE(Uri) * absDest, /* [00/32] -- A non-strict parser may ignore a scheme in the reference */ /* [00/32] -- if it is identical to the base URI's scheme. */ /* [00/32] if ((not strict) and (R.scheme == Base.scheme)) then */ - UriBool relSourceHasScheme = (relSource->scheme.first != NULL) ? URI_TRUE : URI_FALSE; + relSourceHasScheme = (relSource->scheme.first != NULL) ? URI_TRUE : URI_FALSE; if ((options & URI_RESOLVE_IDENTICAL_SCHEME_COMPAT) && (absBase->scheme.first != NULL) && (relSource->scheme.first != NULL) diff --git a/plugins/uriparser/UriShorten.c b/plugins/uriparser/UriShorten.c index c839ae53..0145f684 100644 --- a/plugins/uriparser/UriShorten.c +++ b/plugins/uriparser/UriShorten.c @@ -2,7 +2,7 @@ * uriparser - RFC 3986 URI parsing library * * Copyright (C) 2007, Weijia Song - * Copyright (C) 2007, Sebastian Pipping + * Copyright (C) 2007, Sebastian Pipping * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -131,7 +131,7 @@ static URI_INLINE UriBool URI_FUNC(EqualsAuthority)(const URI_TYPE(Uri) * first, -int URI_FUNC(RemoveBaseUriImpl)(URI_TYPE(Uri) * dest, +static int URI_FUNC(RemoveBaseUriImpl)(URI_TYPE(Uri) * dest, const URI_TYPE(Uri) * absSource, const URI_TYPE(Uri) * absBase, UriBool domainRootMode) { -- cgit v1.2.3