aboutsummaryrefslogtreecommitdiffstats
path: root/src/uri.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-31 12:37:57 +0100
committerDavid Robillard <d@drobilla.net>2020-12-31 12:37:57 +0100
commit8a93d0b3be5b6d80a1bef85bc73b2661f5ab4376 (patch)
treec65c3327fde67505a8f989e57cb245ee0f286cb9 /src/uri.c
parent19d8a055ff1e58a699e3679b701a1a60a2927243 (diff)
downloadserd-8a93d0b3be5b6d80a1bef85bc73b2661f5ab4376.tar.gz
serd-8a93d0b3be5b6d80a1bef85bc73b2661f5ab4376.tar.bz2
serd-8a93d0b3be5b6d80a1bef85bc73b2661f5ab4376.zip
Avoid "else" after "break" and "return"
Diffstat (limited to 'src/uri.c')
-rw-r--r--src/uri.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/uri.c b/src/uri.c
index 54ff1bba..718f24ee 100644
--- a/src/uri.c
+++ b/src/uri.c
@@ -33,7 +33,9 @@ serd_uri_to_path(const uint8_t* uri)
if (strncmp((const char*)uri, "file:", 5)) {
fprintf(stderr, "Non-file URI `%s'\n", uri);
return NULL;
- } else if (!strncmp((const char*)uri, "file://localhost/", 17)) {
+ }
+
+ if (!strncmp((const char*)uri, "file://localhost/", 17)) {
path = uri + 16;
} else if (!strncmp((const char*)uri, "file://", 7)) {
path = uri + 7;
@@ -41,6 +43,7 @@ serd_uri_to_path(const uint8_t* uri)
fprintf(stderr, "Invalid file URI `%s'\n", uri);
return NULL;
}
+
if (is_windows_path(path + 1)) {
++path; // Special case for terrible Windows file URIs
}
@@ -106,7 +109,9 @@ serd_uri_string_has_scheme(const uint8_t* utf8)
for (uint8_t c = 0; (c = *++utf8) != '\0';) {
if (!is_uri_scheme_char(c)) {
return false;
- } else if (c == ':') {
+ }
+
+ if (c == ':') {
return true; // End of scheme
}
}