ObjFW  Diff

Differences From Artifact [62cdc3890f]:

To Artifact [e8d94333d8]:


45
46
47
48
49
50
51


52
53
54



55
56
57
58
59
60
61

62
63
64

65
66
67
68
69
70
71
72
73
74
75
76
}

static void
parseDirectoryNameExtension(OFLHAArchiveEntry *entry, OFData *extension,
    of_string_encoding_t encoding)
{
	void *pool = objc_autoreleasePoolPush();


	OFString *tmp = [OFString
	    stringWithCString: (char *)[extension items] + 1
		     encoding: encoding



		       length: [extension count] - 1];
	OFString *separator = [OFString stringWithCString: "\xFF"
						 encoding: encoding
						   length: 1];

	if (![tmp hasSuffix: separator])
		@throw [OFInvalidFormatException exception];


	tmp = [tmp stringByReplacingOccurrencesOfString: separator
					     withString: @"/"];


	[entry->_directoryName release];
	entry->_directoryName = nil;

	entry->_directoryName = [tmp copy];

	objc_autoreleasePoolPop(pool);
}

static void
parseCommentExtension(OFLHAArchiveEntry *entry, OFData *extension,
    of_string_encoding_t encoding)







>
>
|
|
|
>
>
>
|
|
|
|

|
<
>

<
<
>




|







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

66
67


68
69
70
71
72
73
74
75
76
77
78
79
80
}

static void
parseDirectoryNameExtension(OFLHAArchiveEntry *entry, OFData *extension,
    of_string_encoding_t encoding)
{
	void *pool = objc_autoreleasePoolPush();
	OFMutableData *data = [[extension mutableCopy] autorelease];
	char *items = [data items];
	size_t count = [data count];
	OFMutableString *directoryName;

	for (size_t i = 1; i < count; i++)
		if (items[i] == '\xFF')
			items[i] = '/';

	directoryName = [OFMutableString stringWithCString: items + 1
						  encoding: encoding
						    length: count - 1];

	if (![directoryName hasSuffix: @"/"])

		[directoryName appendString: @"/"];



	[directoryName makeImmutable];

	[entry->_directoryName release];
	entry->_directoryName = nil;

	entry->_directoryName = [directoryName copy];

	objc_autoreleasePoolPop(pool);
}

static void
parseCommentExtension(OFLHAArchiveEntry *entry, OFData *extension,
    of_string_encoding_t encoding)