summaryrefslogtreecommitdiffstats
path: root/src/diff.c
diff options
context:
space:
mode:
authorglacambre <code@lacamb.re>2021-05-24 14:20:53 +0200
committerBram Moolenaar <Bram@vim.org>2021-05-24 14:20:53 +0200
commitad5c178a191cf2cf37a27c2a789d7afda3879831 (patch)
tree6ad25f075155d0a6b88064d749f87c763679b382 /src/diff.c
parentf5409dbf66f4e4a0461d3f2079c1bffacbf12392 (diff)
patch 8.2.2880: unified diff fails if actually usedv8.2.2880
Problem: Unified diff fails if actually used. Solution: Invoke :diffupdate in the test. Fix the check for working external diff. (Ghjuvan Lacambre, Christian Brabandt, closes #8197)
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/diff.c b/src/diff.c
index 0a0594cfef..6f25c373c4 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -1007,10 +1007,12 @@ check_external_diff(diffio_T *diffio)
for (;;)
{
- // There must be a line that contains "1c1".
+ // For normal diff there must be a line that contains
+ // "1c1". For unified diff "@@ -1 +1 @@".
if (vim_fgets(linebuf, LBUFLEN, fd))
break;
- if (STRNCMP(linebuf, "1c1", 3) == 0)
+ if (STRNCMP(linebuf, "1c1", 3) == 0
+ || STRNCMP(linebuf, "@@ -1 +1 @@", 11) == 0)
ok = TRUE;
}
fclose(fd);