diff options
Diffstat (limited to 'deskutils/gnome-utils/files/patch-07_fix_dict_crash_CVS')
-rw-r--r-- | deskutils/gnome-utils/files/patch-07_fix_dict_crash_CVS | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/deskutils/gnome-utils/files/patch-07_fix_dict_crash_CVS b/deskutils/gnome-utils/files/patch-07_fix_dict_crash_CVS deleted file mode 100644 index 2fbe372c3db1..000000000000 --- a/deskutils/gnome-utils/files/patch-07_fix_dict_crash_CVS +++ /dev/null @@ -1,97 +0,0 @@ -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; |