summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2011-02-01 05:25:19 +0100
committerMichael Brown2011-02-01 05:25:19 +0100
commitd77b183f103227bb67b300017add920ab14f6912 (patch)
treeb53c69521246ab6d43ec8c0c1fa0e46e01cfbfaa
parent[autoboot] Avoid using uri_dup() for constructed TFTP URI (diff)
downloadipxe-d77b183f103227bb67b300017add920ab14f6912.tar.gz
ipxe-d77b183f103227bb67b300017add920ab14f6912.tar.xz
ipxe-d77b183f103227bb67b300017add920ab14f6912.zip
[uri] Add uri_has_path()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/include/ipxe/uri.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/include/ipxe/uri.h b/src/include/ipxe/uri.h
index cb0898e42..b7b8b4417 100644
--- a/src/include/ipxe/uri.h
+++ b/src/include/ipxe/uri.h
@@ -114,6 +114,16 @@ static inline int uri_is_absolute ( struct uri *uri ) {
}
/**
+ * URI has a path
+ *
+ * @v uri URI
+ * @ret has_path URI has a path
+ */
+static inline int uri_has_path ( struct uri *uri ) {
+ return ( uri->path && ( uri->path[0] != '\0' ) );
+}
+
+/**
* URI has an absolute path
*
* @v uri URI