ObjFW  Diff

Differences From Artifact [d8c5285da7]:

To Artifact [d31bdbf69b]:


587
588
589
590
591
592
593

594
595
596
597

598
599
600
601
602
603
604
587
588
589
590
591
592
593
594
595
596
597

598
599
600
601
602
603
604
605







+



-
+







	if (buf[*i] != '=')
		return;

	if ((len = *i - *last) > 0)
		[cache appendCStringWithoutUTF8Checking: buf + *last
						 length: len];

	[cache removeLeadingAndTrailingWhitespaces];
	cache_c = [cache cString];
	cache_len = [cache cStringLength];

	if ((tmp = memchr(cache_c, ':', cache_len)) != NULL ) {
	if ((tmp = memchr(cache_c, ':', cache_len)) != NULL) {
		attrName = [[OFString alloc] initWithCString: tmp + 1
						      length: cache_len -
							      (tmp - cache_c) -
							      1];
		attrPrefix = [[OFString alloc] initWithCString: cache_c
							length: tmp - cache_c];
	} else {
613
614
615
616
617
618
619






620
621
622
623
624
625
626
627
628
629
630
631
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630

631
632
633
634
635
636
637







+
+
+
+
+
+




-







}

/* Expecting delimiter */
- (void)_parseExpectDelimiterWithBuffer: (const char*)buf
				      i: (size_t*)i
				   last: (size_t*)last
{
	*last = *i + 1;

	if (buf[*i] == ' ' || buf[*i] == '\t' || buf[*i] == '\n' ||
	    buf[*i] == '\r')
		return;

	if (buf[*i] != '\'' && buf[*i] != '"')
		@throw [OFMalformedXMLException newWithClass: isa];

	delim = buf[*i];
	*last = *i + 1;
	state = OF_XMLPARSER_IN_ATTR_VALUE;
}

/* Looking for attribute value */
- (void)_parseInAttributeValueWithBuffer: (const char*)buf
				       i: (size_t*)i
				    last: (size_t*)last