summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nxt_http_static.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/nxt_http_static.c b/src/nxt_http_static.c
index 61dd0cb3..eef96c16 100644
--- a/src/nxt_http_static.c
+++ b/src/nxt_http_static.c
@@ -756,9 +756,7 @@ nxt_http_static_extract_extension(nxt_str_t *path, nxt_str_t *exten)
end = path->start + path->length;
p = end;
- for ( ;; ) {
- /* There's always '/' in the beginning of the request path. */
-
+ while (p > path->start) {
p--;
ch = *p;
@@ -767,11 +765,14 @@ nxt_http_static_extract_extension(nxt_str_t *path, nxt_str_t *exten)
p++;
/* Fall through. */
case '.':
- exten->length = end - p;
- exten->start = p;
- return;
+ goto extension;
}
}
+
+extension:
+
+ exten->length = end - p;
+ exten->start = p;
}