patch 8.1.0377: xdiff doesn't use the Vim memory allocation functions
Problem: Xdiff doesn't use the Vim memory allocation functions.
Solution: Change the xdl_ defines. Check for out-of-memory. Rename
"ignored" to "vim_ignored".
diff --git a/src/fileio.c b/src/fileio.c
index 056ac91..d7e05bf 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2408,7 +2408,7 @@
{
/* Use stderr for stdin, makes shell commands work. */
close(0);
- ignored = dup(2);
+ vim_ignored = dup(2);
}
#endif
@@ -3751,7 +3751,7 @@
{
# ifdef UNIX
# ifdef HAVE_FCHOWN
- ignored = fchown(fd, st_old.st_uid, st_old.st_gid);
+ vim_ignored = fchown(fd, st_old.st_uid, st_old.st_gid);
# endif
if (mch_stat((char *)IObuff, &st) < 0
|| st.st_uid != st_old.st_uid
@@ -4509,7 +4509,7 @@
#endif
#ifdef HAVE_FTRUNCATE
if (!append)
- ignored = ftruncate(fd, (off_t)0);
+ vim_ignored = ftruncate(fd, (off_t)0);
#endif
#if defined(WIN3264)
@@ -4789,7 +4789,7 @@
|| st.st_gid != st_old.st_gid)
{
/* changing owner might not be possible */
- ignored = fchown(fd, st_old.st_uid, -1);
+ vim_ignored = fchown(fd, st_old.st_uid, -1);
/* if changing group fails clear the group permissions */
if (fchown(fd, -1, st_old.st_gid) == -1 && perm > 0)
perm &= ~070;
@@ -6482,9 +6482,9 @@
{
tbuf[FGETS_SIZE - 2] = NUL;
#ifdef USE_CR
- ignoredp = fgets_cr((char *)tbuf, FGETS_SIZE, fp);
+ vim_ignoredp = fgets_cr((char *)tbuf, FGETS_SIZE, fp);
#else
- ignoredp = fgets((char *)tbuf, FGETS_SIZE, fp);
+ vim_ignoredp = fgets((char *)tbuf, FGETS_SIZE, fp);
#endif
} while (tbuf[FGETS_SIZE - 2] != NUL && tbuf[FGETS_SIZE - 2] != '\n');
}