summaryrefslogtreecommitdiff
authorzecke <zecke>2003-08-29 18:02:09 (UTC)
committer zecke <zecke>2003-08-29 18:02:09 (UTC)
commit885c645ee48ae53467e244521c011c73bc106afb (patch) (unidiff)
tree9024be25b2503788d3aa77b7a86b89e543cdd865
parented6da2303a8fabec50991365914f0e4d20a21ea6 (diff)
downloadopie-885c645ee48ae53467e244521c011c73bc106afb.zip
opie-885c645ee48ae53467e244521c011c73bc106afb.tar.gz
opie-885c645ee48ae53467e244521c011c73bc106afb.tar.bz2
Fixes for base64 decoding and encoding of vCard
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/backend/vcc.y29
-rw-r--r--library/backend/vcc_yacc.cpp33
-rw-r--r--library/backend/vobject.cpp5
-rw-r--r--library/backend/vobject_p.h4
4 files changed, 32 insertions, 39 deletions
diff --git a/library/backend/vcc.y b/library/backend/vcc.y
index 4c79368..bec2955 100644
--- a/library/backend/vcc.y
+++ b/library/backend/vcc.y
@@ -443,3 +443,3 @@ static void enterAttr(const char *s1, const char *s2)
443 { 443 {
444 const char *p1, *p2; 444 const char *p1, *p2=0;
445 p1 = lookupProp_(s1); 445 p1 = lookupProp_(s1);
@@ -815,3 +815,3 @@ static void finiLex() {
815 */ 815 */
816static char * lexGetDataFromBase64() 816static int lexGetDataFromBase64()
817 { 817 {
@@ -828,2 +828,3 @@ static char * lexGetDataFromBase64()
828 c = lexGetc(); 828 c = lexGetc();
829 lexSkipWhite();
829 if (c == '\n') { 830 if (c == '\n') {
@@ -850,4 +851,2 @@ static char * lexGetDataFromBase64()
850 pad++; 851 pad++;
851 } else if ((c == ' ') || (c == '\t')) {
852 continue;
853 } else { /* error condition */ 852 } else { /* error condition */
@@ -860,5 +859,8 @@ static char * lexGetDataFromBase64()
860 while (c != EOF) { 859 while (c != EOF) {
861 if (c == '\n' && lexLookahead() == '\n') { 860 if (c == '\n') {
862 ++mime_lineNum; 861 lexSkipWhite();
863 break; 862 if(lexLookahead() == '\n') {
863 ++mime_lineNum;
864 break;
865 }
864 } 866 }
@@ -867,3 +869,3 @@ static char * lexGetDataFromBase64()
867 } 869 }
868 return NULL; 870 return c != EOF;
869 } 871 }
@@ -913,3 +915,3 @@ static char * lexGetDataFromBase64()
913 } 915 }
914 return 0; 916 return bytesLen;
915 } 917 }
@@ -944,3 +946,3 @@ static char* lexGetQuotedPrintable()
944 946
945 while (c != EOF && c != ';') { 947 while (c != EOF && (c != ';' || !fieldedProp)) {
946 if (c == '\n') { 948 if (c == '\n') {
@@ -1034,7 +1036,4 @@ static int yylex() {
1034 /* get each char and convert to bin on the fly... */ 1036 /* get each char and convert to bin on the fly... */
1035 p = lexGetDataFromBase64(); 1037 yylval.str = NULL;
1036 #if 0 1038 return lexGetDataFromBase64() ? STRING : 0;
1037 yylval.str = p;
1038 return STRING;
1039 #endif
1040 } 1039 }
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)
463 { 463 {
464 const char *p1, *p2; 464 const char *p1, *p2=0;
465 p1 = lookupProp_(s1); 465 p1 = lookupProp_(s1);
@@ -835,3 +835,3 @@ static void finiLex() {
835 */ 835 */
836static char * lexGetDataFromBase64() 836static int lexGetDataFromBase64()
837 { 837 {
@@ -848,2 +848,3 @@ static char * lexGetDataFromBase64()
848 c = lexGetc(); 848 c = lexGetc();
849 lexSkipWhite();
849 if (c == '\n') { 850 if (c == '\n') {
@@ -870,4 +871,2 @@ static char * lexGetDataFromBase64()
870 pad++; 871 pad++;
871 } else if ((c == ' ') || (c == '\t')) {
872 continue;
873 } else { /* error condition */ 872 } else { /* error condition */
@@ -880,5 +879,8 @@ static char * lexGetDataFromBase64()
880 while (c != EOF) { 879 while (c != EOF) {
881 if (c == '\n' && lexLookahead() == '\n') { 880 if (c == '\n') {
882 ++mime_lineNum; 881 lexSkipWhite();
883 break; 882 if(lexLookahead() == '\n') {
883 ++mime_lineNum;
884 break;
885 }
884 } 886 }
@@ -887,3 +889,3 @@ static char * lexGetDataFromBase64()
887 } 889 }
888 return NULL; 890 return c != EOF;
889 } 891 }
@@ -933,3 +935,3 @@ static char * lexGetDataFromBase64()
933 } 935 }
934 return 0; 936 return bytesLen;
935 } 937 }
@@ -964,3 +966,3 @@ static char* lexGetQuotedPrintable()
964 966
965 while (c != EOF && c != ';') { 967 while (c != EOF && (c != ';' || !fieldedProp)) {
966 if (c == '\n') { 968 if (c == '\n') {
@@ -1054,7 +1056,4 @@ static int yylex() {
1054 /* get each char and convert to bin on the fly... */ 1056 /* get each char and convert to bin on the fly... */
1055 p = lexGetDataFromBase64(); 1057 yylval.str = NULL;
1056#if 0 1058 return lexGetDataFromBase64() ? STRING : 0;
1057 yylval.str = p;
1058 return STRING;
1059 #endif
1060 } 1059 }
@@ -1240,3 +1239,3 @@ void mime_error_(char *s)
1240 1239
1241#line 1240 "y.tab.c" 1240#line 1241 "y.tab.c"
1242#define YYABORT goto yyabort 1241#define YYABORT goto yyabort
@@ -1540,3 +1539,3 @@ case 45:
1540break; 1539break;
1541#line 1540 "y.tab.c" 1540#line 1541 "y.tab.c"
1542 } 1541 }
diff --git a/library/backend/vobject.cpp b/library/backend/vobject.cpp
index 4c8de70..9263c3a 100644
--- a/library/backend/vobject.cpp
+++ b/library/backend/vobject.cpp
@@ -44,5 +44,3 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
44 44
45 #ifndef MWERKS 45#include <stdlib.h>
46#include <malloc.h>
47#endif
48 46
@@ -759,3 +757,2 @@ static struct PreDefProp propNames[] = {
759 { VCQPProp, VCQuotedPrintableProp, 0, 0 }, 757 { VCQPProp, VCQuotedPrintableProp, 0, 0 },
760 { VCQPProp, VCBase64Prop, 0, 0 },
761 { VCQuickTimeProp, 0, 0, 0 }, 758 { VCQuickTimeProp, 0, 0, 0 },
diff --git a/library/backend/vobject_p.h b/library/backend/vobject_p.h
index f969898..3c9d0d3 100644
--- a/library/backend/vobject_p.h
+++ b/library/backend/vobject_p.h
@@ -101,5 +101,3 @@ For example:
101#undef DLLEXPORT 101#undef DLLEXPORT
102 //#include <qtopia/qpeglobal.h> 102#include <qtopia/global.h>
103#include <qglobal.h>
104
105#if defined(QTOPIA_MAKEDLL) 103#if defined(QTOPIA_MAKEDLL)