aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/diff.c
diff options
context:
space:
mode:
authorAnatolii Sakhnik <sakhnik@gmail.com>2018-12-09 13:50:14 +0200
committerAnatolii Sakhnik <sakhnik@gmail.com>2018-12-09 19:45:56 +0200
commit72c5a9db70f263eaac12aee140da03190e2fa605 (patch)
treef5d6f1cdf383c9869c15cacbdd2b857cf787a90d /src/nvim/diff.c
parentcf1ffa91667a482c6355f5999b9e97ccc0b4126a (diff)
downloadrneovim-72c5a9db70f263eaac12aee140da03190e2fa605.tar.gz
rneovim-72c5a9db70f263eaac12aee140da03190e2fa605.tar.bz2
rneovim-72c5a9db70f263eaac12aee140da03190e2fa605.zip
vim-patch:8.1.0375: cannot use diff mode with Cygwin diff.exe
Problem: Cannot use diff mode with Cygwin diff.exe. (Igor Forca) Solution: Skip over unrecognized lines in the diff output. https://github.com/vim/vim/commit/3b8defd0a52fc1276816608e7bb24b628ab14c2e
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r--src/nvim/diff.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index c3eb2465bd..2ad9471046 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -1511,6 +1511,10 @@ static void diff_read(int idx_orig, int idx_new, diffout_T *dout)
&& (vim_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;
}
}