summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-10-24 21:24:36 +0200
committerwm4 <wm4@nowhere>2013-11-02 19:01:42 +0100
commitea17adcd6609a6a6854f486952f20c0dfd1aab0c (patch)
treef013701c276e8c36b4da8a0a3b20c961bb9fc71d /osdep
parent31cdb9647461b7c5f1d73ae0befa94710688523c (diff)
downloadmpv-ea17adcd6609a6a6854f486952f20c0dfd1aab0c.tar.bz2
mpv-ea17adcd6609a6a6854f486952f20c0dfd1aab0c.tar.xz
cocoa: fix opening quarantined files on 10.9 with the bundle
It looks like on Mavericks the Finder is passing different arguments to mpv depending on whether the opened file is quarantined or not. Fixes #285
Diffstat (limited to 'osdep')
-rw-r--r--osdep/macosx_application.m9
1 files changed, 7 insertions, 2 deletions
diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m
index 50d5a5bb4f..f2ec87a55a 100644
--- a/osdep/macosx_application.m
+++ b/osdep/macosx_application.m
@@ -463,10 +463,15 @@ static bool bundle_started_from_finder(int argc, char **argv)
bool bundle_detected = [[NSBundle mainBundle] bundleIdentifier];
int major, minor, bugfix;
get_system_version(&major, &minor, &bugfix);
+ bool with_psn = bundle_detected && argc==1;
+ bool without_psn = bundle_detected && argc==2 && is_psn_argument(argv[1]);
+
if ((major == 10) && (minor >= 9)) {
- return bundle_detected && argc==1;
+ // Looks like opening quarantined files from the finder inserts the
+ // -psn argument while normal files do not. Hurr.
+ return with_psn || without_psn;
} else {
- return bundle_detected && argc==2 && is_psn_argument(argv[1]);
+ return with_psn;
}
}