ObjFW  Check-in [930f967649]

Overview
Comment:Fix -[@"" stringByAppendingPathComponent:]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 930f9676494e0326ac10b62db7b13f17aa5e79acf23cb79fa3981ec38c4d2f9b
User & Date: js on 2023-10-08 11:36:31
Other Links: manifest | tags
Context
2023-10-08
11:36
OFFile: Fix closing fd 0 on failed init check-in: 416094d227 user: js tags: trunk
11:36
Fix -[@"" stringByAppendingPathComponent:] check-in: 930f967649 user: js tags: trunk
08:18
utils: Minor style fix check-in: c626b708a4 user: js tags: trunk
Changes

Modified src/platform/AmigaOS/OFString+PathAdditions.m from [afe1214925] to [9856f70c88].

251
252
253
254
255
256
257



258
259
260
261
262
263
264
	[ret retain];
	objc_autoreleasePoolPop(pool);
	return [ret autorelease];
}

- (OFString *)stringByAppendingPathComponent: (OFString *)component
{



	if ([self hasSuffix: @"/"] || [self hasSuffix: @":"])
		return [self stringByAppendingString: component];
	else {
		OFMutableString *ret = [[self mutableCopy] autorelease];

		[ret appendString: @"/"];
		[ret appendString: component];







>
>
>







251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
	[ret retain];
	objc_autoreleasePoolPop(pool);
	return [ret autorelease];
}

- (OFString *)stringByAppendingPathComponent: (OFString *)component
{
	if (self.length == 0)
		return component;

	if ([self hasSuffix: @"/"] || [self hasSuffix: @":"])
		return [self stringByAppendingString: component];
	else {
		OFMutableString *ret = [[self mutableCopy] autorelease];

		[ret appendString: @"/"];
		[ret appendString: component];

Modified src/platform/POSIX/OFString+PathAdditions.m from [0c2531bfb6] to [a4865be3be].

296
297
298
299
300
301
302



303
304
305
306
307
308
309
	objc_autoreleasePoolPop(pool);

	return [ret autorelease];
}

- (OFString *)stringByAppendingPathComponent: (OFString *)component
{



	if ([self hasSuffix: @"/"])
		return [self stringByAppendingString: component];
	else {
		OFMutableString *ret = [[self mutableCopy] autorelease];

		[ret appendString: @"/"];
		[ret appendString: component];







>
>
>







296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
	objc_autoreleasePoolPop(pool);

	return [ret autorelease];
}

- (OFString *)stringByAppendingPathComponent: (OFString *)component
{
	if (self.length == 0)
		return component;

	if ([self hasSuffix: @"/"])
		return [self stringByAppendingString: component];
	else {
		OFMutableString *ret = [[self mutableCopy] autorelease];

		[ret appendString: @"/"];
		[ret appendString: component];

Modified src/platform/Windows/OFString+PathAdditions.m from [b5ca306e27] to [cdc98545fd].

301
302
303
304
305
306
307



308
309
310
311
312
313
314
	objc_autoreleasePoolPop(pool);

	return [ret autorelease];
}

- (OFString *)stringByAppendingPathComponent: (OFString *)component
{



	if ([self hasSuffix: @"\\"] || [self hasSuffix: @"/"])
		return [self stringByAppendingString: component];
	else {
		OFMutableString *ret = [[self mutableCopy] autorelease];

		[ret appendString: @"\\"];
		[ret appendString: component];







>
>
>







301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
	objc_autoreleasePoolPop(pool);

	return [ret autorelease];
}

- (OFString *)stringByAppendingPathComponent: (OFString *)component
{
	if (self.length == 0)
		return component;

	if ([self hasSuffix: @"\\"] || [self hasSuffix: @"/"])
		return [self stringByAppendingString: component];
	else {
		OFMutableString *ret = [[self mutableCopy] autorelease];

		[ret appendString: @"\\"];
		[ret appendString: component];

Modified src/platform/libfat/OFString+PathAdditions.m from [a795f4353d] to [f55e9f1638].

297
298
299
300
301
302
303



304
305
306
307
308
309
310
	objc_autoreleasePoolPop(pool);

	return [ret autorelease];
}

- (OFString *)stringByAppendingPathComponent: (OFString *)component
{



	if ([self hasSuffix: @"/"])
		return [self stringByAppendingString: component];
	else {
		OFMutableString *ret = [[self mutableCopy] autorelease];

		[ret appendString: @"/"];
		[ret appendString: component];







>
>
>







297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
	objc_autoreleasePoolPop(pool);

	return [ret autorelease];
}

- (OFString *)stringByAppendingPathComponent: (OFString *)component
{
	if (self.length == 0)
		return component;

	if ([self hasSuffix: @"/"])
		return [self stringByAppendingString: component];
	else {
		OFMutableString *ret = [[self mutableCopy] autorelease];

		[ret appendString: @"/"];
		[ret appendString: component];