Skip to content

Commit

Permalink
(fix) remove any trailing cr (fixes #4172)
Browse files Browse the repository at this point in the history
  • Loading branch information
extrafu committed May 30, 2017
1 parent ec397b3 commit 7cc3ff2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion UI/Contacts/UIxContactFolderActions.m
Expand Up @@ -165,7 +165,7 @@ - (int) importLdifData: (NSString *) ldifData
id value;

NSRange r;
int i, j, count, linesCount;
int i, j, count, linesCount, len;
int rc;

folder = [self clientObject];
Expand All @@ -184,6 +184,11 @@ - (int) importLdifData: (NSString *) ldifData
for (j = 0; j < linesCount; j++)
{
line = [lines objectAtIndex: j];
len = [line length];

/* we check for trailing \r and we strip them */
if (len && [line characterAtIndex: len-1] == '\r')
line = [line substringToIndex: len-1];

/* skip embedded comment lines */
if ([line hasPrefix: @"#"])
Expand Down

0 comments on commit 7cc3ff2

Please sign in to comment.