diff options
author | Ran Benita <ran@unusedvar.com> | 2019-12-28 14:19:22 +0200 |
---|---|---|
committer | Ran Benita <ran@unusedvar.com> | 2019-12-28 14:19:22 +0200 |
commit | fadfb13c42927ada3fd6d9d3f173be384b6c0c4d (patch) | |
tree | a8bf97ea6489a7890a8c0fa4ee8b636124aae6d1 | |
parent | d1e39c111ed9b1042f7e22ebb7379a99d44730a4 (diff) | |
download | libxkbcommon-fadfb13c42927ada3fd6d9d3f173be384b6c0c4d.tar.gz libxkbcommon-fadfb13c42927ada3fd6d9d3f173be384b6c0c4d.tar.bz2 libxkbcommon-fadfb13c42927ada3fd6d9d3f173be384b6c0c4d.zip |
xkbcomp/rules: support \r\n line endings
Signed-off-by: Ran Benita <ran@unusedvar.com>
-rw-r--r-- | src/xkbcomp/rules.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xkbcomp/rules.c b/src/xkbcomp/rules.c index a4cfe49..80a1372 100644 --- a/src/xkbcomp/rules.c +++ b/src/xkbcomp/rules.c @@ -86,7 +86,7 @@ lex(struct scanner *s, union lvalue *val) { skip_more_whitespace_and_comments: /* Skip spaces. */ - while (chr(s, ' ') || chr(s, '\t')); + while (chr(s, ' ') || chr(s, '\t') || chr(s, '\r')); /* Skip comments. */ if (lit(s, "//")) { @@ -101,6 +101,8 @@ skip_more_whitespace_and_comments: /* Escaped line continuation. */ if (chr(s, '\\')) { + /* Optional \r. */ + chr(s, '\r'); if (!eol(s)) { scanner_err(s, "illegal new line escape; must appear at end of line"); return TOK_ERROR; |