From 17b5985bb85e9234a9668fbfd548e9b3d0f98ebd Mon Sep 17 00:00:00 2001 From: aet Date: Thu, 20 Nov 2003 17:48:02 +0000 Subject: [PATCH] - Fixed CRLF parsing git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1629 c6295689-39f2-0310-b995-f0e70906c6a9 --- src/scconf/sclex.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/scconf/sclex.c b/src/scconf/sclex.c index a5011298..f13ffe23 100644 --- a/src/scconf/sclex.c +++ b/src/scconf/sclex.c @@ -125,7 +125,7 @@ static int scconf_lex_engine(scconf_parser * parser, BUFHAN * bp) switch (this_char = buf_nextch(bp)) { case '#': /* comment till end of line */ - buf_eat_till(bp, '#', "\n"); + buf_eat_till(bp, '#', "\r\n"); scconf_parse_token(parser, TOKEN_TYPE_COMMENT, bp->buf); buf_zero(bp); continue; @@ -134,6 +134,7 @@ static int scconf_lex_engine(scconf_parser * parser, BUFHAN * bp) continue; case ' ': case '\t': + case '\r': /* eat up whitespace */ continue; case ',': @@ -146,7 +147,7 @@ static int scconf_lex_engine(scconf_parser * parser, BUFHAN * bp) buf_zero(bp); continue; case '"': - buf_eat_till(bp, (char) this_char, "\"\n"); + buf_eat_till(bp, (char) this_char, "\"\r\n"); buf_addch(bp, (char) buf_nextch(bp)); scconf_parse_token(parser, TOKEN_TYPE_STRING, bp->buf); buf_zero(bp); @@ -154,7 +155,7 @@ static int scconf_lex_engine(scconf_parser * parser, BUFHAN * bp) case EOF: break; default: - buf_eat_till(bp, (char) this_char, ";,{}= \t\n"); + buf_eat_till(bp, (char) this_char, ";,{}= \t\r\n"); scconf_parse_token(parser, TOKEN_TYPE_STRING, bp->buf); buf_zero(bp); continue;