diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2011-02-25 06:34:07 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2011-02-25 06:34:07 +0000 |
commit | 070e412f18875b74e329d932d65b2917d8d81bd7 (patch) | |
tree | 9a892d712cf507a9bcef1df2a65481020c3b9427 /src/mimeview.c | |
parent | b81cb2016a3fb6bb6f297a057516aac13e5bcf42 (diff) |
use 'open' command on OS X.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2847 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/mimeview.c')
-rw-r--r-- | src/mimeview.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mimeview.c b/src/mimeview.c index 41768d0b..be13eaf5 100644 --- a/src/mimeview.c +++ b/src/mimeview.c @@ -1226,6 +1226,21 @@ static void mimeview_view_file(const gchar *filename, MimeInfo *partinfo, } execute_open_file(filename, partinfo->content_type); return; +#elif defined(__APPLE__) + if (g_file_test(filename, G_FILE_TEST_IS_EXECUTABLE) || + str_has_suffix_case(filename, ".py") || + str_has_suffix_case(filename, ".rb") || + str_has_suffix_case(filename, ".sh")) { + alertpanel_full + (_("Opening executable file"), + _("This is an executable file. Opening executable file is restricted for security.\n" + "If you want to launch it, save it to somewhere and make sure it is not an virus or something like a malicious program."), + ALERT_WARNING, G_ALERTDEFAULT, FALSE, + GTK_STOCK_OK, NULL, NULL); + return; + } + execute_open_file(filename, partinfo->content_type); + return; #else if (MIME_IMAGE == partinfo->mime_type) cmd = prefs_common.mime_image_viewer; |