ObjFW  Diff

Differences From Artifact [2082375f0b]:

To Artifact [bc22950fc0]:


58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
	[URL makeImmutable];

	objc_autoreleasePoolPop(pool);

	return URL;
}

- init
{
	OF_INVALID_INIT_METHOD
}

- (instancetype)of_init
{
	return [super init];
}

- initWithString: (OFString *)string
{
	char *UTF8String, *UTF8String2 = NULL;

	self = [super init];

	@try {
		void *pool = objc_autoreleasePoolPush();







|









|







58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
	[URL makeImmutable];

	objc_autoreleasePoolPop(pool);

	return URL;
}

- (instancetype)init
{
	OF_INVALID_INIT_METHOD
}

- (instancetype)of_init
{
	return [super init];
}

- (instancetype)initWithString: (OFString *)string
{
	char *UTF8String, *UTF8String2 = NULL;

	self = [super init];

	@try {
		void *pool = objc_autoreleasePoolPush();
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
	} @finally {
		free(UTF8String2);
	}

	return self;
}

- initWithString: (OFString *)string
   relativeToURL: (OFURL *)URL
{
	char *UTF8String, *UTF8String2 = NULL;

	if ([string containsString: @"://"])
		return [self initWithString: string];

	self = [super init];







|
|







202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
	} @finally {
		free(UTF8String2);
	}

	return self;
}

- (instancetype)initWithString: (OFString *)string
		 relativeToURL: (OFURL *)URL
{
	char *UTF8String, *UTF8String2 = NULL;

	if ([string containsString: @"://"])
		return [self initWithString: string];

	self = [super init];
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
	} @finally {
		free(UTF8String2);
	}

	return self;
}

- initWithSerialization: (OFXMLElement *)element
{
	@try {
		void *pool = objc_autoreleasePoolPush();

		if (![[element name] isEqual: [self className]] ||
		    ![[element namespace] isEqual: OF_SERIALIZATION_NS])
			@throw [OFInvalidArgumentException exception];







|







276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
	} @finally {
		free(UTF8String2);
	}

	return self;
}

- (instancetype)initWithSerialization: (OFXMLElement *)element
{
	@try {
		void *pool = objc_autoreleasePoolPush();

		if (![[element name] isEqual: [self className]] ||
		    ![[element namespace] isEqual: OF_SERIALIZATION_NS])
			@throw [OFInvalidArgumentException exception];
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
}

- (OFString *)fragment
{
	return _fragment;
}

- copy
{
	return [self retain];
}

- mutableCopy
{
	OFMutableURL *copy = [[OFMutableURL alloc] init];

	@try {
		[copy setScheme: _scheme];
		[copy setHost: _host];
		[copy setPort: _port];







|




|







412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
}

- (OFString *)fragment
{
	return _fragment;
}

- (id)copy
{
	return [self retain];
}

- (id)mutableCopy
{
	OFMutableURL *copy = [[OFMutableURL alloc] init];

	@try {
		[copy setScheme: _scheme];
		[copy setHost: _host];
		[copy setPort: _port];