mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
\r terminates a line only if followed by \n or the end of the buffer
This commit is contained in:
parent
b40400d59c
commit
5f606a2829
1 changed files with 5 additions and 2 deletions
|
@ -137,13 +137,16 @@ COM_extract_line (cbuf_t *cbuf)
|
|||
break;
|
||||
if (text[i] == '/' && text[i + 1] == '/') {
|
||||
int j = i;
|
||||
while (j < len && text[j] != '\n' && text[j] != '\r')
|
||||
while (j < len && text[j] != '\n'
|
||||
&& (text[j] != '\r'
|
||||
|| (j < len - 1 && text[j + 1] != '\n')))
|
||||
j++;
|
||||
dstring_snip (cbuf->buf, i, j - i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (text[i] == '\n' || text[i] == '\r')
|
||||
if (text[i] == '\n'
|
||||
|| (text[i] == '\r' && (i == len - 1 || text[ i + 1] == '\n')))
|
||||
break;
|
||||
}
|
||||
if (i)
|
||||
|
|
Loading…
Reference in a new issue