summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshdown <shdownnine@gmail.com>2014-10-16 17:40:19 +0400
committerAlessandro Ghedini <alessandro@ghedini.me>2014-10-18 15:04:54 +0200
commit3fae6aaae80026c5601c1956e46c07fcb65d0a68 (patch)
treede2d6b7d5cd9d92f4692ceb5825bc86e274c1cb8
parent919540ce8e889e08c0b5f2235b36136f80cb0d6e (diff)
downloadmpv-3fae6aaae80026c5601c1956e46c07fcb65d0a68.tar.bz2
mpv-3fae6aaae80026c5601c1956e46c07fcb65d0a68.tar.xz
player: quote %-starting strings
Leading percent sign is a quote indicator so it needs to be quoted itself.
-rw-r--r--player/configfiles.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/player/configfiles.c b/player/configfiles.c
index f7ab41cd72..bbc7ecc12a 100644
--- a/player/configfiles.c
+++ b/player/configfiles.c
@@ -266,6 +266,8 @@ void mp_get_resume_defaults(struct MPContext *mpctx)
// Should follow what parser-cfg.c does/needs
static bool needs_config_quoting(const char *s)
{
+ if (s[0] == '%')
+ return true;
for (int i = 0; s && s[i]; i++) {
unsigned char c = s[i];
if (!mp_isprint(c) || mp_isspace(c) || c == '#' || c == '\'' || c == '"')