summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2020-10-25 13:02:51 +0200
committerTor Lillqvist <tml@collabora.com>2020-10-25 13:12:08 +0100
commit2e619846cfe620826d3d77e4551a9af917cf96d9 (patch)
treece15ce6f260643c7e6879156c1206f5ef4260ed8 /configure.ac
parentd384d6f3c52a909a6e8e444963e954ea49050875 (diff)
Improve the WSL cygpath emulation
Handle also Windows pathnames passed to it in mixed format, and Unix pathnames for Windows files (starting with /mnt/). Change-Id: I07a01b8680a6ed203e9fe44c37822e0490c3f296 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104771 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 13 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 74911610a3e4..10a199c975c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -296,7 +296,11 @@ if test -z "$host" -a -z "$build" -a "`wslsys -v 2>/dev/null`" != ""; then
fi
case "$input" in
- [[a-zA-Z]]:\\* | \\*)
+ /mnt/*)
+ # A Windows file in WSL format
+ input=$(wslpath -w "$input")
+ ;;
+ [[a-zA-Z]]:\\* | \\* | [[a-zA-Z]]:/* | /*)
# Already in Windows format
;;
/*)
@@ -317,7 +321,7 @@ if test -z "$host" -a -z "$build" -a "`wslsys -v 2>/dev/null`" != ""; then
# Print Unix path
case "$input" in
- [[a-zA-Z]]:\\* | \\*)
+ [[a-zA-Z]]:\\* | \\* | [[a-zA-Z]]:/* | /*)
wslpath -u "$input"
;;
/)
@@ -333,17 +337,21 @@ if test -z "$host" -a -z "$build" -a "`wslsys -v 2>/dev/null`" != ""; then
if test -n "$UNITTEST_WSL_CYGPATH"; then
BUILDDIR=.
+ # Nothing special with these file names, just arbitrary ones picked to test with
cygpath -d /usr/lib64/ld-linux-x86-64.so.2
cygpath -w /usr/lib64/ld-linux-x86-64.so.2
cygpath -m /usr/lib64/ld-linux-x86-64.so.2
cygpath -m -s /usr/lib64/ld-linux-x86-64.so.2
- cygpath -d /mnt/c/windows/system32/AboutSettingsHandlers.dll
+ # At least on my machine for instance this file does have an 8.3 name
+ cygpath -d /mnt/c/windows/WindowsUpdate.log
+ # But for instance this one doesn't
cygpath -w /mnt/c/windows/system32/AboutSettingsHandlers.dll
- cygpath -ws /mnt/c/windows/system32/AboutSettingsHandlers.dll
+ cygpath -ws /mnt/c/windows/WindowsUpdate.log
cygpath -m /mnt/c/windows/system32/AboutSettingsHandlers.dll
- cygpath -ms /mnt/c/windows/system32/AboutSettingsHandlers.dll
+ cygpath -ms /mnt/c/windows/WindowsUpdate.log
cygpath -u 'c:\windows\system32\AboutSettingsHandlers.dll'
+ cygpath -u 'c:/windows/system32/AboutSettingsHandlers.dll'
exit 0
fi