PidTagBody: do not return a body if it is an empty string or a simple crlf

This commit is contained in:
Wolfgang Sourdeau
2012-09-19 12:25:20 -04:00
parent 04d5284ef3
commit 72fb3f552d

View File

@@ -1217,15 +1217,20 @@ static NSCharacterSet *hexCharacterSet = nil;
- (int) getPidTagBody: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{
int rc = MAPISTORE_SUCCESS;
int rc;
NSString *stringValue;
/* FIXME: there is a confusion in NGCards around "comment" and "description" */
stringValue = [event comment];
if ([stringValue length] > 0)
*data = [stringValue asUnicodeInMemCtx: memCtx];
if ([stringValue length] > 0
&& ![stringValue isEqualToString: @"\r\n"]
&& ![stringValue isEqualToString: @"\n"])
{
rc = MAPISTORE_SUCCESS;
*data = [stringValue asUnicodeInMemCtx: memCtx];
}
else
*data = [@"" asUnicodeInMemCtx: memCtx];
rc = MAPISTORE_ERR_NOT_FOUND;
return rc;
}