commit:     4f711540c27f1406ce8cd76dbc02ba14d5abda22
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 22 12:08:28 2024 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Dec 22 12:08:28 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4f711540

sci-chemistry/gnome-chemistry-utils: Fix invalid pointer types

Closes: https://bugs.gentoo.org/946731
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 .../gnome-chemistry-utils-fix_pointer_types.patch  | 30 ++++++++++++++++++++++
 .../gnome-chemistry-utils-0.14.17_p6-r2.ebuild     |  3 +++
 2 files changed, 33 insertions(+)

diff --git 
a/sci-chemistry/gnome-chemistry-utils/files/gnome-chemistry-utils-fix_pointer_types.patch
 
b/sci-chemistry/gnome-chemistry-utils/files/gnome-chemistry-utils-fix_pointer_types.patch
new file mode 100644
index 000000000000..256a008b9f7d
--- /dev/null
+++ 
b/sci-chemistry/gnome-chemistry-utils/files/gnome-chemistry-utils-fix_pointer_types.patch
@@ -0,0 +1,30 @@
+diff -Naur gnome-chemistry-utils-0.14.17_orig/libs/gccv/text.cc 
gnome-chemistry-utils-0.14.17_mod/libs/gccv/text.cc
+--- gnome-chemistry-utils-0.14.17_orig/libs/gccv/text.cc       2017-02-12 
10:10:09.000000000 +0100
++++ gnome-chemistry-utils-0.14.17_mod/libs/gccv/text.cc        2024-09-02 
22:58:57.724923903 +0200
+@@ -1126,7 +1126,7 @@
+               if (event->state & GDK_CONTROL_MASK) {
+                       /* move to end of word */
+                       char const* s = m_Text.c_str ();
+-                      char *p = g_utf8_next_char (s + m_CurPos);
++                      char const* p = g_utf8_next_char (s + m_CurPos);
+                       while (*p && (!g_unichar_isgraph (g_utf8_get_char(p)) 
|| g_unichar_ispunct (g_utf8_get_char(p))))
+                               p = g_utf8_next_char (p);
+                       while (g_unichar_isgraph (g_utf8_get_char(p)) && 
!g_unichar_ispunct (g_utf8_get_char(p)))
+@@ -1137,7 +1137,7 @@
+                       Invalidate ();
+               } else {
+                       char const* s = m_Text.c_str ();
+-                      char *p = g_utf8_next_char (s + m_CurPos);
++                      char const* p = g_utf8_next_char (s + m_CurPos);
+                       if (!p)
+                               break;
+                       m_CurPos = p - s;
+@@ -1224,7 +1224,7 @@
+               if (m_CurPos == m_Text.length ())
+                       break;
+               char const* s = m_Text.c_str ();
+-              char *p = g_utf8_next_char (s + m_CurPos);
++              char const* p = g_utf8_next_char (s + m_CurPos);
+               int new_pos = p - s;
+               ReplaceText (empty_st, m_CurPos, new_pos - m_CurPos);
+               if (client)

diff --git 
a/sci-chemistry/gnome-chemistry-utils/gnome-chemistry-utils-0.14.17_p6-r2.ebuild
 
b/sci-chemistry/gnome-chemistry-utils/gnome-chemistry-utils-0.14.17_p6-r2.ebuild
index 33d0e163eb2a..1257bd4f0ba0 100644
--- 
a/sci-chemistry/gnome-chemistry-utils/gnome-chemistry-utils-0.14.17_p6-r2.ebuild
+++ 
b/sci-chemistry/gnome-chemistry-utils/gnome-chemistry-utils-0.14.17_p6-r2.ebuild
@@ -52,6 +52,9 @@ src_prepare() {
                eapply -p1 "${WORKDIR}/debian/patches/${p}"
        done
 
+       # From Fedora
+       eapply "${FILESDIR}"/${PN}-fix_pointer_types.patch
+
        eautoreconf
 }
 

Reply via email to