ObjFW  Diff

Differences From Artifact [a84b6238c0]:

To Artifact [996f83c1ba]:


517
518
519
520
521
522
523
524

525
526
527
528
529
530
531
532
517
518
519
520
521
522
523

524

525
526
527
528
529
530
531







-
+
-







	size_t i, bufferLength, retLength;
	char *retCString, *buffer, *newCache;
	OFString *ret;

	/* Look if there's a line or \0 in our cache */
	if (!waitingForDelimiter && cache != NULL) {
		for (i = 0; i < cacheLength; i++) {
			if (OF_UNLIKELY(cache[i] == '\n' ||
			if OF_UNLIKELY (cache[i] == '\n' || cache[i] == '\0') {
			    cache[i] == '\0')) {
				retLength = i;

				if (i > 0 && cache[i - 1] == '\r')
					retLength--;

				ret = [OFString stringWithCString: cache
							 encoding: encoding
576
577
578
579
580
581
582
583
584


585
586
587
588
589
590
591
575
576
577
578
579
580
581


582
583
584
585
586
587
588
589
590







-
-
+
+







		}

		bufferLength = [self _readIntoBuffer: buffer
					      length: of_pagesize];

		/* Look if there's a newline or \0 */
		for (i = 0; i < bufferLength; i++) {
			if (OF_UNLIKELY(buffer[i] == '\n' ||
			    buffer[i] == '\0')) {
			if OF_UNLIKELY (buffer[i] == '\n' ||
			    buffer[i] == '\0') {
				retLength = cacheLength + i;
				retCString = [self
				    allocMemoryWithSize: retLength];

				if (cache != NULL)
					memcpy(retCString, cache, cacheLength);
				memcpy(retCString + cacheLength, buffer, i);