summaryrefslogtreecommitdiffstats
path: root/player/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-09 18:05:12 +0200
committerwm4 <wm4@nowhere>2015-06-09 18:21:56 +0200
commit9986593b5049d569a907d6242913e0a7798c2a85 (patch)
treef549bf0187fac594f8fb249813763ae0824ddef1 /player/command.c
parent8653ed2183466a841d789a529e371a1f61427a8e (diff)
downloadmpv-9986593b5049d569a907d6242913e0a7798c2a85.tar.bz2
mpv-9986593b5049d569a907d6242913e0a7798c2a85.tar.xz
command: make property event mask matching more restrictive
This was matching e.g. both "foo/bar" and "foobar" against "foo", when only the former should match. This could cause more property notifications than necessary.
Diffstat (limited to 'player/command.c')
-rw-r--r--player/command.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/player/command.c b/player/command.c
index 3f3311d772..25b99744db 100644
--- a/player/command.c
+++ b/player/command.c
@@ -3549,10 +3549,11 @@ static const char *const *const mp_event_property_change[] = {
};
#undef E
+// If there is no prefix, return length+1 (avoids matching full name as prefix).
static int prefix_len(const char *p)
{
const char *end = strchr(p, '/');
- return end ? end - p : strlen(p);
+ return end ? end - p : strlen(p) + 1;
}
static bool match_property(const char *a, const char *b)