]> git.saurik.com Git - cydia.git/commitdiff
Use ProcessArguments to get argv[0] (for iOS 3.0).
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 2 Jul 2015 21:35:49 +0000 (14:35 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 2 Jul 2015 21:35:49 +0000 (14:35 -0700)
cydo.cpp

index 0347c5b98026ebbdbe9c144ab4186039c64fd456..89b4323f5d8505aaefb2198af2239ceae987163b 100644 (file)
--- a/cydo.cpp
+++ b/cydo.cpp
@@ -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)