ObjFW  Check-in [8dd0438ada]

Overview
Comment:Fix -[OFURL initFileURLWithPath:] on Windows
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8dd0438ada26615164a185191e6223c6852104f5e85d3b9ea44513b98b22efa5
User & Date: js on 2017-11-14 23:30:44
Other Links: manifest | tags
Context
2017-11-16
23:42
OFMutableDictionary: Allow dict[key] = nil check-in: bb8de03577 user: js tags: trunk
2017-11-14
23:30
Fix -[OFURL initFileURLWithPath:] on Windows check-in: 8dd0438ada user: js tags: trunk
23:27
Add -[OFString stringByAppendingURLPathComponent:] check-in: ad18d4f976 user: js tags: trunk
Changes

Modified src/OFURL.m from [18e5b35188] to [eff43babbe].

654
655
656
657
658
659
660








661
662

663
664
665
666
667
668
669

		_URLEncodedScheme = @"file";

		if (![path hasPrefix: @"/"]) {
			OFString *currentDirectoryPath = [[OFFileManager
			    defaultManager] currentDirectoryPath];









			path = [OFString stringWithFormat:
			    @"%@/%@", currentDirectoryPath, path];

			path = [path stringByStandardizingURLPath];
		}

		_URLEncodedPath = [[path
		    stringByURLEncodingWithAllowedCharacters:
		    [OFCharacterSet URLPathAllowedCharacterSet]] copy];








>
>
>
>
>
>
>
>
|
|
>







654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678

		_URLEncodedScheme = @"file";

		if (![path hasPrefix: @"/"]) {
			OFString *currentDirectoryPath = [[OFFileManager
			    defaultManager] currentDirectoryPath];

# if OF_PATH_DELIMITER != '/'
			currentDirectoryPath = [[currentDirectoryPath
			    pathComponents] componentsJoinedByString: @"/"];
# endif
# if defined(OF_WINDOWS) || defined(OF_DJGPP)
			currentDirectoryPath = [currentDirectoryPath
			    stringByPrependingString: @"/"];
# endif

			path = [currentDirectoryPath
			    stringByAppendingURLPathComponent: path];
			path = [path stringByStandardizingURLPath];
		}

		_URLEncodedPath = [[path
		    stringByURLEncodingWithAllowedCharacters:
		    [OFCharacterSet URLPathAllowedCharacterSet]] copy];