ObjFW  Diff

Differences From Artifact [699fa5f856]:

To Artifact [548eca2146]:


645
646
647
648
649
650
651






652
653
654
655
656
657
658
		[ret appendString: component];
	}

	objc_autoreleasePoolPop(pool);

	return ret;
}







- init
{
	if (object_getClass(self) == [OFString class]) {
		@try {
			[self doesNotRecognizeSelector: _cmd];
		} @catch (id e) {







>
>
>
>
>
>







645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
		[ret appendString: component];
	}

	objc_autoreleasePoolPop(pool);

	return ret;
}

+ (of_string_encoding_t)nativeOSEncoding
{
	/* FIXME */
	return OF_STRING_ENCODING_UTF_8;
}

- init
{
	if (object_getClass(self) == [OFString class]) {
		@try {
			[self doesNotRecognizeSelector: _cmd];
		} @catch (id e) {
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
{
	char *tmp;
	struct stat st;

	@try {
		OFFile *file;

		if (stat([path cStringWithEncoding: OF_STRING_ENCODING_NATIVE],
		    &st) == -1)
			@throw [OFOpenFileFailedException
			    exceptionWithPath: path
					 mode: @"rb"];

		if (st.st_size > SIZE_MAX)
			@throw [OFOutOfRangeException exception];








|
|







810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
{
	char *tmp;
	struct stat st;

	@try {
		OFFile *file;

		if (stat([path cStringWithEncoding: [OFString
		    nativeOSEncoding]], &st) == -1)
			@throw [OFOpenFileFailedException
			    exceptionWithPath: path
					 mode: @"rb"];

		if (st.st_size > SIZE_MAX)
			@throw [OFOutOfRangeException exception];