Skip to content

Commit b89f7c7

Browse files
committed
screenshot: only strip ext from basename
Since the filename property returns URLs unchanged `stripext` needs to establish the basename itself. This fixes an issue with the new behavior where `%F` in a screenshot template could have resulted in stripping beyond the top level domain, in case there were no dots after it.
1 parent ccde862 commit b89f7c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

player/screenshot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void screenshot_init(struct MPContext *mpctx)
7070

7171
static char *stripext(void *talloc_ctx, const char *s)
7272
{
73-
const char *end = strrchr(s, '.');
73+
const char *end = strrchr(mp_basename(s), '.');
7474
if (!end)
7575
end = s + strlen(s);
7676
return talloc_asprintf(talloc_ctx, "%.*s", (int)(end - s), s);

0 commit comments

Comments
 (0)