Mercurial > vim
comparison src/diff.c @ 24683:05c199ea8295 v8.2.2880
patch 8.2.2880: unified diff fails if actually used
Commit: https://github.com/vim/vim/commit/ad5c178a191cf2cf37a27c2a789d7afda3879831
Author: glacambre <code@lacamb.re>
Date: Mon May 24 14:20:53 2021 +0200
patch 8.2.2880: unified diff fails if actually used
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 24 May 2021 14:30:03 +0200 |
parents | e313b6ee2d9c |
children | 712e867f9721 |
comparison
equal
deleted
inserted
replaced
24682:e303bc0bda84 | 24683:05c199ea8295 |
---|---|
1005 { | 1005 { |
1006 char_u linebuf[LBUFLEN]; | 1006 char_u linebuf[LBUFLEN]; |
1007 | 1007 |
1008 for (;;) | 1008 for (;;) |
1009 { | 1009 { |
1010 // There must be a line that contains "1c1". | 1010 // For normal diff there must be a line that contains |
1011 // "1c1". For unified diff "@@ -1 +1 @@". | |
1011 if (vim_fgets(linebuf, LBUFLEN, fd)) | 1012 if (vim_fgets(linebuf, LBUFLEN, fd)) |
1012 break; | 1013 break; |
1013 if (STRNCMP(linebuf, "1c1", 3) == 0) | 1014 if (STRNCMP(linebuf, "1c1", 3) == 0 |
1015 || STRNCMP(linebuf, "@@ -1 +1 @@", 11) == 0) | |
1014 ok = TRUE; | 1016 ok = TRUE; |
1015 } | 1017 } |
1016 fclose(fd); | 1018 fclose(fd); |
1017 } | 1019 } |
1018 mch_remove(diffio->dio_diff.dout_fname); | 1020 mch_remove(diffio->dio_diff.dout_fname); |