mirror of https://github.com/mpv-player/mpv
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:
parent
8653ed2183
commit
9986593b50
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue