From 9986593b5049d569a907d6242913e0a7798c2a85 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 9 Jun 2015 18:05:12 +0200 Subject: 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. --- player/command.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'player/command.c') 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) -- cgit v1.2.3