Fix for windows backslashes in relative paths in playlists.

This commit is contained in:
vspader 2007-05-24 03:49:43 +00:00
parent ee265d835e
commit cf39353358

View file

@ -101,8 +101,12 @@
} }
NSString *basePath = [[[baseFilename stringByStandardizingPath] stringByDeletingLastPathComponent] stringByAppendingString:@"/"]; NSString *basePath = [[[baseFilename stringByStandardizingPath] stringByDeletingLastPathComponent] stringByAppendingString:@"/"];
NSMutableString *unixPath = [path mutableCopy];
return [NSURL fileURLWithPath:[basePath stringByAppendingString:path]]; //Only relative paths would have windows backslashes.
[unixPath replaceOccurrencesOfString:@"\\" withString:@"/" options:0 range:NSMakeRange(0, [unixPath length])];
return [NSURL fileURLWithPath:[basePath stringByAppendingString:[unixPath autorelease]]];
} }