author | zecke <zecke> | 2003-08-29 18:02:09 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-08-29 18:02:09 (UTC) |
commit | 885c645ee48ae53467e244521c011c73bc106afb (patch) (side-by-side diff) | |
tree | 9024be25b2503788d3aa77b7a86b89e543cdd865 /library/backend/vcc_yacc.cpp | |
parent | ed6da2303a8fabec50991365914f0e4d20a21ea6 (diff) | |
download | opie-885c645ee48ae53467e244521c011c73bc106afb.zip opie-885c645ee48ae53467e244521c011c73bc106afb.tar.gz opie-885c645ee48ae53467e244521c011c73bc106afb.tar.bz2 |
Fixes for base64 decoding and encoding of vCard
Diffstat (limited to 'library/backend/vcc_yacc.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | library/backend/vcc_yacc.cpp | 33 |
1 files changed, 16 insertions, 17 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 @@ -463,3 +463,3 @@ static void enterAttr(const char *s1, const char *s2) {
- const char *p1, *p2;
+ const char *p1, *p2=0;
p1 = lookupProp_(s1);
@@ -835,3 +835,3 @@ static void finiLex() { */
-static char * lexGetDataFromBase64()
+static int lexGetDataFromBase64()
{
@@ -848,2 +848,3 @@ static char * lexGetDataFromBase64() c = lexGetc();
+ lexSkipWhite();
if (c == '\n') {
@@ -870,4 +871,2 @@ static char * lexGetDataFromBase64() pad++;
- } else if ((c == ' ') || (c == '\t')) {
- continue;
} else { /* error condition */
@@ -880,5 +879,8 @@ static char * lexGetDataFromBase64() while (c != EOF) {
- if (c == '\n' && lexLookahead() == '\n') {
- ++mime_lineNum;
- break;
+ if (c == '\n') {
+ lexSkipWhite();
+ if(lexLookahead() == '\n') {
+ ++mime_lineNum;
+ break;
+ }
}
@@ -887,3 +889,3 @@ static char * lexGetDataFromBase64() }
- return NULL;
+ return c != EOF;
}
@@ -933,3 +935,3 @@ static char * lexGetDataFromBase64() }
- return 0;
+ return bytesLen;
}
@@ -964,3 +966,3 @@ static char* lexGetQuotedPrintable() - while (c != EOF && c != ';') {
+ while (c != EOF && (c != ';' || !fieldedProp)) {
if (c == '\n') {
@@ -1054,7 +1056,4 @@ static int yylex() { /* 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;
}
@@ -1240,3 +1239,3 @@ void mime_error_(char *s) -#line 1240 "y.tab.c" +#line 1241 "y.tab.c" #define YYABORT goto yyabort @@ -1540,3 +1539,3 @@ case 45: break; -#line 1540 "y.tab.c" +#line 1541 "y.tab.c" } |