(fix) remove any trailing cr (fixes #4172)

pull/228/merge
Ludovic Marcotte 2017-05-30 13:15:04 -04:00
parent af2507a689
commit 29dfc75fe9
1 changed files with 6 additions and 1 deletions

View File

@ -165,7 +165,7 @@ static NSArray *photoTags = nil;
id value;
NSRange r;
int i, j, count, linesCount;
int i, j, count, linesCount, len;
int rc;
folder = [self clientObject];
@ -184,6 +184,11 @@ static NSArray *photoTags = nil;
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: @"#"])