adb: fix mkdirs / adb pull with relative paths, fix win32 issues

Relative paths were being prefixed with OS_PATH_SEPARATOR on unix and
win32 causing adb to incorrectly try to make directories at the root.
Plus, absolute paths didn't work on win32 (C: got prefixed into \C:).

This fix is to use dirname (available on win32 via mingw's crt) to do
the messy parsing.

I added a test for the relative path case.

Change-Id: Ibb0a4a8ec7756351d252a4d267122ab18e182858
Signed-off-by: Spencer Low <>
4 files changed