Diffstat (limited to 'library/backend/vcc_yacc.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | library/backend/vcc_yacc.cpp | 139 |
1 files changed, 79 insertions, 60 deletions
diff --git a/library/backend/vcc_yacc.cpp b/library/backend/vcc_yacc.cpp index b2b0c14..5649522 100644 --- a/library/backend/vcc_yacc.cpp +++ b/library/backend/vcc_yacc.cpp | |||
@@ -160,3 +160,3 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. | |||
160 | /*#else */ | 160 | /*#else */ |
161 | #include <qtopia/private/vobject_p.h> | 161 | #include "vobject_p.h" |
162 | /*#endif */ | 162 | /*#endif */ |
@@ -745,3 +745,3 @@ static char* lexGet1Value() { | |||
745 | lexClearToken(); | 745 | lexClearToken(); |
746 | while (c != EOF && c != ';') { | 746 | while (c != EOF && (c != ';' || !fieldedProp)) { |
747 | if (c == '\\' ) { | 747 | if (c == '\\' ) { |
@@ -750,7 +750,13 @@ static char* lexGet1Value() { | |||
750 | a = lexLookahead(); | 750 | a = lexLookahead(); |
751 | if ( a != ';' ) { | 751 | if ( a == ';' ) { |
752 | lexAppendc('\\'); | ||
753 | } else { | ||
754 | lexAppendc( ';' ); | 752 | lexAppendc( ';' ); |
755 | lexSkipLookahead(); | 753 | lexSkipLookahead(); |
754 | } else if ( a == '\n' ) { | ||
755 | lexAppendc( '\n' ); | ||
756 | lexSkipLookahead(); | ||
757 | } else if ( a == '\\' ) { | ||
758 | lexAppendc( '\\' ); | ||
759 | lexSkipLookahead(); | ||
760 | } else { | ||
761 | lexAppendc('\\'); | ||
756 | } | 762 | } |
@@ -952,57 +958,68 @@ static int match_begin_end_name(int end) { | |||
952 | static char* lexGetQuotedPrintable() | 958 | static char* lexGetQuotedPrintable() |
953 | { | 959 | { |
954 | int cur; | 960 | int c; |
955 | 961 | lexSkipWhite(); | |
962 | c = lexLookahead(); | ||
956 | lexClearToken(); | 963 | lexClearToken(); |
957 | do { | ||
958 | cur = lexGetc(); | ||
959 | switch (cur) { | ||
960 | case '=': { | ||
961 | int c = 0; | ||
962 | int next[2]; | ||
963 | int i; | ||
964 | for (i = 0; i < 2; i++) { | ||
965 | next[i] = lexGetc(); | ||
966 | if (next[i] >= '0' && next[i] <= '9') | ||
967 | c = c * 16 + next[i] - '0'; | ||
968 | else if (next[i] >= 'A' && next[i] <= 'F') | ||
969 | c = c * 16 + next[i] - 'A' + 10; | ||
970 | else | ||
971 | break; | ||
972 | } | ||
973 | if (i == 0) { | ||
974 | /* single '=' follow by LINESEP is continuation sign? */ | ||
975 | if (next[0] == '\n') { | ||
976 | ++mime_lineNum; | ||
977 | } | ||
978 | else { | ||
979 | lexPushLookaheadc('='); | ||
980 | goto EndString; | ||
981 | } | ||
982 | } | ||
983 | else if (i == 1) { | ||
984 | lexPushLookaheadc(next[1]); | ||
985 | lexPushLookaheadc(next[0]); | ||
986 | lexAppendc('='); | ||
987 | } else { | ||
988 | lexAppendc(c); | ||
989 | } | ||
990 | break; | ||
991 | } /* '=' */ | ||
992 | case '\n': { | ||
993 | lexPushLookaheadc('\n'); | ||
994 | goto EndString; | ||
995 | } | ||
996 | case (int)EOF: | ||
997 | break; | ||
998 | default: | ||
999 | lexAppendc(cur); | ||
1000 | break; | ||
1001 | } /* switch */ | ||
1002 | } while (cur != (int)EOF); | ||
1003 | 964 | ||
1004 | EndString: | 965 | while (c != EOF && c != ';') { |
966 | if (c == '\n') { | ||
967 | // break, leave '\n' on remaining chars. | ||
968 | break; | ||
969 | } else if (c == '=') { | ||
970 | int cur = 0; | ||
971 | int next; | ||
972 | |||
973 | lexSkipLookahead(); // skip '=' | ||
974 | next = lexLookahead(); | ||
975 | |||
976 | if (next == '\n') { | ||
977 | // skip and only skip the \n | ||
978 | lexSkipLookahead(); | ||
979 | c = lexLookahead(); | ||
980 | ++mime_lineNum; // aid in error reporting | ||
981 | continue; | ||
982 | } else if (next >= '0' && next <= '9') { | ||
983 | cur = next - '0'; | ||
984 | } else if (next >= 'A' && next <= 'F') { | ||
985 | cur = next - 'A' + 10; | ||
986 | } else { | ||
987 | // we have been sent buggy stuff. doesn't matter | ||
988 | // what we do so long as we keep going. | ||
989 | // should probably spit an error here | ||
990 | lexSkipLookahead(); | ||
991 | c = lexLookahead(); | ||
992 | continue; | ||
993 | } | ||
994 | |||
995 | lexSkipLookahead(); // skip A-Z0-9 | ||
996 | next = lexLookahead(); | ||
997 | |||
998 | cur = cur * 16; | ||
999 | // this time really just expecting 0-9A-F | ||
1000 | if (next >= '0' && next <= '9') { | ||
1001 | cur += next - '0'; | ||
1002 | } else if (next >= 'A' && next <= 'F') { | ||
1003 | cur += next - 'A' + 10; | ||
1004 | } else { | ||
1005 | // we have been sent buggy stuff. doesn't matter | ||
1006 | // what we do so long as we keep going. | ||
1007 | // should probably spit an error here | ||
1008 | lexSkipLookahead(); | ||
1009 | c = lexLookahead(); | ||
1010 | continue; | ||
1011 | } | ||
1012 | |||
1013 | // got a valid escaped =. append it. | ||
1014 | lexSkipLookahead(); // skip second 0-9A-F | ||
1015 | lexAppendc(cur); | ||
1016 | } else { | ||
1017 | lexSkipLookahead(); // skip whatever we just read. | ||
1018 | lexAppendc(c); // and append it. | ||
1019 | } | ||
1020 | c = lexLookahead(); | ||
1021 | } | ||
1005 | lexAppendc(0); | 1022 | lexAppendc(0); |
1006 | return lexStr(); | 1023 | return c==EOF?0:lexStr(); |
1007 | } /* LexQuotedPrintable */ | 1024 | } |
1008 | 1025 | ||
@@ -1013,3 +1030,3 @@ static int yylex() { | |||
1013 | int c = lexGetc(); | 1030 | int c = lexGetc(); |
1014 | if (c == ';') { | 1031 | if (c == ';' && fieldedProp) { |
1015 | DBG_(("db: SEMICOLON\n")); | 1032 | DBG_(("db: SEMICOLON\n")); |
@@ -1067,2 +1084,3 @@ static int yylex() { | |||
1067 | /* ignoring linesep immediately after colon. */ | 1084 | /* ignoring linesep immediately after colon. */ |
1085 | /* I don't see this in the spec, and it breaks null values -- WA | ||
1068 | c = lexLookahead(); | 1086 | c = lexLookahead(); |
@@ -1073,2 +1091,3 @@ static int yylex() { | |||
1073 | } | 1091 | } |
1092 | */ | ||
1074 | DBG_(("db: COLON\n")); | 1093 | DBG_(("db: COLON\n")); |
@@ -1219,3 +1238,3 @@ void mime_error_(char *s) | |||
1219 | 1238 | ||
1220 | #line 1221 "y.tab.c" | 1239 | #line 1240 "y.tab.c" |
1221 | #define YYABORT goto yyabort | 1240 | #define YYABORT goto yyabort |
@@ -1519,3 +1538,3 @@ case 45: | |||
1519 | break; | 1538 | break; |
1520 | #line 1521 "y.tab.c" | 1539 | #line 1540 "y.tab.c" |
1521 | } | 1540 | } |