summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2008-12-16 19:39:34 +0000
committerPeter Volkov <pva@gentoo.org>2008-12-16 19:39:34 +0000
commit0714b6d7449ab0d8713f8ddfcdb57406831209cb (patch)
treef8ffc6830a6635553ce1fd721a642073f75e6f48 /app-text/sdcv/files
parentInitial import. (diff)
downloadhistorical-0714b6d7449ab0d8713f8ddfcdb57406831209cb.tar.gz
historical-0714b6d7449ab0d8713f8ddfcdb57406831209cb.tar.bz2
historical-0714b6d7449ab0d8713f8ddfcdb57406831209cb.zip
Initial import, bug #118359, thank Qiangning Hong and Andrew Savchenko for initial ebuild.
Package-Manager: portage-2.2_rc17/cvs/Linux 2.6.26-openvz.git-89451f9 i686
Diffstat (limited to 'app-text/sdcv/files')
-rw-r--r--app-text/sdcv/files/sdcv-0.4.2-crash.patch27
-rw-r--r--app-text/sdcv/files/sdcv-0.4.2-g-handling.patch21
-rw-r--r--app-text/sdcv/files/sdcv-0.4.2-missing-headers.patch42
-rw-r--r--app-text/sdcv/files/sdcv-0.4.2-respect-HOME.patch17
4 files changed, 107 insertions, 0 deletions
diff --git a/app-text/sdcv/files/sdcv-0.4.2-crash.patch b/app-text/sdcv/files/sdcv-0.4.2-crash.patch
new file mode 100644
index 000000000000..264cffcf1fca
--- /dev/null
+++ b/app-text/sdcv/files/sdcv-0.4.2-crash.patch
@@ -0,0 +1,27 @@
+Fix unalligned access to buffer.
+
+On several architectures (arm, armel, sparc and ia64), unalligned access to
+integers is not allowed. Buffer in this function is not alligned at all and
+attempt to read integer from it causes crash of application on such
+architectures.
+
+Reported upstream at:
+https://sourceforge.net/tracker/index.php?func=detail&aid=2149388&group_id=122858&atid=694730
+--- a/src/lib/lib.cpp
++++ b/src/lib/lib.cpp
+@@ -496,9 +496,13 @@
+ entries[i].keystr=p;
+ len=strlen(p);
+ p+=len+1;
+- entries[i].off=g_ntohl(*reinterpret_cast<guint32 *>(p));
++ /*
++ * Can not use typecasting here, because *data does not have
++ * to be alligned and unalligned access fails on some architectures.
++ */
++ entries[i].off=((unsigned char)p[0] << 24) | ((unsigned char)p[1] << 16) | ((unsigned char)p[2] << 8) | (unsigned char)p[3];
+ p+=sizeof(guint32);
+- entries[i].size=g_ntohl(*reinterpret_cast<guint32 *>(p));
++ entries[i].size=((unsigned char)p[0] << 24) | ((unsigned char)p[1] << 16) | ((unsigned char)p[2] << 8) | (unsigned char)p[3];
+ p+=sizeof(guint32);
+ }
+ }
diff --git a/app-text/sdcv/files/sdcv-0.4.2-g-handling.patch b/app-text/sdcv/files/sdcv-0.4.2-g-handling.patch
new file mode 100644
index 000000000000..72fb690358ed
--- /dev/null
+++ b/app-text/sdcv/files/sdcv-0.4.2-g-handling.patch
@@ -0,0 +1,21 @@
+https://sourceforge.net/tracker/index.php?func=detail&aid=2125962&group_id=122858&atid=694730
+
+Fixes displaying of 'g' (gtk markup) entries.
+--- a/src/libwrapper.cpp
++++ b/src/libwrapper.cpp
+@@ -118,7 +118,6 @@
+ switch (*p++) {
+ case 'm':
+ case 'l': //need more work...
+- case 'g':
+ sec_size = strlen(p);
+ if (sec_size) {
+ res+="\n";
+@@ -128,6 +127,7 @@
+ }
+ sec_size++;
+ break;
++ case 'g':
+ case 'x':
+ sec_size = strlen(p);
+ if (sec_size) {
diff --git a/app-text/sdcv/files/sdcv-0.4.2-missing-headers.patch b/app-text/sdcv/files/sdcv-0.4.2-missing-headers.patch
new file mode 100644
index 000000000000..2011e2637e1e
--- /dev/null
+++ b/app-text/sdcv/files/sdcv-0.4.2-missing-headers.patch
@@ -0,0 +1,42 @@
+Fixes compilation with recent GCC which is more strict about C++.
+--- a/src/readline.cpp
++++ b/src/readline.cpp
+@@ -23,6 +23,7 @@
+ #endif
+
+ #include <cstdio>
++#include <cstdlib>
+ #ifdef WITH_READLINE
+ # include <readline/readline.h>
+ # include <readline/history.h>
+--- a/src/libwrapper.cpp
++++ b/src/libwrapper.cpp
+@@ -24,6 +24,7 @@
+
+ #include <glib/gi18n.h>
+ #include <map>
++#include <cstring>
+
+ #include "utils.hpp"
+
+--- a/src/utils.cpp
++++ b/src/utils.cpp
+@@ -22,6 +22,7 @@
+ # include "config.h"
+ #endif
+
++#include <cstdlib>
+ #include <glib.h>
+ #include <glib/gi18n.h>
+
+--- a/src/lib/lib.cpp
++++ b/src/lib/lib.cpp
+@@ -513,7 +513,7 @@
+ {
+ fseek(idxfile, wordoffset[page_idx], SEEK_SET);
+ guint32 page_size=wordoffset[page_idx+1]-wordoffset[page_idx];
+- fread(wordentry_buf, std::min(sizeof(wordentry_buf), page_size), 1, idxfile); //TODO: check returned values, deal with word entry that strlen>255.
++ fread(wordentry_buf, std::min(sizeof(wordentry_buf), (size_t)page_size), 1, idxfile); //TODO: check returned values, deal with word entry that strlen>255.
+ return wordentry_buf;
+ }
+
diff --git a/app-text/sdcv/files/sdcv-0.4.2-respect-HOME.patch b/app-text/sdcv/files/sdcv-0.4.2-respect-HOME.patch
new file mode 100644
index 000000000000..5b616500c6ce
--- /dev/null
+++ b/app-text/sdcv/files/sdcv-0.4.2-respect-HOME.patch
@@ -0,0 +1,17 @@
+=== modified file 'src/sdcv.cpp'
+--- src/sdcv.cpp 2008-11-18 12:43:28 +0000
++++ src/sdcv.cpp 2008-11-18 12:43:41 +0000
+@@ -161,7 +161,11 @@
+
+ strlist_t dicts_dir_list;
+
+- dicts_dir_list.push_back(std::string(g_get_home_dir())+G_DIR_SEPARATOR+
++ const char *homedir = g_getenv ("HOME");
++ if (!homedir)
++ homedir = g_get_home_dir ();
++
++ dicts_dir_list.push_back(std::string(homedir)+G_DIR_SEPARATOR+
+ ".stardict"+G_DIR_SEPARATOR+"dic");
+ dicts_dir_list.push_back(data_dir);
+
+