MSVC: include compat/win32/path-utils.h for MSVC, too, for real_path()
authorSven Strickroth <email@cs-ware.de>
Mon, 8 Apr 2019 11:26:16 +0000 (13:26 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 9 Apr 2019 11:40:07 +0000 (20:40 +0900)
A path such as 'c:/somepath/submodule/../.git/modules/submodule' wasn't
resolved correctly any more, because the *nix variant of offset_1st_component
is used instead of the Win32 specific version.

Regression was introduced in commit 1cadad6f6 when mingw_offset_1st_component
was moved from mingw.c which is included by msvc.c to a separate file. Then,
the new file "compat/win32/path-utils.h" was only included for the __CYGWIN__
and __MINGW32__ cases in git-compat-util.h, the case for _MSC_VER was missing.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
config.mak.uname
git-compat-util.h
index d63f41d6964a95416de344efe22f442d79af7d84..b7b8a716da11f2eaf3c7e3ccdc4c413e7b561edd 100644 (file)
@@ -392,6 +392,7 @@ ifeq ($(uname_S),Windows)
        CFLAGS =
        BASIC_CFLAGS = -nologo -I. -I../zlib -Icompat/vcbuild -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
        COMPAT_OBJS = compat/msvc.o compat/winansi.o \
+               compat/win32/path-utils.o \
                compat/win32/pthread.o compat/win32/syslog.o \
                compat/win32/dirent.o
        COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\"
index 925a8ae72b265ecbf8537ca5a2628490eff7f375..df9cc8cb58ba591274302495f12771c0238d55df 100644 (file)
 #include "compat/win32/path-utils.h"
 #include "compat/mingw.h"
 #elif defined(_MSC_VER)
+#include "compat/win32/path-utils.h"
 #include "compat/msvc.h"
 #else
 #include <sys/utsname.h>