summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
Diffstat (limited to 'tool')
-rw-r--r--tool/uriparse.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tool/uriparse.c b/tool/uriparse.c
index c844ec6..e9c1218 100644
--- a/tool/uriparse.c
+++ b/tool/uriparse.c
@@ -36,6 +36,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <sys/socket.h>
#include <stdio.h>
#include <stdlib.h>
#include <uriparser/Uri.h>
@@ -110,7 +111,15 @@ int main(int argc, char *argv[]) {
if (uri.fragment.first) {
printf("fragment: %.*s\n", RANGE(uri.fragment));
}
- printf("absolutePath: %s\n", (uri.absolutePath == URI_TRUE) ? "true" : "false");
+ {
+ 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");