Skip to content

Commit

Permalink
Merge pull request #31 from credil/master
Browse files Browse the repository at this point in the history
Issues with .rdp files generated from non-CoRD sources
  • Loading branch information
Dorian Johnson committed Feb 8, 2013
2 parents 5e45bb6 + 0dd1bd1 commit 46546d9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Source/CRDSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -1010,9 +1010,16 @@ - (BOOL)readFileAtPath:(NSString *)path

if (fileContents == nil)
fileContents = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:NULL];

NSArray *fileLines = [fileContents componentsSeparatedByString:@"\r\n"];


NSArray *fileLines;

if ([NSString respondsToSelector:@selector(componentsSeparatedByCharactersInSet:)])
{
fileLines = [fileContents componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]];
} else {
fileLines = [fileContents componentsSeparatedByString:@"\r\n"];
}

if (fileLines == nil)
{
CRDLog(CRDLogLevelError, @"Couldn't open RDP file '%@'!", path);
Expand Down

0 comments on commit 46546d9

Please sign in to comment.