To: vim_dev@googlegroups.com Subject: Patch 7.4.2144 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.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) Files: src/quickfix.c *** ../vim-7.4.2143/src/quickfix.c 2016-07-24 21:58:39.716057524 +0200 --- src/quickfix.c 2016-08-02 21:35:55.079961678 +0200 *************** *** 651,661 **** 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 ! )) { /* * The current line exceeds IObuff, continue reading using --- 651,657 ---- discard = FALSE; state->linelen = (int)STRLEN(IObuff); ! if (state->linelen == IOSIZE - 1 && !(IObuff[state->linelen - 1] == '\n')) { /* * The current line exceeds IObuff, continue reading using *************** *** 680,690 **** 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 ! ) break; if (state->growbufsiz == LINE_MAXLEN) { --- 676,682 ---- break; state->linelen = (int)STRLEN(state->growbuf + growbuflen); growbuflen += state->linelen; ! if ((state->growbuf)[growbuflen - 1] == '\n') break; if (state->growbufsiz == LINE_MAXLEN) { *************** *** 708,718 **** */ 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 ! ) break; } --- 700,706 ---- */ if (fgets((char *)IObuff, IOSIZE, state->fd) == NULL || (int)STRLEN(IObuff) < IOSIZE - 1 ! || IObuff[IOSIZE - 1] == '\n') break; } *************** *** 757,767 **** /* 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; #endif #ifdef FEAT_MBYTE remove_bom(state->linebuf); --- 745,757 ---- /* 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 > 1 && state->linebuf[state->linelen - 2] == '\r') ! state->linebuf[state->linelen - 2] = NUL; #endif + } #ifdef FEAT_MBYTE remove_bom(state->linebuf); *** ../vim-7.4.2143/src/version.c 2016-08-01 22:49:18.073145115 +0200 --- src/version.c 2016-08-02 21:35:50.664002902 +0200 *************** *** 765,766 **** --- 765,768 ---- { /* Add new patch number below this line */ + /**/ + 2144, /**/ -- Mynd you, m00se bites Kan be pretty nasti ... "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///