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.
This commit is contained in:
wm4 2015-06-09 18:05:12 +02:00
parent 8653ed2183
commit 9986593b50
1 changed files with 2 additions and 1 deletions

View File

@ -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)