History

Don't be fooled by trailing '/' in url-parameter

cgit_parse_url() didn't check if the path-part of urls contained a real path or just a trailing slash. This made the log-page die since the path filtering supplied an invalid path argument. This fixes it.

Lars Hjemli committed 19 years ago

Commit 3de63b21 parent 72fa5c61 file · +2 −1Browse files

Unified · Split

parsing.c+2−1
@@ -167,7 +167,8 @@ void cgit_parse_url(const char *url) · 166 unmodified lines
167 p = strchr(cmd + 1, '/');167 p = strchr(cmd + 1, '/');
168 if (p) {168 if (p) {
169 p[0] = '\0';169 p[0] = '\0';
170 cgit_query_path = xstrdup(p + 1);170 if (p[1])
171 cgit_query_path = xstrdup(p + 1);
171 }172 }
172 cgit_cmd = cgit_get_cmd_index(cmd + 1);173 cgit_cmd = cgit_get_cmd_index(cmd + 1);
173 cgit_query_page = xstrdup(cmd + 1);174 cgit_query_page = xstrdup(cmd + 1);