Index: src/OFArchiveIRIHandler.m ================================================================== --- src/OFArchiveIRIHandler.m +++ src/OFArchiveIRIHandler.m @@ -79,11 +79,13 @@ 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: @@ -193,24 +195,20 @@ 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; }