summaryrefslogtreecommitdiffstats
path: root/options/path.c
diff options
context:
space:
mode:
Diffstat (limited to 'options/path.c')
-rw-r--r--options/path.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/options/path.c b/options/path.c
index 17d6245582..304f009167 100644
--- a/options/path.c
+++ b/options/path.c
@@ -155,11 +155,11 @@ char *mp_splitext(const char *path, bstr *root)
{
assert(path);
const char *split = strrchr(path, '.');
- if (!split)
- split = path + strlen(path);
+ if (!split || !split[1] || strchr(split, '/'))
+ return NULL;
if (root)
- *root = (bstr){.start = (char *)path, .len = path - split};
- return (char *)split;
+ *root = (bstr){(char *)path, split - path};
+ return (char *)split + 1;
}
char *mp_path_join(void *talloc_ctx, struct bstr p1, struct bstr p2)