diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2015-07-02 14:35:49 -0700 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2015-07-02 14:35:49 -0700 |
commit | ca0a920d902e70044e20bbd4efd993e5d63789e7 (patch) | |
tree | 2fa5842ce7f8f809ac5b7106fac21f7f662a0719 | |
parent | 91e48f51ab815945273b2e7c38190d92c2f25718 (diff) |
Use ProcessArguments to get argv[0] (for iOS 3.0).
-rw-r--r-- | cydo.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -48,8 +48,17 @@ int main(int argc, char *argv[]) { return; auto string(launch_data_dict_lookup(value, LAUNCH_JOBKEY_PROGRAM)); - if (string == NULL || launch_data_get_type(string) != LAUNCH_DATA_STRING) - return; + if (string == NULL || launch_data_get_type(string) != LAUNCH_DATA_STRING) { + auto array(launch_data_dict_lookup(value, LAUNCH_JOBKEY_PROGRAMARGUMENTS)); + if (array == NULL || launch_data_get_type(array) != LAUNCH_DATA_ARRAY) + return; + if (launch_data_array_get_count(array) == 0) + return; + + string = launch_data_array_get_index(array, 0); + if (string == NULL || launch_data_get_type(string) != LAUNCH_DATA_STRING) + return; + } auto program(launch_data_get_string(string)); if (program == NULL) |