summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Savchenko <bircoph@gentoo.org>2016-12-05 13:58:02 +0300
committerAndrew Savchenko <bircoph@gentoo.org>2016-12-05 15:06:41 +0300
commitc11676602622fd25323682d41237ddba5433d7d1 (patch)
treee645a67192ba69b0e5a6ea1e12e9d4fe57a1bc14 /app-text/stardict
parentapp-text/stardict: update gtk/glib deps (diff)
downloadgentoo-c11676602622fd25323682d41237ddba5433d7d1.tar.gz
gentoo-c11676602622fd25323682d41237ddba5433d7d1.tar.bz2
gentoo-c11676602622fd25323682d41237ddba5433d7d1.zip
app-text/stardict: fix whitespace handling in tabfile tool
Patch by Nikolay Korotkiy <sikmir@gmail.com>, git commit adb01aafd94b6bd5b5cc49889f4f09d483ee5ac4 from https://github.com/sikmir/stardict-3.git repository. Package-Manager: portage-2.3.2 Signed-off-by: Andrew Savchenko <bircoph@gentoo.org>
Diffstat (limited to 'app-text/stardict')
-rw-r--r--app-text/stardict/files/stardict-4.0.0_pre20160518-tabfile.patch38
-rw-r--r--app-text/stardict/stardict-4.0.0_pre20160518.ebuild2
2 files changed, 40 insertions, 0 deletions
diff --git a/app-text/stardict/files/stardict-4.0.0_pre20160518-tabfile.patch b/app-text/stardict/files/stardict-4.0.0_pre20160518-tabfile.patch
new file mode 100644
index 000000000000..49cb284253af
--- /dev/null
+++ b/app-text/stardict/files/stardict-4.0.0_pre20160518-tabfile.patch
@@ -0,0 +1,38 @@
+From adb01aafd94b6bd5b5cc49889f4f09d483ee5ac4 Mon Sep 17 00:00:00 2001
+From: Nikolay Korotkiy <sikmir@gmail.com>
+Date: Thu, 1 Sep 2016 14:11:41 +0300
+Subject: [PATCH] tabfile: incorrectly handles whitespace in file name
+
+Signed-off-by: Andrew Savchenko <bircoph@gmail.com>
+---
+ tools/src/libtabfile.cpp | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/tools/src/libtabfile.cpp b/tools/src/libtabfile.cpp
+index dda256a..2ee9dfd 100644
+--- a/tools/src/libtabfile.cpp
++++ b/tools/src/libtabfile.cpp
+@@ -22,6 +22,7 @@
+ #include <cstring>
+ #include <cstdlib>
+ #include <string>
++#include <sstream>
+ #include <glib/gstdio.h>
+ #include <glib.h>
+
+@@ -228,9 +229,10 @@ static bool write_dictionary(const char *filename, GArray *array)
+ g_message("%s wordcount: %d.", get_impl(basefilename), array->len);
+
+ #ifndef _WIN32
+- std::string command(std::string("dictzip ") + dicfilename);
++ std::stringstream command;
++ command << "dictzip \"" << dicfilename << "\"";
+ int result;
+- result = system(command.c_str());
++ result = system(command.str().c_str());
+ if (result == -1) {
+ g_print("system() error!\n");
+ }
+--
+2.10.2
+
diff --git a/app-text/stardict/stardict-4.0.0_pre20160518.ebuild b/app-text/stardict/stardict-4.0.0_pre20160518.ebuild
index da192f90a8bc..5a09f9995816 100644
--- a/app-text/stardict/stardict-4.0.0_pre20160518.ebuild
+++ b/app-text/stardict/stardict-4.0.0_pre20160518.ebuild
@@ -69,6 +69,8 @@ REQUIRED_USE="tools? ( python? ( ${PYTHON_REQUIRED_USE} ) )"
# docs are messy, installed manually below
DOCS=""
+PATCHES=( "${FILESDIR}/${P}-tabfile.patch" )
+
src_prepare() {
# From Fedora
# Remove unneeded sigc++ header files to make it sure