Quote apk path on Windows
Windows will parse the string, so the local name must be quoted.
This commit is contained in:
parent
e2a2973990
commit
9c6f9b24f9
1 changed files with 10 additions and 0 deletions
|
@ -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) {
|
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};
|
const char *const adb_cmd[] = {"install", "-r", local};
|
||||||
return adb_execute(serial, adb_cmd, ARRAY_LEN(adb_cmd));
|
return adb_execute(serial, adb_cmd, ARRAY_LEN(adb_cmd));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue