From: helge Date: Fri, 15 Jul 2005 10:28:40 +0000 (+0000) Subject: fixed a parsing bug X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9e307dda492eefc4a931a7c0a63df90b000a93d;p=sope fixed a parsing bug git-svn-id: http://svn.opengroupware.org/SOPE/trunk@907 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-mime/ChangeLog b/sope-mime/ChangeLog index c9bd1915..cd71f779 100644 --- a/sope-mime/ChangeLog +++ b/sope-mime/ChangeLog @@ -1,7 +1,11 @@ +2005-07-15 Helge Hess + + * NGImap4: fixed a parsing bug in ACL responses (v4.5.228) + 2005-07-14 Helge Hess * NGImap4: fixed default names of NGImap4Connection, some code reorgs - (v.4.5.227) + (v4.5.227) 2005-07-13 Helge Hess diff --git a/sope-mime/NGImap4/ChangeLog b/sope-mime/NGImap4/ChangeLog index a241bf14..07a6ffce 100644 --- a/sope-mime/NGImap4/ChangeLog +++ b/sope-mime/NGImap4/ChangeLog @@ -1,3 +1,8 @@ +2005-07-15 Helge Hess + + * NGImap4ResponseParser.m: fixed a bug in parsing mailbox names in ACL + responses + 2005-07-14 Helge Hess * NGImap4Connection.m: updated defaults to use NGImap4Connection* diff --git a/sope-mime/NGImap4/NGImap4ResponseParser.m b/sope-mime/NGImap4/NGImap4ResponseParser.m index dfa7a533..d3eeedca 100644 --- a/sope-mime/NGImap4/NGImap4ResponseParser.m +++ b/sope-mime/NGImap4/NGImap4ResponseParser.m @@ -734,8 +734,9 @@ static void _parseUntaggedResponse(NGImap4ResponseParser *self, return NO; _consume(self, 4); - if ((obj = _parseUntil(self, ' ')) != nil) + if ((obj = _parseBodyString(self, YES)) != nil) [result_ setObject:obj forKey:@"mailbox"]; + _consumeIfMatch(self, ' '); acls = _parseUntil(self, '\n'); @@ -772,8 +773,9 @@ static void _parseUntaggedResponse(NGImap4ResponseParser *self, return NO; _consume(self, 9); - if ((obj = _parseUntil(self, ' ')) != nil) + if ((obj = _parseBodyString(self, YES)) != nil) [result_ setObject:obj forKey:@"mailbox"]; + _consumeIfMatch(self, ' '); rights = _parseUntil(self, '\n'); [result_ setObject:rights forKey:@"myrights"]; @@ -794,10 +796,13 @@ static void _parseUntaggedResponse(NGImap4ResponseParser *self, return NO; _consume(self, 11); - if ((obj = _parseUntil(self, ' ')) != nil) + if ((obj = _parseBodyString(self, YES)) != nil) [result_ setObject:obj forKey:@"mailbox"]; - if ((obj = _parseUntil(self, ' ')) != nil) + _consumeIfMatch(self, ' '); + + if ((obj = _parseBodyString(self, YES)) != nil) [result_ setObject:obj forKey:@"uid"]; + _consumeIfMatch(self, ' '); if ((obj = _parseUntil(self, ' ')) != nil) { if ([obj isEqual:@"\"\""]) @@ -1565,10 +1570,10 @@ static NSString *_parseBodyDecodeString(NGImap4ResponseParser *self, BOOL _convertString, BOOL _decode) { - NSString *str; if (_la(self, 0) == '"') { + // TODO: can the " be escaped somehow? _consume(self, 1); str = _parseUntil(self, '"'); } @@ -1593,15 +1598,15 @@ static NSString *_parseBodyDecodeString(NGImap4ResponseParser *self, } if (_decode) { id d; - + d = [str dataUsingEncoding:defCStringEncoding]; d = [d decodeQuotedPrintableValueOfMIMEHeaderField:nil]; - + if ([d isKindOfClass:StrClass]) str = d; else { str = [[[StrClass alloc] initWithData:d encoding:encoding] - autorelease]; + autorelease]; } } return str; diff --git a/sope-mime/Version b/sope-mime/Version index 70d1e694..4948443d 100644 --- a/sope-mime/Version +++ b/sope-mime/Version @@ -2,7 +2,7 @@ MAJOR_VERSION:=4 MINOR_VERSION:=5 -SUBMINOR_VERSION:=227 +SUBMINOR_VERSION:=228 # v4.5.214 requires libNGExtensions v4.5.146 # v4.2.149 requires libNGStreams v4.2.34