ObjFW  Diff

Differences From Artifact [cdac934c1e]:

To Artifact [9ad96294d0]:


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#import "OFInvalidFormatException.h"
#import "OFOutOfMemoryException.h"

/* Reference for static linking */
int _OFString_URLEncoding_reference;

@implementation OFString (URLEncoding)
- (OFString*)stringByURLEncoding
{
	return [self stringByURLEncodingWithAllowedCharacters: "$-_.!*()"];
}

- (OFString*)stringByURLEncodingWithAllowedCharacters: (const char*)allowed
{
	void *pool = objc_autoreleasePoolPush();
	const char *string = [self UTF8String];
	char *retCString;
	size_t i;
	OFString *ret;








|




|







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#import "OFInvalidFormatException.h"
#import "OFOutOfMemoryException.h"

/* Reference for static linking */
int _OFString_URLEncoding_reference;

@implementation OFString (URLEncoding)
- (OFString *)stringByURLEncoding
{
	return [self stringByURLEncodingWithAllowedCharacters: "$-_.!*()"];
}

- (OFString *)stringByURLEncodingWithAllowedCharacters: (const char *)allowed
{
	void *pool = objc_autoreleasePoolPush();
	const char *string = [self UTF8String];
	char *retCString;
	size_t i;
	OFString *ret;

82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
	} @finally {
		free(retCString);
	}

	return ret;
}

- (OFString*)stringByURLDecoding
{
	void *pool = objc_autoreleasePoolPush();
	OFString *ret;
	const char *string = [self UTF8String];
	char *retCString;
	char byte = 0;
	int state = 0;







|







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
	} @finally {
		free(retCString);
	}

	return ret;
}

- (OFString *)stringByURLDecoding
{
	void *pool = objc_autoreleasePoolPush();
	OFString *ret;
	const char *string = [self UTF8String];
	char *retCString;
	char byte = 0;
	int state = 0;