ObjFW  Diff

Differences From Artifact [329139cf3c]:

To Artifact [5b6856fe26]:


455
456
457
458
459
460
461


462
463
464
465

















466
467
468
469
470
471
472
	}

	return self;
}

- initWithString: (OFString*)str
{


	self = [super init];

	string = strdup([str cString]);
	length = [str cStringLength];


















	@try {
		[self addMemoryToPool: string];
	} @catch (OFException *e) {
		/*
		 * We can't use [super dealloc] on OS X here.
		 * Compiler bug? Anyway, [self dealloc] will do here as we







>
>


|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
	}

	return self;
}

- initWithString: (OFString*)str
{
	Class c;

	self = [super init];

	string = (char*)[str cString];
	length = [str cStringLength];

	switch (of_string_check_utf8(string, length)) {
		case 1:
			is_utf8 = YES;
			break;
		case -1:
			c = isa;
			[self dealloc];
			@throw [OFInvalidEncodingException newWithClass: c];
	}

	if ((string = strdup(string)) == NULL) {
		c = isa;
		[self dealloc];
		@throw [OFOutOfMemoryException newWithClass: c
						       size: length + 1];
	}

	@try {
		[self addMemoryToPool: string];
	} @catch (OFException *e) {
		/*
		 * We can't use [super dealloc] on OS X here.
		 * Compiler bug? Anyway, [self dealloc] will do here as we