- i1 = (unsigned int *)t;
- i2 = (unsigned int *)u;
- while (1)
- {
- z = *i1;
- if ((z & 0xffU) == '\n') break;
- z >>= 8;
- if ((z & 0xffU) == '\n') break;
- z >>= 8;
- if ((z & 0xffU) == '\n') break;
- z >>= 8;
- if ((z & 0xffU) == '\n') break;
- *i2++ = *i1++;
- }
- t = (char *)i1;
- u = (char *)i2;
- while ((*u++ = *t++) != '\n') ;
- }
-#endif
- *p = (char)c;
- if (t <= p)
- {
- if (*(t - 2) == '\r') /* t is protected, u isn't */
- {
- *(u - 2) = '\n';
- *(u - 1) = '\0';
- }
- else
- {
- *u = '\0';
- }
- stream->upto = t;
- return (s);
- }
- else
- {
- processed = (int)(t - stream->upto) - 1;
- stream->upto = t - 1;
- u--;
- }
- }
- else
- {
- while ((*u++ = *t++) != '\n') ; /* tight inner loop */
- if (t <= stream->endbuf)
- {
- if (*(t - 2) == '\r') /* t is protected, u isn't */
- {
- *(u - 2) = '\n';
- *(u - 1) = '\0';
- }
- else
- {
- *u = '\0';
- }
- stream->upto = t;
- return (s);
- }
- else
- {
- processed = (int)(t - stream->upto) - 1;
- stream->upto = t - 1;
- u--;
- }
- }
- }
- else
- {
- processed = 0;
- }