From 9c6f9b24f98a19a17eaaa29f0dc47510446d6c01 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sat, 26 May 2018 14:43:42 +0200 Subject: [PATCH] Quote apk path on Windows Windows will parse the string, so the local name must be quoted. --- app/src/command.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/command.c b/app/src/command.c index f40ff359..b7ea67d2 100644 --- a/app/src/command.c +++ b/app/src/command.c @@ -73,6 +73,16 @@ process_t adb_push(const char *serial, const char *local, const char *remote) { } process_t adb_install(const char *serial, const char *local) { +#ifdef __WINDOWS__ + // Windows will parse the string, so the local name must be quoted (see sys/win/command.c) + size_t len = strlen(local); + char quoted[len + 3]; + memcpy("ed[1], local, len); + quoted[0] = '"'; + quoted[len + 1] = '"'; + quoted[len + 2] = '\0'; + local = quoted; +#endif const char *const adb_cmd[] = {"install", "-r", local}; return adb_execute(serial, adb_cmd, ARRAY_LEN(adb_cmd)); }