summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-08-02 21:41:28 +0200
committerBram Moolenaar <Bram@vim.org>2016-08-02 21:41:28 +0200
commit796aa9c804f09276bd3cc45123f4a191a001dec2 (patch)
tree02ebdb00bf1db0c00547c4f33ebfba582da217e2
parentbc8801c9317eb721a2ee91322669f2dd5d136380 (diff)
patch 7.4.2144v7.4.2144
Problem: On MS-Windows quickix does not handle a line with 1023 bytes ending in CR-LF properly. Solution: Don't consider CR a line break. (Ken Takata)
-rw-r--r--src/quickfix.c24
-rw-r--r--src/version.c2
2 files changed, 9 insertions, 17 deletions
diff --git a/src/quickfix.c b/src/quickfix.c
index b6071709df..aa94ae69a3 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -651,11 +651,7 @@ qf_get_next_file_line(qfstate_T *state)
discard = FALSE;
state->linelen = (int)STRLEN(IObuff);
- if (state->linelen == IOSIZE - 1 && !(IObuff[state->linelen - 1] == '\n'
-#ifdef USE_CRNL
- || IObuff[state->linelen - 1] == '\r'
-#endif
- ))
+ if (state->linelen == IOSIZE - 1 && !(IObuff[state->linelen - 1] == '\n'))
{
/*
* The current line exceeds IObuff, continue reading using
@@ -680,11 +676,7 @@ qf_get_next_file_line(qfstate_T *state)
break;
state->linelen = (int)STRLEN(state->growbuf + growbuflen);
growbuflen += state->linelen;
- if ((state->growbuf)[growbuflen - 1] == '\n'
-#ifdef USE_CRNL
- || (state->growbuf)[growbuflen - 1] == '\r'
-#endif
- )
+ if ((state->growbuf)[growbuflen - 1] == '\n')
break;
if (state->growbufsiz == LINE_MAXLEN)
{
@@ -708,11 +700,7 @@ qf_get_next_file_line(qfstate_T *state)
*/
if (fgets((char *)IObuff, IOSIZE, state->fd) == NULL
|| (int)STRLEN(IObuff) < IOSIZE - 1
- || IObuff[IOSIZE - 1] == '\n'
-#ifdef USE_CRNL
- || IObuff[IOSIZE - 1] == '\r'
-#endif
- )
+ || IObuff[IOSIZE - 1] == '\n')
break;
}
@@ -757,11 +745,13 @@ qf_get_nextline(qfstate_T *state)
/* remove newline/CR from the line */
if (state->linelen > 0 && state->linebuf[state->linelen - 1] == '\n')
+ {
state->linebuf[state->linelen - 1] = NUL;
#ifdef USE_CRNL
- if (state->linelen > 0 && state->linebuf[state->linelen - 1] == '\r')
- state->linebuf[state->linelen - 1] = NUL;
+ if (state->linelen > 1 && state->linebuf[state->linelen - 2] == '\r')
+ state->linebuf[state->linelen - 2] = NUL;
#endif
+ }
#ifdef FEAT_MBYTE
remove_bom(state->linebuf);
diff --git a/src/version.c b/src/version.c
index 1c7d2c3885..a6f1794394 100644
--- a/src/version.c
+++ b/src/version.c
@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2144,
+/**/
2143,
/**/
2142,