Skip to content

Commit

Permalink
player/command: don't synthesize property names with a trailing /
Browse files Browse the repository at this point in the history
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: 95019fc
  • Loading branch information
kasper93 committed Feb 8, 2025
1 parent f9b95cb commit bc430fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion player/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit bc430fd

Please sign in to comment.