aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt11
-rwxr-xr-xdicts/gnu-fdl-de-cz.sh2
-rw-r--r--src/sdtui.c2
-rw-r--r--src/stardict.c14
4 files changed, 16 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ddd9cfc..1d1199b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,7 +66,6 @@ endif ()
find_package (Termo QUIET NO_MODULE)
option (USE_SYSTEM_TERMO
"Don't compile our own termo library, use the system one" ${Termo_FOUND})
-
if (USE_SYSTEM_TERMO)
if (NOT Termo_FOUND)
message (FATAL_ERROR "System termo library not found")
@@ -88,7 +87,6 @@ endif ()
pkg_check_modules (xcb xcb xcb-xfixes)
option (WITH_X11 "Compile with X11 selection support using XCB" ${xcb_FOUND})
-
if (WITH_X11)
if (NOT xcb_FOUND)
message (FATAL_ERROR "XCB not found")
@@ -100,8 +98,15 @@ endif ()
pkg_check_modules (gtk gtk+-3.0)
option (WITH_GUI "Build an alternative GTK+ UI" ${gtk_FOUND})
+if (WITH_GUI)
+ if (NOT gtk_FOUND)
+ message (FATAL_ERROR "GTK+ not found")
+ endif ()
+
+ link_directories (${gtk_LIBRARY_DIRS})
+endif ()
-link_directories (${dependencies_LIBRARY_DIRS})
+link_directories (${dependencies_LIBRARY_DIRS} ${icu_LIBRARY_DIRS})
include_directories (${ZLIB_INCLUDE_DIRS} ${icu_INCLUDE_DIRS}
${dependencies_INCLUDE_DIRS} ${Ncursesw_INCLUDE_DIRS}
${Termo_INCLUDE_DIRS})
diff --git a/dicts/gnu-fdl-de-cz.sh b/dicts/gnu-fdl-de-cz.sh
index ffe56a4..8fab695 100755
--- a/dicts/gnu-fdl-de-cz.sh
+++ b/dicts/gnu-fdl-de-cz.sh
@@ -2,7 +2,7 @@
# GNU/FDL German-Czech dictionary, see https://gnu.nemeckoceskyslovnik.cz
# Sometimes the domain doesn't resolve, and the contents are close to useless
-[ -n "$WANT_BAD_DICTS" ] || exit
+[ -n "$WANT_BAD_DICTS" ] || exit 0
curl -Lo- 'https://gnu.nemeckoceskyslovnik.cz/index.php?id=6&sablona=export&format=zcu' | \
grep -v ^# | sed 's/\\//g' | perl -CSD -F\\t -le '
diff --git a/src/sdtui.c b/src/sdtui.c
index c9b88e6..8de59b2 100644
--- a/src/sdtui.c
+++ b/src/sdtui.c
@@ -37,9 +37,7 @@
#include <termo.h> // input
#include <ncurses.h> // output
#include <termios.h>
-#ifndef TIOCGWINSZ
#include <sys/ioctl.h>
-#endif // ! TIOCGWINSZ
#include "config.h"
#include "stardict.h"
diff --git a/src/stardict.c b/src/stardict.c
index 8b55f99..cdd11a1 100644
--- a/src/stardict.c
+++ b/src/stardict.c
@@ -309,26 +309,24 @@ load_ifo (StardictInfo *sti, const gchar *path, GError **error)
goto error;
}
- ret_val = TRUE;
-
- // FIXME check for zeros, don't assume that 0 means for "not set"
+ // FIXME check for zeros, don't assume that 0 means "not set"
if (!sti->book_name || !*sti->book_name)
{
g_set_error (error, STARDICT_ERROR, STARDICT_ERROR_INVALID_DATA,
"%s: %s", path, _("no book name specified"));
- ret_val = FALSE;
+ goto error;
}
if (!sti->word_count)
{
g_set_error (error, STARDICT_ERROR, STARDICT_ERROR_INVALID_DATA,
"%s: %s", path, _("word count not specified"));
- ret_val = FALSE;
+ goto error;
}
if (!sti->idx_filesize)
{
g_set_error (error, STARDICT_ERROR, STARDICT_ERROR_INVALID_DATA,
"%s: %s", path, _("index file size not specified"));
- ret_val = FALSE;
+ goto error;
}
if (!sti->idx_offset_bits)
@@ -338,9 +336,11 @@ load_ifo (StardictInfo *sti, const gchar *path, GError **error)
g_set_error (error, STARDICT_ERROR, STARDICT_ERROR_INVALID_DATA,
"%s: %s: %lu", path, _("invalid index offset bits"),
sti->idx_offset_bits);
- ret_val = FALSE;
+ goto error;
}
+ ret_val = TRUE;
+
error:
if (!ret_val)
{