diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-11-02 16:57:18 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-11-02 17:04:37 +0100 |
commit | b36f185426be3ac0bfb942fa4a52528a8d70a61a (patch) | |
tree | aed594826c18582472ab06e3c706ee1712260647 /src | |
parent | 726ecd83ac6da35347be547b42588eb9f3db5070 (diff) | |
download | tdv-b36f185426be3ac0bfb942fa4a52528a8d70a61a.tar.gz tdv-b36f185426be3ac0bfb942fa4a52528a8d70a61a.tar.xz tdv-b36f185426be3ac0bfb942fa4a52528a8d70a61a.zip |
Fix various macOS-related/found issues
Even though this software isn't very useful on that system either,
due to its lack of PRIMARY.
Diffstat (limited to 'src')
-rw-r--r-- | src/sdtui.c | 2 | ||||
-rw-r--r-- | src/stardict.c | 14 |
2 files changed, 7 insertions, 9 deletions
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) { |