Hide protected functions from other modules

This is done in order to avoid symbol collisions with libsolv library,
namely the map_* symbols collide.
Resolves: rhbz#1201897
This commit is contained in:
Boris Ranto 2015-03-25 21:57:32 +01:00
parent f946f30845
commit ead47067ec
4 changed files with 66 additions and 20 deletions

View File

@ -0,0 +1,30 @@
From 8c0f52589d106e5ac32d7868d7b51d3dfab6c0a5 Mon Sep 17 00:00:00 2001
From: Boris Ranto <branto@redhat.com>
Date: Wed, 25 Mar 2015 17:33:00 +0100
Subject: [PATCH] Ignore non-ASCII characters only if charset is not UTF-8
---
src/eln.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/eln.c b/src/eln.c
index 5bcfb4f..6023891 100644
--- a/src/eln.c
+++ b/src/eln.c
@@ -76,9 +76,11 @@ el_gets(EditLine *el, int *nread)
{
const wchar_t *tmp;
- el->el_flags |= IGNORE_EXTCHARS;
+ if (!(el->el_flags & CHARSET_IS_UTF8))
+ el->el_flags |= IGNORE_EXTCHARS;
tmp = el_wgets(el, nread);
- el->el_flags &= ~IGNORE_EXTCHARS;
+ if (!(el->el_flags & CHARSET_IS_UTF8))
+ el->el_flags &= ~IGNORE_EXTCHARS;
return ct_encode_string(tmp, &el->el_lgcyconv);
}
--
2.1.0

View File

@ -0,0 +1,27 @@
From 9ac358bf7fe9a6c322edc1fc85a5d288c5f8f92d Mon Sep 17 00:00:00 2001
From: Boris Ranto <branto@redhat.com>
Date: Wed, 25 Mar 2015 21:37:07 +0100
Subject: [PATCH] Hide protected symbols from other modules
---
src/sys.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/sys.h b/src/sys.h
index 25b14bb..f039532 100644
--- a/src/sys.h
+++ b/src/sys.h
@@ -71,8 +71,8 @@
#endif
#ifndef protected
-# define protected /* Redefined from elsewhere to "static" */
- /* When we want to hide everything */
+# define protected __attribute__ ((visibility ("hidden")))
+ /* hide protected symbols from other modules */
#endif
#ifndef __arraycount
--
2.1.0

View File

@ -1,17 +0,0 @@
diff -rup libedit-20141029-3.1-bak/src/eln.c libedit-20141029-3.1/src/eln.c
--- libedit-20141029-3.1-bak/src/eln.c 2015-03-14 09:19:41.804370242 +0100
+++ libedit-20141029-3.1/src/eln.c 2015-03-15 08:58:36.182162570 +0100
@@ -76,9 +76,11 @@ el_gets(EditLine *el, int *nread)
{
const wchar_t *tmp;
- el->el_flags |= IGNORE_EXTCHARS;
+ if (!(el->el_flags & CHARSET_IS_UTF8))
+ el->el_flags |= IGNORE_EXTCHARS;
tmp = el_wgets(el, nread);
- el->el_flags &= ~IGNORE_EXTCHARS;
+ if (!(el->el_flags & CHARSET_IS_UTF8))
+ el->el_flags &= ~IGNORE_EXTCHARS;
return ct_encode_string(tmp, &el->el_lgcyconv);
}

View File

@ -4,12 +4,13 @@
Summary: The NetBSD Editline library
Name: libedit
Version: 3.1
Release: 10.%{snap}cvs%{?dist}
Release: 11.%{snap}cvs%{?dist}
License: BSD
Group: System Environment/Libraries
URL: http://www.thrysoee.dk/editline/
Source0: http://www.thrysoee.dk/editline/%{name}-%{snap}-%{version}.tar.gz
Patch0: libedit-wchar.patch
Patch1: 0001-Ignore-non-ASCII-characters-only-if-charset-is-not-U.patch
Patch2: 0002-Hide-protected-symbols-from-other-modules.patch
BuildRequires: ncurses-devel
%description
@ -30,7 +31,8 @@ This package contains development files for %{name}.
%prep
%setup -q -n %{name}-%{dir_snap}-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
# Suppress rpmlint error.
iconv -f ISO8859-1 -t UTF-8 -o ChangeLog.utf-8 ChangeLog
@ -71,6 +73,10 @@ find $RPM_BUILD_ROOT -type f -name "*.la" -delete
%{_includedir}/editline/readline.h
%changelog
* Wed Mar 25 2015 Boris Ranto <branto@redhat.com> - 3.1-11.20141030cvs
- change the format of patches
- hide protected functions from other modules
* Wed Mar 18 2015 Boris Ranto <branto@redhat.com> - 3.1-10.20141030cvs
- ignore external characters in input only if not utf8