-rw-r--r-- | library/backend/vcc_yacc.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/library/backend/vcc_yacc.cpp b/library/backend/vcc_yacc.cpp index 5f53aef..4006bc2 100644 --- a/library/backend/vcc_yacc.cpp +++ b/library/backend/vcc_yacc.cpp @@ -460,9 +460,9 @@ static void enterProps(const char *s) }
static void enterAttr(const char *s1, const char *s2)
{
- const char *p1, *p2;
+ const char *p1, *p2=0;
p1 = lookupProp_(s1);
if (s2) {
VObject *a;
p2 = lookupProp_(s2);
@@ -832,9 +832,9 @@ static void finiLex() { /*-----------------------------------*/
/* This parses and converts the base64 format for binary encoding into
* a decoded buffer (allocated with new). See RFC 1521.
*/
-static char * lexGetDataFromBase64()
+static int lexGetDataFromBase64()
{
unsigned long bytesLen = 0, bytesMax = 0;
int quadIx = 0, pad = 0;
unsigned long trip = 0;
@@ -845,8 +845,9 @@ static char * lexGetDataFromBase64() DBG_(("db: lexGetDataFromBase64\n"));
while (1) {
c = lexGetc();
+ lexSkipWhite();
if (c == '\n') {
++mime_lineNum;
if (lexLookahead() == '\n') {
/* a '\n' character by itself means end of data */
@@ -867,26 +868,27 @@ static char * lexGetDataFromBase64() b = 63;
else if (c == '=') {
b = 0;
pad++;
- } else if ((c == ' ') || (c == '\t')) {
- continue;
} else { /* error condition */
if (bytes) free(bytes);
else if (oldBytes) free(oldBytes);
// error recovery: skip until 2 adjacent newlines.
DBG_(("db: invalid character 0x%x '%c'\n", c,c));
if (c != EOF) {
c = lexGetc();
while (c != EOF) {
- if (c == '\n' && lexLookahead() == '\n') {
+ if (c == '\n') {
+ lexSkipWhite();
+ if(lexLookahead() == '\n') {
++mime_lineNum;
break;
}
+ }
c = lexGetc();
}
}
- return NULL;
+ return c != EOF;
}
trip = (trip << 6) | b;
if (++quadIx == 4) {
unsigned char outBytes[3];
@@ -930,9 +932,9 @@ static char * lexGetDataFromBase64() else if (oldBytes) {
setValueWithSize(curProp,oldBytes,(unsigned int)bytesLen);
free(oldBytes);
}
- return 0;
+ return bytesLen;
}
static int match_begin_end_name(int end) {
int token;
@@ -961,9 +963,9 @@ static char* lexGetQuotedPrintable() lexSkipWhite();
c = lexLookahead();
lexClearToken();
- while (c != EOF && c != ';') {
+ while (c != EOF && (c != ';' || !fieldedProp)) {
if (c == '\n') {
// break, leave '\n' on remaining chars.
break;
} else if (c == '=') {
@@ -1051,13 +1053,10 @@ static int yylex() { char *p = 0;
lexPushLookaheadc(c);
if (lexWithinMode(L_BASE64)) {
/* get each char and convert to bin on the fly... */
- p = lexGetDataFromBase64();
-#if 0 - yylval.str = p;
- return STRING;
-#endif + yylval.str = NULL;
+ return lexGetDataFromBase64() ? STRING : 0;
}
else if (lexWithinMode(L_QUOTED_PRINTABLE)) {
p = lexGetQuotedPrintable();
}
@@ -1237,9 +1236,9 @@ void mime_error_(char *s) mimeErrorHandler(s);
}
}
-#line 1240 "y.tab.c" +#line 1241 "y.tab.c" #define YYABORT goto yyabort #define YYREJECT goto yyabort #define YYACCEPT goto yyaccept #define YYERROR goto yyerrlab @@ -1537,9 +1536,9 @@ case 45: lexPopMode(0);
popVObject();
} break; -#line 1540 "y.tab.c" +#line 1541 "y.tab.c" } yyssp -= yym; yystate = *yyssp; yyvsp -= yym; |