wineps: Cope with '\r'-only end-of-line markers.
This commit is contained in:
parent
c22be15a98
commit
cb3815aead
|
@ -266,7 +266,15 @@ static BOOL get_line( char *buf, int size, struct map_context *ctx )
|
||||||
{
|
{
|
||||||
if (ctx->pos > ctx->end) break;
|
if (ctx->pos > ctx->end) break;
|
||||||
buf[i] = *ctx->pos++;
|
buf[i] = *ctx->pos++;
|
||||||
if (buf[i] == '\n')
|
|
||||||
|
/* \r\n -> \n */
|
||||||
|
if (buf[i] == '\r' && ctx->pos <= ctx->end && *ctx->pos == '\n')
|
||||||
|
{
|
||||||
|
ctx->pos++;
|
||||||
|
buf[i] = '\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (buf[i] == '\n' || buf[i] == '\r')
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
break;
|
break;
|
||||||
|
@ -394,7 +402,9 @@ static BOOL PSDRV_PPDGetNextTuple(struct map_context *ctx, PPDTuple *tuple)
|
||||||
break;
|
break;
|
||||||
} while(1);
|
} while(1);
|
||||||
|
|
||||||
if(line[strlen(line)-1] != '\n') {
|
cp = line + strlen(line) - 1;
|
||||||
|
if (*cp != '\n' && *cp != '\r')
|
||||||
|
{
|
||||||
ERR("Line too long.\n");
|
ERR("Line too long.\n");
|
||||||
goto start;
|
goto start;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue