summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2018-02-07 10:57:35 +0100
committerSebastian Pipping <sebastian@pipping.org>2018-02-07 11:08:59 +0100
commita3b9bc31553d4d8e9f162e2b995aa7567f5cdcd1 (patch)
tree3331c4aefbde377a2c4fcddf9d884d11cb87d075
parent4305c663f82207daea99076a154a6ffce9747fc5 (diff)
downloaduriparser-a3b9bc31553d4d8e9f162e2b995aa7567f5cdcd1.tar.gz
Communicate that absolutePath is always false for URIs with a host (#2)
-rw-r--r--ChangeLog3
-rw-r--r--include/uriparser/Uri.h3
-rw-r--r--tool/uriparse.c4
3 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 28194f4..d1c053c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,9 @@
Thanks to Joel Cunningham for the report!
* Fixed: API documentation front page no longer empty with Doxygen 1.8.13
* Fixed: "make -C doc install" fixed for lack of .map files
+ * Improved: Communicate that absolutePath is always URI_FALSE for URIs
+ with a host in uriparse CLI tool output and Uri.h header
+ (GitHub #2, SF.net #30)
* Soname: 1:21:0
2015-10-12 -- 0.8.4
diff --git a/include/uriparser/Uri.h b/include/uriparser/Uri.h
index b6d6fc9..2431f42 100644
--- a/include/uriparser/Uri.h
+++ b/include/uriparser/Uri.h
@@ -157,7 +157,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 <c>URI_FALSE</c> for URIs with host */
UriBool owner; /**< Memory owner flag */
void * reserved; /**< Reserved to the parser */
diff --git a/tool/uriparse.c b/tool/uriparse.c
index 5ac105d..e9c1218 100644
--- a/tool/uriparse.c
+++ b/tool/uriparse.c
@@ -115,6 +115,10 @@ int main(int argc, char *argv[]) {
const char * const absolutePathLabel = "absolutePath: ";
printf("%s%s\n", absolutePathLabel,
(uri.absolutePath == URI_TRUE) ? "true" : "false");
+ if (uri.hostText.first != NULL) {
+ printf("%*s%s\n", (int)strlen(absolutePathLabel), "",
+ "(always false for URIs with host)");
+ }
}
}
printf("\n");