[xboxdrv] 54/78: Fixed \r\n newlines causing errors in INIParser, ignore \r like whitespace
Andrey Rahmatullin
wrar-guest at moszumanska.debian.org
Sun Feb 21 17:55:12 UTC 2016
This is an automated email from the git hooks/post-receive script.
wrar-guest pushed a commit to branch master
in repository xboxdrv.
commit 36f8f0cad0d4751f4b6ac7bfb31b68622fb028dd
Author: Ingo Ruhnke <grumbel at gmail.com>
Date: Tue Nov 3 19:58:23 2015 +0100
Fixed \r\n newlines causing errors in INIParser, ignore \r like whitespace
Fixes #153
---
src/ini_parser.cpp | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/ini_parser.cpp b/src/ini_parser.cpp
index 4a55ca6..4c530d1 100644
--- a/src/ini_parser.cpp
+++ b/src/ini_parser.cpp
@@ -48,7 +48,7 @@ INIParser::run()
eat_rest_of_line();
newline();
}
- else if (accept(' ') || accept('\t') || accept('\n'))
+ else if (accept(' ') || accept('\t') || accept('\n') || accept('\r'))
{
// eat whitespace
}
@@ -206,9 +206,9 @@ INIParser::get_value()
char last_c = -1;
while(peek() != '\n' &&
peek() != -1 &&
- !((last_c == ' ' || last_c == '\t') && (peek() == ';' || peek() == '#')))
+ !((last_c == ' ' || last_c == '\t' || last_c == '\r') && (peek() == ';' || peek() == '#')))
{
- if (peek() != ' ' && peek() != '\t')
+ if (peek() != ' ' && peek() != '\t' && peek() != '\r')
{
last_char = cur;
}
@@ -242,9 +242,9 @@ INIParser::get_ident()
while(peek() != '\n' &&
peek() != -1 &&
peek() != '=' &&
- !((last_c == ' ' || last_c == '\t') && (peek() == ';' || peek() == '#')))
+ !((last_c == ' ' || last_c == '\t' || last_c == '\r') && (peek() == ';' || peek() == '#')))
{
- if (peek() != ' ' && peek() != '\t')
+ if (peek() != ' ' && peek() != '\t' && peek() != '\r')
{
last_char = cur;
}
@@ -339,7 +339,7 @@ INIParser::get_section()
void
INIParser::whitespace()
{
- while(peek() == ' ' || peek() == '\t')
+ while(peek() == ' ' || peek() == '\t' || peek() == '\r')
{
next();
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/xboxdrv.git
More information about the Pkg-games-commits
mailing list