aboutsummaryrefslogtreecommitdiffstats
path: root/deskutils/gnomeutils2
diff options
context:
space:
mode:
authormezz <mezz@FreeBSD.org>2006-05-23 11:35:46 +0800
committermezz <mezz@FreeBSD.org>2006-05-23 11:35:46 +0800
commit53e8ad5c73ff701d0325d0efc100eacae7039417 (patch)
tree12fe0cc0992db24eb521e398d3425424b8cada65 /deskutils/gnomeutils2
parentf63c075bda6f73ee23e9e296ba5e77cbbe8f14a5 (diff)
downloadfreebsd-ports-gnome-53e8ad5c73ff701d0325d0efc100eacae7039417.tar.gz
freebsd-ports-gnome-53e8ad5c73ff701d0325d0efc100eacae7039417.tar.zst
freebsd-ports-gnome-53e8ad5c73ff701d0325d0efc100eacae7039417.zip
Fix a crash when you type some words like 'enormous' for example. This patch
was took from Ubuntu's gnome-utils_2.14.0-0ubuntu5.diff.gz that was from GNOME CVS. Bump the PORTREVISION. GNOME bugzilla: http://bugzilla.gnome.org/show_bug.cgi?id=330782
Diffstat (limited to 'deskutils/gnomeutils2')
-rw-r--r--deskutils/gnomeutils2/Makefile2
-rw-r--r--deskutils/gnomeutils2/files/patch-07_fix_dict_crash_CVS97
2 files changed, 98 insertions, 1 deletions
diff --git a/deskutils/gnomeutils2/Makefile b/deskutils/gnomeutils2/Makefile
index dd323073e74d..d58281da2f51 100644
--- a/deskutils/gnomeutils2/Makefile
+++ b/deskutils/gnomeutils2/Makefile
@@ -8,7 +8,7 @@
PORTNAME= gnomeutils2
PORTVERSION= 2.14.0
-PORTREVISION= 3
+PORTREVISION= 4
PORTEPOCH= 1
CATEGORIES= deskutils gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
diff --git a/deskutils/gnomeutils2/files/patch-07_fix_dict_crash_CVS b/deskutils/gnomeutils2/files/patch-07_fix_dict_crash_CVS
new file mode 100644
index 000000000000..2fbe372c3db1
--- /dev/null
+++ b/deskutils/gnomeutils2/files/patch-07_fix_dict_crash_CVS
@@ -0,0 +1,97 @@
+diff -urNad gnome-utils-2.14.0~/gnome-dictionary/libgdict/Makefile.am gnome-utils-2.14.0/gnome-dictionary/libgdict/Makefile.am
+--- gnome-dictionary/libgdict/Makefile.am 2006-01-12 04:39:01.000000000 +0100
++++ gnome-dictionary/libgdict/Makefile.am 2006-05-07 12:44:29.000000000 +0200
+@@ -2,6 +2,9 @@
+
+ NULL =
+
++# remove comment to enable debugging
++#GDICT_ENABLE_DEBUG=-DGDICT_ENABLE_DEBUG=1
++
+ INCLUDES = -DG_LOG_DOMAIN=\"Gdict\" \
+ -DDATADIR=\""$(datadir)"\" \
+ -DLIBDIR=\""$(libdir)"\" \
+@@ -10,6 +13,7 @@
+ -DGNOMELOCALEDIR=\""$(gnomeutilslocaledir)"\" \
+ -DGDICTSOURCESDIR=\""$(datadir)/gdict-1.0/sources"\" \
+ -DGDICT_ENABLE_INTERNALS=1 \
++ $(GDICT_ENABLE_DEBUG) \
+ $(DISABLE_DEPRECATED_CFLAGS) \
+ $(WARN_CFLAGS) \
+ $(NULL)
+diff -urNad gnome-utils-2.14.0~/gnome-dictionary/libgdict/gdict-client-context.c gnome-utils-2.14.0/gnome-dictionary/libgdict/gdict-client-context.c
+--- gnome-dictionary/libgdict/gdict-client-context.c 2006-02-11 17:55:02.000000000 +0100
++++ gnome-dictionary/libgdict/gdict-client-context.c 2006-05-07 12:44:47.000000000 +0200
+@@ -1629,10 +1629,11 @@
+
+ /* retrieve the status code from the server response line */
+ static gint
+-get_status_code (const gchar *line)
++get_status_code (const gchar *line,
++ gint old_status)
+ {
+ gchar *status;
+- gint retval;
++ gint possible_status, retval;
+
+ if (strlen (line) < 3)
+ return 0;
+@@ -1641,14 +1642,47 @@
+ !g_unichar_isdigit (line[1]) ||
+ !g_unichar_isdigit (line[2]))
+ return 0;
++
++ if (!g_unichar_isspace (line[3]))
++ return 0;
+
+ status = g_strndup (line, 3);
+- retval = atoi (status);
++ possible_status = atoi (status);
+ g_free (status);
++
++ /* status whitelisting: sometimes, a database *cough* moby-thes *cough*
++ * might return a number as first word; we do a small check here for
++ * invalid status codes based on the previously set status; we don't check
++ * the whole line, as we need only to be sure that the status code is
++ * consistent with what we expect.
++ */
++ switch (old_status)
++ {
++ case GDICT_STATUS_WORD_DB_NAME:
++ if (possible_status == GDICT_STATUS_OK)
++ retval = possible_status;
++ else
++ retval = 0;
++ break;
++ case GDICT_STATUS_N_DEFINITIONS_RETRIEVED:
++ if (possible_status == GDICT_STATUS_WORD_DB_NAME)
++ retval = possible_status;
++ else
++ retval = 0;
++ break;
++ case GDICT_STATUS_N_MATCHES_FOUND:
++ if (possible_status == GDICT_STATUS_OK)
++ retval = possible_status;
++ else
++ retval = 0;
++ break;
++ default:
++ retval = possible_status;
++ break;
++ }
+
+ return retval;
+ }
+-
+
+ static gboolean
+ gdict_client_context_io_watch_cb (GIOChannel *channel,
+@@ -1735,7 +1769,7 @@
+ /* truncate the line terminator before parsing */
+ line[term] = '\0';
+
+- status_code = get_status_code (line);
++ status_code = get_status_code (line, priv->status_code);
+ if ((status_code == 0) || (GDICT_IS_VALID_STATUS_CODE (status_code)))
+ {
+ priv->status_code = status_code;