From 23afce0d3714e5599462cb2ed5326343973a148e Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Mon, 6 Oct 2014 22:40:43 +0200 Subject: [PATCH] handle no --args When no --args are passed application was started with {args} as argument instead of no argument. --- ios-deploy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios-deploy.c b/ios-deploy.c index 75b083a..fb1f181 100644 --- a/ios-deploy.c +++ b/ios-deploy.c @@ -644,12 +644,12 @@ void write_lldb_prep_cmds(AMDeviceRef device, CFURLRef disk_app_url) { if (args) { CFStringRef cf_args = CFStringCreateWithCString(NULL, args, kCFStringEncodingASCII); CFStringFindAndReplace(cmds, CFSTR("{args}"), cf_args, range, 0); - rangeLLDB.length = CFStringGetLength(pmodule); CFStringFindAndReplace(pmodule, CFSTR("{args}"), cf_args, rangeLLDB, 0); CFRelease(cf_args); } else { - CFStringFindAndReplace(cmds, CFSTR(" {args}"), CFSTR(""), range, 0); + CFStringFindAndReplace(cmds, CFSTR("{args}"), CFSTR(""), range, 0); + CFStringFindAndReplace(pmodule, CFSTR("{args}"), CFSTR(""), rangeLLDB, 0); } range.length = CFStringGetLength(cmds);