-rw-r--r-- | library/backend/vcc.y | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/library/backend/vcc.y b/library/backend/vcc.y index 6781312..94a8fea 100644 --- a/library/backend/vcc.y +++ b/library/backend/vcc.y | |||
@@ -119,13 +119,13 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. | |||
119 | #include <stdlib.h> | 119 | #include <stdlib.h> |
120 | #include <ctype.h> | 120 | #include <ctype.h> |
121 | 121 | ||
122 | //#ifdef PALMTOPCENTER | 122 | //#ifdef PALMTOPCENTER |
123 | //#include <qpe/vobject_p.h> | 123 | //#include <qpe/vobject_p.h> |
124 | //#else | 124 | //#else |
125 | #include <qtopia/private/vobject_p.h> | 125 | #include "vobject_p.h" |
126 | //#endif | 126 | //#endif |
127 | 127 | ||
128 | /**** Types, Constants ****/ | 128 | /**** Types, Constants ****/ |
129 | 129 | ||
130 | #define YYDEBUG 0/* 1 to compile in some debugging code */ | 130 | #define YYDEBUG 0/* 1 to compile in some debugging code */ |
131 | #define MAXTOKEN 256/* maximum token (line) length */ | 131 | #define MAXTOKEN 256/* maximum token (line) length */ |
@@ -720,22 +720,28 @@ static void handleMoreRFC822LineBreak(int c) { | |||
720 | 720 | ||
721 | static char* lexGet1Value() { | 721 | static char* lexGet1Value() { |
722 | int c; | 722 | int c; |
723 | lexSkipWhite(); | 723 | lexSkipWhite(); |
724 | c = lexLookahead(); | 724 | c = lexLookahead(); |
725 | lexClearToken(); | 725 | lexClearToken(); |
726 | while (c != EOF && c != ';') { | 726 | while (c != EOF && (c != ';' || !fieldedProp)) { |
727 | if (c == '\\' ) { | 727 | if (c == '\\' ) { |
728 | int a; | 728 | int a; |
729 | lexSkipLookahead(); | 729 | lexSkipLookahead(); |
730 | a = lexLookahead(); | 730 | a = lexLookahead(); |
731 | if ( a != ';' ) { | 731 | if ( a == ';' ) { |
732 | lexAppendc('\\'); | ||
733 | } else { | ||
734 | lexAppendc( ';' ); | 732 | lexAppendc( ';' ); |
735 | lexSkipLookahead(); | 733 | lexSkipLookahead(); |
734 | } else if ( a == '\n' ) { | ||
735 | lexAppendc( '\n' ); | ||
736 | lexSkipLookahead(); | ||
737 | } else if ( a == '\\' ) { | ||
738 | lexAppendc( '\\' ); | ||
739 | lexSkipLookahead(); | ||
740 | } else { | ||
741 | lexAppendc('\\'); | ||
736 | } | 742 | } |
737 | } else if (c == '\n') { | 743 | } else if (c == '\n') { |
738 | int a; | 744 | int a; |
739 | lexSkipLookahead(); | 745 | lexSkipLookahead(); |
740 | a = lexLookahead(); | 746 | a = lexLookahead(); |
741 | if (a == ' ' || a == '\t') { | 747 | if (a == ' ' || a == '\t') { |
@@ -958,12 +964,13 @@ static char* lexGetQuotedPrintable() | |||
958 | } else if (next >= 'A' && next <= 'F') { | 964 | } else if (next >= 'A' && next <= 'F') { |
959 | cur = next - 'A' + 10; | 965 | cur = next - 'A' + 10; |
960 | } else { | 966 | } else { |
961 | // we have been sent buggy stuff. doesn't matter | 967 | // we have been sent buggy stuff. doesn't matter |
962 | // what we do so long as we keep going. | 968 | // what we do so long as we keep going. |
963 | // should probably spit an error here | 969 | // should probably spit an error here |
970 | lexSkipLookahead(); | ||
964 | c = lexLookahead(); | 971 | c = lexLookahead(); |
965 | continue; | 972 | continue; |
966 | } | 973 | } |
967 | 974 | ||
968 | lexSkipLookahead(); // skip A-Z0-9 | 975 | lexSkipLookahead(); // skip A-Z0-9 |
969 | next = lexLookahead(); | 976 | next = lexLookahead(); |
@@ -975,12 +982,13 @@ static char* lexGetQuotedPrintable() | |||
975 | } else if (next >= 'A' && next <= 'F') { | 982 | } else if (next >= 'A' && next <= 'F') { |
976 | cur += next - 'A' + 10; | 983 | cur += next - 'A' + 10; |
977 | } else { | 984 | } else { |
978 | // we have been sent buggy stuff. doesn't matter | 985 | // we have been sent buggy stuff. doesn't matter |
979 | // what we do so long as we keep going. | 986 | // what we do so long as we keep going. |
980 | // should probably spit an error here | 987 | // should probably spit an error here |
988 | lexSkipLookahead(); | ||
981 | c = lexLookahead(); | 989 | c = lexLookahead(); |
982 | continue; | 990 | continue; |
983 | } | 991 | } |
984 | 992 | ||
985 | // got a valid escaped =. append it. | 993 | // got a valid escaped =. append it. |
986 | lexSkipLookahead(); // skip second 0-9A-F | 994 | lexSkipLookahead(); // skip second 0-9A-F |
@@ -997,13 +1005,13 @@ static char* lexGetQuotedPrintable() | |||
997 | 1005 | ||
998 | static int yylex() { | 1006 | static int yylex() { |
999 | 1007 | ||
1000 | int lexmode = LEXMODE(); | 1008 | int lexmode = LEXMODE(); |
1001 | if (lexmode == L_VALUES) { | 1009 | if (lexmode == L_VALUES) { |
1002 | int c = lexGetc(); | 1010 | int c = lexGetc(); |
1003 | if (c == ';') { | 1011 | if (c == ';' && fieldedProp) { |
1004 | DBG_(("db: SEMICOLON\n")); | 1012 | DBG_(("db: SEMICOLON\n")); |
1005 | lexPushLookaheadc(c); | 1013 | lexPushLookaheadc(c); |
1006 | handleMoreRFC822LineBreak(c); | 1014 | handleMoreRFC822LineBreak(c); |
1007 | lexSkipLookahead(); | 1015 | lexSkipLookahead(); |
1008 | return SEMICOLON; | 1016 | return SEMICOLON; |
1009 | } | 1017 | } |
@@ -1051,18 +1059,20 @@ static int yylex() { | |||
1051 | while (1) { | 1059 | while (1) { |
1052 | int c = lexGetc(); | 1060 | int c = lexGetc(); |
1053 | switch(c) { | 1061 | switch(c) { |
1054 | case ':': { | 1062 | case ':': { |
1055 | /* consume all line separator(s) adjacent to each other */ | 1063 | /* consume all line separator(s) adjacent to each other */ |
1056 | /* ignoring linesep immediately after colon. */ | 1064 | /* ignoring linesep immediately after colon. */ |
1065 | /* I don't see this in the spec, and it breaks null values -- WA | ||
1057 | c = lexLookahead(); | 1066 | c = lexLookahead(); |
1058 | while (strchr("\n",c)) { | 1067 | while (strchr("\n",c)) { |
1059 | lexSkipLookahead(); | 1068 | lexSkipLookahead(); |
1060 | c = lexLookahead(); | 1069 | c = lexLookahead(); |
1061 | ++mime_lineNum; | 1070 | ++mime_lineNum; |
1062 | } | 1071 | } |
1072 | */ | ||
1063 | DBG_(("db: COLON\n")); | 1073 | DBG_(("db: COLON\n")); |
1064 | return COLON; | 1074 | return COLON; |
1065 | } | 1075 | } |
1066 | case ';': | 1076 | case ';': |
1067 | DBG_(("db: SEMICOLON\n")); | 1077 | DBG_(("db: SEMICOLON\n")); |
1068 | return SEMICOLON; | 1078 | return SEMICOLON; |