Commit 43e77cfd authored by Per Cederqvist's avatar Per Cederqvist

(copy_file): Don't emit duplicate newlines.

parent 83e1af72
/*
* $Id: simple-cache.c,v 0.86 1999/07/11 21:19:30 ceder Exp $
* $Id: simple-cache.c,v 0.87 1999/07/11 23:41:33 ceder Exp $
* Copyright (C) 1991-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -40,7 +40,7 @@
#endif
static const char *
rcsid = "$Id: simple-cache.c,v 0.86 1999/07/11 21:19:30 ceder Exp $";
rcsid = "$Id: simple-cache.c,v 0.87 1999/07/11 23:41:33 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -1890,10 +1890,19 @@ copy_file(FILE *from,
}
/* The last chunk should end with a newline. */
if (len == result && buf[len-1] != '\n')
if (len == result)
{
restart_kom("Failed to find a newline at %ld + %ld - 1\n",
from_pos, orig_len);
if (buf[len-1] != '\n')
{
restart_kom("Failed to find a newline at %ld + %ld - 1\n",
from_pos, orig_len);
}
/* Don't emit the newline here. */
--len;
--chunk_len;
if (len == 0)
return;
}
/* Write this chunk. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment