summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-09-13 13:03:11 +0200
committerBram Moolenaar <Bram@vim.org>2018-09-13 13:03:11 +0200
commit3b8defd0a52fc1276816608e7bb24b628ab14c2e (patch)
tree51274af65eed16671abb4eceb00a7949c6f16699
parentbd9a53c06c8869ad811cb3dd01a309c9be7d7a63 (diff)
downloadvim-git-8.1.0375.tar.gz
patch 8.1.0375: cannot use diff mode with Cygwin diff.exev8.1.0375
Problem: Cannot use diff mode with Cygwin diff.exe. (Igor Forca) Solution: Skip over unrecognized lines in the diff output.
-rw-r--r--src/diff.c4
-rw-r--r--src/testdir/test_diffmode.vim4
-rw-r--r--src/version.c2
3 files changed, 9 insertions, 1 deletions
diff --git a/src/diff.c b/src/diff.c
index 0055cba5a..59daf1eeb 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -1600,6 +1600,10 @@ diff_read(
&& (tag_fgets(linebuf, LBUFLEN, fd) == 0)
&& (STRNCMP(line, "@@ ", 3) == 0))
diffstyle = DIFF_UNIFIED;
+ else
+ // Format not recognized yet, skip over this line. Cygwin diff
+ // may put a warning at the start of the file.
+ continue;
}
if (diffstyle == DIFF_ED)
diff --git a/src/testdir/test_diffmode.vim b/src/testdir/test_diffmode.vim
index c3c1eaf4a..0022a73b3 100644
--- a/src/testdir/test_diffmode.vim
+++ b/src/testdir/test_diffmode.vim
@@ -519,7 +519,9 @@ func Test_diffexpr()
endif
func DiffExpr()
- silent exe '!diff ' . v:fname_in . ' ' . v:fname_new . '>' . v:fname_out
+ " Prepent some text to check diff type detection
+ call writefile(['warning', ' message'], v:fname_out)
+ silent exe '!diff ' . v:fname_in . ' ' . v:fname_new . '>>' . v:fname_out
endfunc
set diffexpr=DiffExpr()
set diffopt=foldcolumn:0
diff --git a/src/version.c b/src/version.c
index ca6ac59f0..c10333912 100644
--- a/src/version.c
+++ b/src/version.c
@@ -795,6 +795,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 375,
+/**/
374,
/**/
373,