ObjFW  Check-in [2ba9aa1fd6]

Overview
Comment:Use -[substring{To,From}Index:] in more places
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2ba9aa1fd6164be917100e85fbc9f8f464607020aa24d34b045a3a5ccacf8904
User & Date: js on 2024-05-04 21:50:35
Other Links: manifest | tags
Context
2024-05-04
22:02
tests: Compress big_dictionary.msgpack with gzip check-in: 0d812d3b57 user: js tags: trunk
21:50
Use -[substring{To,From}Index:] in more places check-in: 2ba9aa1fd6 user: js tags: trunk
21:40
Only use Fossil's ignore-glob check-in: 22d28ff1f8 user: js tags: trunk
Changes

Modified src/OFArchiveIRIHandler.m from [4da1115176] to [7774e2b1f7].

89
90
91
92
93
94
95
96

97
98

99
100
101
102
103
104
105
106
89
90
91
92
93
94
95

96
97

98

99
100
101
102
103
104
105







-
+

-
+
-







	    rangeOfString: @"!"
		  options: OFStringSearchBackwards].location;

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

	archiveIRI = [OFIRI IRIWithString:
	    [percentEncodedPath substringWithRange: OFMakeRange(0, pos)]
	    [percentEncodedPath substringToIndex: pos]
	    .stringByRemovingPercentEncoding];
	path = [percentEncodedPath substringWithRange:
	path = [percentEncodedPath substringFromIndex: pos + 1]
	    OFMakeRange(pos + 1, percentEncodedPath.length - pos - 1)]
	    .stringByRemovingPercentEncoding;

	if ([scheme isEqual: @"lha"]) {
		OFLHAArchive *archive = [OFLHAArchive archiveWithIRI: archiveIRI
								mode: mode];
		OFLHAArchiveEntry *entry;

Modified src/OFMutableZooArchiveEntry.m from [0dfbc7e2aa] to [bab7c0bd83].

142
143
144
145
146
147
148
149

150
151
152
153

154
155
156
157
158
159
160
161
142
143
144
145
146
147
148

149

150
151

152

153
154
155
156
157
158
159







-
+
-


-
+
-







	void *pool = objc_autoreleasePoolPush();
	OFString *oldFileName = _fileName, *oldDirectoryName = _directoryName;
	size_t lastSlash;

	lastSlash = [fileName rangeOfString: @"/"
				    options: OFStringSearchBackwards].location;
	if (lastSlash != OFNotFound) {
		_fileName = [[fileName substringWithRange: OFMakeRange(
		_fileName = [[fileName substringFromIndex: lastSlash + 1] copy];
		    lastSlash + 1, fileName.length - lastSlash - 1)] copy];
		[oldFileName release];

		_directoryName = [[fileName substringWithRange:
		_directoryName = [[fileName substringToIndex: lastSlash] copy];
		    OFMakeRange(0, lastSlash)] copy];
		[oldDirectoryName release];
	} else {
		_fileName = [fileName copy];
		[oldFileName release];

		[_directoryName release];
		_directoryName = nil;

Modified src/OFSocket.m from [0dcfbd34b6] to [08fad4b779].

448
449
450
451
452
453
454
455

456
457

458
459
460
461
462
463
464
448
449
450
451
452
453
454

455


456
457
458
459
460
461
462
463







-
+
-
-
+







	OFSocketAddress address;
	const struct sockaddr_in *addrIn;
	uint32_t addr;

	if (lastColon == OFNotFound)
		@throw [OFInvalidFormatException exception];

	IPv4 = [IPv6 substringWithRange:
	IPv4 = [IPv6 substringFromIndex: lastColon + 1];
	    OFMakeRange(lastColon + 1, IPv6.length - lastColon - 1)];
	IPv6 = [IPv6 substringWithRange: OFMakeRange(0, lastColon + 1)];
	IPv6 = [IPv6 substringToIndex: lastColon + 1];

	address = OFSocketAddressParseIPv4(IPv4, 0);
	addrIn = &address.sockaddr.in;
	addr = OFFromBigEndian32(addrIn->sin_addr.s_addr);

	return [IPv6 stringByAppendingString:
	    [OFString stringWithFormat: @"%x%02x:%x%02x",