From a20dad67289d23f965b4dfad45c32c593c8b7671 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 31 Aug 2020 11:18:52 +0100 Subject: win32: make location of Unix-style absolute paths configurable Previously busybox-w32 was enhanced so certain Unix-style absolute paths of the form '/dir/file' were treated as being relative to the system drive. (Notionally as reported by %SYSTEMDRIVE% but in fact derived from the API call GetSystemDirectory().) Make the location of such files configurable by the BB_SYSTEMROOT environment variable. - BB_SYSTEMROOT should probably only refer to a Windows-style absolute path, but this isn't checked. - Set BB_SYSTEMROOT using the Windows Control Panel or setx, not as a shell variable: the shell itself won't see the environment variable. --- win32/mingw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'win32') diff --git a/win32/mingw.c b/win32/mingw.c index 16e103b54..75f15aa30 100644 --- a/win32/mingw.c +++ b/win32/mingw.c @@ -1661,7 +1661,7 @@ const char *get_system_drive(void) } } - return drive; + return getenv("BB_SYSTEMROOT") ?: drive; } /* Return pointer to system drive if path is of form '/file', else NULL */ -- cgit v1.2.3-55-g6feb