player/command: don't synthesize property names with a trailing /

This is not only cosmetic, but also avoids dummy get key action with
empty key. While this was allowed previously, I'm bit concerned about
Hyrum's law. But let's be strict about it.

This commit fixes current-tracks property.

Fixes: 95019fc256
This commit is contained in:
Kacper Michajłow committed 2025-02-08 05:45:57 +01:00
1 parent f9b95cb83d
commit bc430fdbb8
1 file changed
+1 -1
+1 -1
View File
@@ -2290,7 +2290,7 @@ static int mp_property_current_tracks(void *ctx, struct m_property *prop,
}
assert(index >= 0);
char *name = mp_tprintf(80, "track-list/%d/%s", index, rem);
char *name = mp_tprintf(80, "track-list/%d%s%s", index, *rem ? "/" : "", rem);
return mp_property_do(name, ka->action, ka->arg, ctx);
}