1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-25 04:38:01 +00:00

command: don't require whitespace before ';' or '#'

This change is probably too simplistic, but most things appear to work,
so I don't care about that now.

Fixes #1232.
This commit is contained in:
wm4 2014-10-31 23:53:39 +01:00
parent 13d408fe8d
commit 75afef6463

View File

@ -197,10 +197,7 @@ error:
static bool read_token(bstr str, bstr *out_rest, bstr *out_token)
{
bstr t = bstr_lstrip(str);
char nextc = t.len > 0 ? t.start[0] : 0;
if (nextc == '#' || nextc == ';')
return false; // comment or command separator
int next = bstrcspn(t, WHITESPACE);
int next = bstrcspn(t, WHITESPACE "#;");
if (!next)
return false;
*out_token = bstr_splice(t, 0, next);