static ssize_t gzread_frontend(int nothing, void *buf, size_t s);
static ssize_t gzwrite_frontend(int nothing, const void *buf, size_t s);
static gchar *get_theme_dir();
+static gboolean change_dir(const gchar *dir);
tartype_t funcs = {
(openfunc_t) gzopen_frontend,
return dir;
}
+static gboolean change_dir(const gchar *dir)
+{
+ if (chdir(dest) == -1) {
+ gtk_msg(GTK_MESSAGE_ERROR,
+ _("Unable to move to directory \"%s\": %s"),
+ dest, strerror(errno));
+ return FALSE;
+ }
+ return TRUE;
+}
+
gboolean install_theme(char *path, char *theme)
{
TAR *t;
return FALSE;
curdir = g_get_current_dir();
- if (chdir(dest) == -1) {
- gtk_msg(GTK_MESSAGE_ERROR,
- _("Unable to move to directory \"%s\": %s"),
- dest, strerror(errno));
+ if (!change_dir(dest)) {
g_free(curdir);
return FALSE;
}