ObjFW  Diff

Differences From Artifact [78d87309e9]:

To Artifact [933f97fec8]:


77
78
79
80
81
82
83
84



85
86
87
88
89
90
91
77
78
79
80
81
82
83

84
85
86
87
88
89
90
91
92
93







-
+
+
+







							  IRI.path]
						mode: mode];
		stream = [OFGZIPStream streamWithStream: stream mode: mode];
		goto end;
	}

	percentEncodedPath = IRI.percentEncodedPath;
	pos = [percentEncodedPath rangeOfString: @"!"].location;
	pos = [percentEncodedPath
	    rangeOfString: @"!"
		  options: OFStringSearchBackwards].location;

	if (pos == OFNotFound)
		@throw [OFInvalidArgumentException exception];

	archiveIRI = [OFIRI IRIWithString:
	    [percentEncodedPath substringWithRange: OFMakeRange(0, pos)]
	    .stringByRemovingPercentEncoding];
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210

211
212
213
214
215
216
193
194
195
196
197
198
199

200
201
202
203
204
205



206
207

208
209
210
211
212
213
214







-






-
-
-


-
+






OFIRI *
OFArchiveIRIHandlerIRIForFileInArchive(OFString *scheme,
    OFString *pathInArchive, OFIRI *archiveIRI)
{
	static OFOnceControl onceControl = OFOnceControlInitValue;
	OFMutableIRI *ret = [OFMutableIRI IRIWithScheme: scheme];
	void *pool = objc_autoreleasePoolPush();
	OFString *archiveIRIString;

	OFOnce(&onceControl, initPathAllowedCharacters);

	pathInArchive = [pathInArchive
	    stringByAddingPercentEncodingWithAllowedCharacters:
	    pathAllowedCharacters];
	archiveIRIString = [archiveIRI.string
	    stringByAddingPercentEncodingWithAllowedCharacters:
	    pathAllowedCharacters];

	ret.percentEncodedPath = [OFString
	    stringWithFormat: @"%@!%@", archiveIRIString, pathInArchive];
	    stringWithFormat: @"%@!%@", archiveIRI.string, pathInArchive];
	[ret makeImmutable];

	objc_autoreleasePoolPop(pool);

	return ret;
}