#include <gtk/gtkcontainer.h>
#include <gtk/gtkbutton.h>
#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#ifndef HAVE_APACHE_FNMATCH
/* kludge: apache's fnmatch clashes with <regex.h>, don't include
}
static void check_signature_cb(GtkWidget *widget, gpointer user_data);
-void mimeview_check_signature(MimeView *mimeview);
+static void mimeview_check_signature(MimeView *mimeview);
static void display_full_info_cb(GtkWidget *widget, gpointer user_data);
static void update_signature_noticeview(MimeView *mimeview, MimeInfo *mimeinfo,
}
}
-void mimeview_check_signature(MimeView *mimeview)
+static void mimeview_check_signature(MimeView *mimeview)
{
check_signature_cb(NULL, mimeview);
}
_("Enter the command line to open file:\n"
"('%s' will be replaced with file name)"),
mime_command ? mime_command : prefs_common.mime_open_cmd,
- prefs_common.mime_open_cmd_history,
- TRUE, &remember);
+ prefs_common.mime_open_cmd_history, &remember);
else
cmd = input_dialog_combo
(_("Open with"),
_("Enter the command line to open file:\n"
"('%s' will be replaced with file name)"),
mime_command ? mime_command : prefs_common.mime_open_cmd,
- prefs_common.mime_open_cmd_history,
- TRUE);
+ prefs_common.mime_open_cmd_history);
if (cmd && remember) {
mailcap_update_default(content_type, cmd);
}
mimeview_open_part_with(mimeview, partinfo, TRUE);
else {
if ((p = strchr(cmd, '%')) && *(p + 1) == 's' &&
- !strchr(p + 2, '%'))
+ !strchr(p + 2, '%')) {
g_snprintf(buf, sizeof(buf), cmd, filename);
- else {
+ if (!prefs_common.save_parts_readwrite)
+ g_chmod(filename, S_IRUSR);
+ else
+ g_chmod(filename, S_IRUSR|S_IWUSR);
+ } else {
g_warning("MIME viewer command line is invalid: '%s'", cmd);
mimeview_open_part_with(mimeview, partinfo, FALSE);
}
- if (execute_command_line(buf, TRUE) != 0)
+ if (execute_command_line(buf, TRUE) != 0) {
+ if (!prefs_common.save_parts_readwrite)
+ g_chmod(filename, S_IRUSR|S_IWUSR);
mimeview_open_part_with(mimeview, partinfo, FALSE);
+ }
}
}