aboutsummaryrefslogtreecommitdiff
path: root/src/stardict.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stardict.c')
-rw-r--r--src/stardict.c14
1 files changed, 7 insertions, 7 deletions
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)
{