Overview
Comment: | Clean up -[OFURL initFileURLWithPath:isDirectory:] |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
88d0ccf804c5c786be76ac0742638888 |
User & Date: | js on 2018-03-11 21:59:22 |
Other Links: | manifest | tags |
Context
2018-03-11
| ||
23:11 | OFHTTPClient: Throw if socket got closed too early check-in: 69c2ca803a user: js tags: trunk | |
21:59 | Clean up -[OFURL initFileURLWithPath:isDirectory:] check-in: 88d0ccf804 user: js tags: trunk | |
21:43 | Add -[OFString isAbsolutePath] check-in: c6299422a1 user: js tags: trunk | |
Changes
Modified src/OFURL.m from [13457e7f1d] to [6014ddabe8].
︙ | ︙ | |||
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]; |
︙ | ︙ |