mingw: handle absolute paths in expand_user_path()

On Windows, an absolute POSIX path needs to be turned into a Windows
one.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2015-12-11 06:59:13 +01:00
Родитель 0fc7a44145
Коммит b8ea86f99c
1 изменённых файлов: 5 добавлений и 0 удалений

5
path.c
Просмотреть файл

@ -11,6 +11,7 @@
#include "path.h"
#include "packfile.h"
#include "object-store.h"
#include "exec-cmd.h"
static int get_st_mode_bits(const char *path, int *mode)
{
@ -714,6 +715,10 @@ char *expand_user_path(const char *path, int real_home)
if (path == NULL)
goto return_null;
#ifdef __MINGW32__
if (path[0] == '/')
return system_path(path + 1);
#endif
if (path[0] == '~') {
const char *first_slash = strchrnul(path, '/');
const char *username = path + 1;