Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
df60676c56
!18 fix unlikely memory leak
From: @zhangruifang2020 
Reviewed-by: @openeuler-basic 
Signed-off-by: @openeuler-basic
2022-10-19 08:01:58 +00:00
zhangruifang2020
a232edb74a fix unlikely memory leak 2022-10-19 10:14:08 +08:00
openeuler-ci-bot
8aaf40e13f
!15 [sync] PR-13: diff3: set flagging to true in -X option and fix changelog
From: @openeuler-sync-bot 
Reviewed-by: @licihua 
Signed-off-by: @licihua
2022-03-22 08:31:36 +00:00
panxiaohe
c18c80dd46 diff3: set flagging to true in -X option and fix changelog
(cherry picked from commit a007efd6eec4836bd9944fab4e433a5437cfde2d)
2022-03-22 15:51:59 +08:00
openeuler-ci-bot
8bdaafd595 !11 update version to 3.8
Merge pull request !11 from 邹林/openEuler-22.03-LTS-Next
2021-12-16 01:53:42 +00:00
zou_lin77
83716cb5cf update version to 3.8 2021-11-30 16:22:17 +08:00
openeuler-ci-bot
cb5fc90178 !10 Fix error: missing binary operator before token "("
From: @jlwwlsqc
Reviewed-by: @hanxinke
Signed-off-by: @hanxinke
2021-08-11 08:10:00 +00:00
jlwwlsqc
b6ea60275d Fix error:missing binary operator befor token "(" 2021-08-11 11:13:34 +08:00
openeuler-ci-bot
6089fda02c !7 add -fsign-char for aarch64 for test-localeconv
From: @zou_lin77
Reviewed-by: @overweight
Signed-off-by: @overweight
2021-03-25 15:26:58 +08:00
zou_lin77
686f8758f2 add -fsign-char for aarch64 for test-localeconv 2021-03-24 16:32:30 +08:00
6 changed files with 114 additions and 11 deletions

View 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

Binary file not shown.

View File

@ -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

View File

@ -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

View 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.
Dont 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