Mercurial > vim
comparison src/diff.c @ 26829:88a33cf5aeb6 v8.2.3943
patch 8.2.3943: compiler warning from gcc for uninitialized variable
Commit: https://github.com/vim/vim/commit/491669701c72578f273db53e579d8a03a9deac0c
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Dec 30 10:51:45 2021 +0000
patch 8.2.3943: compiler warning from gcc for uninitialized variable
Problem: Compiler warning from gcc for uninitialized variable.
Solution: Initialize variable. (closes https://github.com/vim/vim/issues/9429)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 30 Dec 2021 12:00:03 +0100 |
parents | 77ff030699d2 |
children | 06a137af96f8 |
comparison
equal
deleted
inserted
replaced
26828:e05512129055 | 26829:88a33cf5aeb6 |
---|---|
1634 char_u linebuf[LBUFLEN]; // only need to hold the diff line | 1634 char_u linebuf[LBUFLEN]; // only need to hold the diff line |
1635 char_u *line; | 1635 char_u *line; |
1636 long off; | 1636 long off; |
1637 int i; | 1637 int i; |
1638 int notset = TRUE; // block "*dp" not set yet | 1638 int notset = TRUE; // block "*dp" not set yet |
1639 diffhunk_T *hunk; | 1639 diffhunk_T *hunk = NULL; // init to avoid gcc warning |
1640 | 1640 |
1641 enum { | 1641 enum { |
1642 DIFF_ED, | 1642 DIFF_ED, |
1643 DIFF_UNIFIED, | 1643 DIFF_UNIFIED, |
1644 DIFF_NONE | 1644 DIFF_NONE |
1660 | 1660 |
1661 if (!dio->dio_internal) | 1661 if (!dio->dio_internal) |
1662 { | 1662 { |
1663 hunk = ALLOC_ONE(diffhunk_T); | 1663 hunk = ALLOC_ONE(diffhunk_T); |
1664 if (hunk == NULL) | 1664 if (hunk == NULL) |
1665 { | |
1666 emsg(_("E98: Cannot read diff output")); | |
1667 return; | 1665 return; |
1668 } | |
1669 } | 1666 } |
1670 | 1667 |
1671 for (;;) | 1668 for (;;) |
1672 { | 1669 { |
1673 if (dio->dio_internal) | 1670 if (dio->dio_internal) |