ObjFW  Diff

Differences From Artifact [bb33e92df8]:

To Artifact [80b58be37f]:


44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#import "OFUnsupportedVersionException.h"
#import "OFWriteFailedException.h"

#import "autorelease.h"
#import "macros.h"

static OF_INLINE void
normalize_key(char *str_)
{
	uint8_t *str = (uint8_t*)str_;
	bool firstLetter = true;

	while (*str != '\0') {
		if (!isalnum(*str)) {
			firstLetter = true;







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#import "OFUnsupportedVersionException.h"
#import "OFWriteFailedException.h"

#import "autorelease.h"
#import "macros.h"

static OF_INLINE void
normalizeKey(char *str_)
{
	uint8_t *str = (uint8_t*)str_;
	bool firstLetter = true;

	while (*str != '\0') {
		if (!isalnum(*str)) {
			firstLetter = true;
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503

		if ((keyC = malloc(tmp - lineC + 1)) == NULL)
			@throw [OFOutOfMemoryException
			    exceptionWithRequestedSize: tmp - lineC + 1];

		memcpy(keyC, lineC, tmp - lineC);
		keyC[tmp - lineC] = '\0';
		normalize_key(keyC);

		@try {
			key = [OFString stringWithUTF8StringNoCopy: keyC
						      freeWhenDone: true];
		} @catch (id e) {
			free(keyC);
			@throw e;







|







489
490
491
492
493
494
495
496
497
498
499
500
501
502
503

		if ((keyC = malloc(tmp - lineC + 1)) == NULL)
			@throw [OFOutOfMemoryException
			    exceptionWithRequestedSize: tmp - lineC + 1];

		memcpy(keyC, lineC, tmp - lineC);
		keyC[tmp - lineC] = '\0';
		normalizeKey(keyC);

		@try {
			key = [OFString stringWithUTF8StringNoCopy: keyC
						      freeWhenDone: true];
		} @catch (id e) {
			free(keyC);
			@throw e;