ObjFW  Diff

Differences From Artifact [80d783f695]:

To Artifact [8aabd85aa9]:


155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
- (void)of_parseLine: (OFString *)line
{
	if (![line hasPrefix: @";"]) {
		OFINISectionPair *pair;
		OFString *key, *value;
		size_t pos;

		if (_name == nil)
			@throw [OFInvalidFormatException exception];

		pair = [[[OFINISectionPair alloc] init] autorelease];

		if ((pos = [line rangeOfString: @"="].location) == OFNotFound)
			@throw [OFInvalidFormatException exception];

		key = unescapeString([line substringToIndex: pos]
		    .stringByDeletingEnclosingWhitespaces);







<
<
<







155
156
157
158
159
160
161



162
163
164
165
166
167
168
- (void)of_parseLine: (OFString *)line
{
	if (![line hasPrefix: @";"]) {
		OFINISectionPair *pair;
		OFString *key, *value;
		size_t pos;




		pair = [[[OFINISectionPair alloc] init] autorelease];

		if ((pos = [line rangeOfString: @"="].location) == OFNotFound)
			@throw [OFInvalidFormatException exception];

		key = unescapeString([line substringToIndex: pos]
		    .stringByDeletingEnclosingWhitespaces);
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
- (bool)of_writeToStream: (OFStream *)stream
		encoding: (OFStringEncoding)encoding
		   first: (bool)first
{
	if (_lines.count == 0)
		return false;

	if (_name != nil) {
		if (first)
			[stream writeFormat: @"[%@]\r\n", _name];
		else
			[stream writeFormat: @"\r\n[%@]\r\n", _name];
	}

	for (id line in _lines) {







|







476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
- (bool)of_writeToStream: (OFStream *)stream
		encoding: (OFStringEncoding)encoding
		   first: (bool)first
{
	if (_lines.count == 0)
		return false;

	if (_name.length > 0) {
		if (first)
			[stream writeFormat: @"[%@]\r\n", _name];
		else
			[stream writeFormat: @"\r\n[%@]\r\n", _name];
	}

	for (id line in _lines) {