Differences From Artifact [13457e7f1d]:
- File
src/OFURL.m
— part of check-in
[156b850131]
at
2018-03-11 12:55:20
on branch trunk
— Remove OF_PATH_* macros
These were way too simplistic, as paths differ in more than just that on
various operating systems. (user: js, size: 23298) [annotate] [blame] [check-ins using]
To Artifact [6014ddabe8]:
- File src/OFURL.m — part of check-in [88d0ccf804] at 2018-03-11 21:59:22 on branch trunk — Clean up -[OFURL initFileURLWithPath:isDirectory:] (user: js, size: 22939) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
629 630 631 632 633 634 635 | - (instancetype)initFileURLWithPath: (OFString *)path isDirectory: (bool)isDirectory { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); | | > | | > | > | | > > > | < < < < < < < < < < < < < < < < < | 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 | - (instancetype)initFileURLWithPath: (OFString *)path isDirectory: (bool)isDirectory { self = [super init]; @try { void *pool = objc_autoreleasePoolPush(); if (![path isAbsolutePath]) { OFString *currentDirectoryPath = [[OFFileManager defaultManager] currentDirectoryPath]; path = [currentDirectoryPath stringByAppendingPathComponent: path]; path = [path stringByStandardizingPath]; } # if defined(OF_WINDOWS) || defined(OF_DJGPP) path = [path stringByReplacingOccurrencesOfString: @"\\" withString: @"/"]; path = [path stringByPrependingString: @"/"]; # endif if (isDirectory && ![path hasSuffix: @"/"]) path = [path stringByAppendingString: @"/"]; _URLEncodedScheme = @"file"; _URLEncodedPath = [[path stringByURLEncodingWithAllowedCharacters: [OFCharacterSet URLPathAllowedCharacterSet]] copy]; objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; |
︙ | ︙ |