ObjFW  Diff

Differences From Artifact [8879da27e2]:

To Artifact [ff94a45bd6]:


75
76
77
78
79
80
81
82


83
84
85
86
87
88
89
75
76
77
78
79
80
81

82
83
84
85
86
87
88
89
90







-
+
+







}

- (instancetype)initWithIRI: (OFIRI *)IRI encoding: (OFStringEncoding)encoding
{
	self = [super init];

	@try {
		_categories = [[OFMutableArray alloc] init];
		_categories = [[OFMutableArray alloc] initWithObject:
		    [[[OFINICategory alloc] of_initWithName: @""] autorelease]];

		[self of_parseIRI: IRI encoding: encoding];
	} @catch (id e) {
		[self release];
		@throw e;
	}

142
143
144
145
146
147
148



149
150
151
152
153
154

155
156
157
158
159
160
161
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157

158
159
160
161
162
163
164
165







+
+
+





-
+







			OFString *categoryName;

			if (![line hasSuffix: @"]"])
				@throw [OFInvalidFormatException exception];

			categoryName = [line substringWithRange:
			    OFMakeRange(1, line.length - 2)];
			if (categoryName.length == 0)
				@throw [OFInvalidFormatException exception];

			category = [[[OFINICategory alloc]
			    of_initWithName: categoryName] autorelease];
			[_categories addObject: category];
		} else {
			if (category == nil)
				@throw [OFInvalidFormatException exception];
				category = [self categoryForName: @""];

			[category of_parseLine: line];
		}
	}

	objc_autoreleasePoolPop(pool);
}