Compare commits
10 Commits
e223abecc5
...
df60676c56
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df60676c56 | ||
|
|
a232edb74a | ||
|
|
8aaf40e13f | ||
|
|
c18c80dd46 | ||
|
|
8bdaafd595 | ||
|
|
83716cb5cf | ||
|
|
cb5fc90178 | ||
|
|
b6ea60275d | ||
|
|
6089fda02c | ||
|
|
686f8758f2 |
27
diff3-set-flagging-to-true-in-X-option.patch
Normal file
27
diff3-set-flagging-to-true-in-X-option.patch
Normal file
@ -0,0 +1,27 @@
|
||||
From 0c3b6966fec92957c9d0e0ed0d83bc0716641d66 Mon Sep 17 00:00:00 2001
|
||||
From: panxiaohe <panxh.life@foxmail.com>
|
||||
Date: Tue, 22 Mar 2022 10:46:34 +0800
|
||||
Subject: [PATCH] diff3: set flagging to true in -X option
|
||||
|
||||
The logic of diff3 -X option was changed because
|
||||
commit 4c92a4 changed "FALLTHROUGH" to "break".
|
||||
|
||||
---
|
||||
src/diff3.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/diff3.c b/src/diff3.c
|
||||
index 6be7e3c..fc4adbc 100644
|
||||
--- a/src/diff3.c
|
||||
+++ b/src/diff3.c
|
||||
@@ -304,6 +304,7 @@ main (int argc, char **argv)
|
||||
break;
|
||||
case 'X':
|
||||
overlap_only = true;
|
||||
+ flagging = true;
|
||||
incompat |= 1 << OPTION_X;
|
||||
break;
|
||||
case 'E':
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
Binary file not shown.
BIN
diffutils-3.8.tar.xz
Normal file
BIN
diffutils-3.8.tar.xz
Normal file
Binary file not shown.
@ -11,8 +11,8 @@ diff -up diffutils-3.6/src/diff.c.i18n diffutils-3.6/src/diff.c
|
||||
recursively. */
|
||||
static bool recursive;
|
||||
@@ -298,6 +300,13 @@ main (int argc, char **argv)
|
||||
excluded = new_exclude ();
|
||||
presume_output_tty = false;
|
||||
xstdopen ();
|
||||
|
||||
+#ifdef HANDLE_MULTIBYTE
|
||||
+ if (MB_CUR_MAX > 1)
|
||||
@ -398,15 +398,15 @@ diff -up diffutils-3.6/src/io.c.i18n diffutils-3.6/src/io.c
|
||||
+
|
||||
/* Hash this line until we find a newline. */
|
||||
switch (ig_white_space)
|
||||
{
|
||||
{
|
||||
@@ -397,7 +708,7 @@ find_and_hash_each_line (struct file_dat
|
||||
else if (!diff_length_compare_anyway)
|
||||
continue;
|
||||
else if (!diff_length_compare_anyway)
|
||||
continue;
|
||||
|
||||
- if (! lines_differ (eqline, ip))
|
||||
+ if (! lines_differ (eqline, eqs[i].length + 1, ip, length + 1))
|
||||
break;
|
||||
}
|
||||
- if (! lines_differ (eqline, ip))
|
||||
+ if (! lines_differ (eqline, eqs[i].length + 1, ip, length + 1))
|
||||
break;
|
||||
}
|
||||
|
||||
diff -up diffutils-3.6/src/util.c.i18n diffutils-3.6/src/util.c
|
||||
--- diffutils-3.6/src/util.c.i18n 2017-05-18 18:39:59.000000000 +0100
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
Name: diffutils
|
||||
Version: 3.7
|
||||
Version: 3.8
|
||||
Release: 3
|
||||
Summary: A GNU collection of diff utilities
|
||||
URL: http://www.gnu.org/software/diffutils/diffutils.html
|
||||
Source: ftp://ftp.gnu.org/gnu/diffutils/diffutils-%{version}.tar.xz
|
||||
Patch1: diffutils-cmp-s-empty.patch
|
||||
Patch2: diffutils-i18n.patch
|
||||
Patch3: diff3-set-flagging-to-true-in-X-option.patch
|
||||
Patch4: sdiff-fix-unlikely-memory-leak.patch
|
||||
|
||||
License: GPLv3+
|
||||
Provides: bundled(gnulib)
|
||||
@ -26,6 +28,9 @@ GNU Diffutils is a package of several programs related to finding differences be
|
||||
autoreconf -ifv
|
||||
|
||||
%build
|
||||
%ifarch aarch64
|
||||
CFLAGS="$RPM_OPT_FLAGS -fsigned-char"
|
||||
%endif
|
||||
%configure
|
||||
make PR_PROGRAM=%{_bindir}/pr
|
||||
|
||||
@ -51,13 +56,43 @@ cat tests/test-suite.log
|
||||
%exclude %{_infodir}/dir
|
||||
|
||||
%changelog
|
||||
* Mon Nov 11 2019 shenyangyang<shenyangyang4@huawei.com> 3.7-3
|
||||
* Wed Oct 19 2022 zhangruifang <zhangruifang1@h-partners.com> - 3.8-3
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:fix unlikely memory leak
|
||||
|
||||
* Tue Mar 22 2022 panxiaohe<panxh.life@foxmail.com> - 3.8-2
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:set flagging to true in diff3 -X option
|
||||
|
||||
* Tue Nov 30 2021 zoulin<zoulin13@huawei.com> - 3.8-1
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:update version to 3.8
|
||||
|
||||
* Wed Aug 11 2021 wangjie<wangjie375@huawei.com> - 3.7-5
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:fix missing binary operator before token "("
|
||||
|
||||
* Wed Mar 24 2021 zoulin<zoulin13@huawei.com> - 3.7-4
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:add -fsign-char for aarch64 for test-localeconv
|
||||
|
||||
* Mon Nov 11 2019 shenyangyang<shenyangyang4@huawei.com> - 3.7-3
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:delete unneeded comments
|
||||
|
||||
* Thu Oct 24 2019 shenyangyang<shenyangyang4@huawei.com> 3.7-2
|
||||
* Thu Oct 24 2019 shenyangyang<shenyangyang4@huawei.com> - 3.7-2
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
|
||||
41
sdiff-fix-unlikely-memory-leak.patch
Normal file
41
sdiff-fix-unlikely-memory-leak.patch
Normal file
@ -0,0 +1,41 @@
|
||||
From f2e2b4d3c3288e6cae3918fc432bdab8c0c485b7 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Eggert <eggert@cs.ucla.edu>
|
||||
Date: Sun, 22 Aug 2021 13:54:04 -0700
|
||||
Subject: [PATCH] sdiff: fix unlikely memory leak
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
* src/sdiff.c (temporary_file): Fix memory leak when mkstemp fails.
|
||||
Don’t assume temporary file name length fits in ‘int’.
|
||||
---
|
||||
src/sdiff.c | 13 ++++++++-----
|
||||
1 file changed, 8 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/sdiff.c b/src/sdiff.c
|
||||
index 11e4da9..ab12987 100644
|
||||
--- a/src/sdiff.c
|
||||
+++ b/src/sdiff.c
|
||||
@@ -1163,11 +1163,14 @@ temporary_file (void)
|
||||
{
|
||||
char const *tmpdir = getenv (TMPDIR_ENV);
|
||||
char const *dir = tmpdir ? tmpdir : P_tmpdir;
|
||||
- char *buf = xmalloc (strlen (dir) + 1 + 5 + 6 + 1);
|
||||
- int fd;
|
||||
- sprintf (buf, "%s/sdiffXXXXXX", dir);
|
||||
- fd = mkstemp (buf);
|
||||
- if (0 <= fd)
|
||||
+ size_t dirlen = strlen (dir);
|
||||
+ char *buf = xmalloc (dirlen + 1 + 5 + 6 + 1);
|
||||
+ memcpy (buf, dir, dirlen);
|
||||
+ strcpy (buf + dirlen, "/sdiffXXXXXX");
|
||||
+ int fd = mkstemp (buf);
|
||||
+ if (fd < 0)
|
||||
+ free (buf);
|
||||
+ else
|
||||
tmpname = buf;
|
||||
return fd;
|
||||
}
|
||||
--
|
||||
2.27.0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user