init: find template directory on Windows (msys)

The template directory must be searched for using the full Windows path.
But internally a Unix path starting with '/' is used.

The internal Unix path is now prefixed with git_install_prefix() before
accessing the file system Only absolute Unix paths are converted. Relative
paths can be used as is.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
This commit is contained in:
Steffen Prohaska
2007-10-25 19:14:56 +02:00
parent 4d2a9e8f60
commit 0fbe22da39

View File

@@ -145,6 +145,17 @@ static void copy_templates(const char *git_dir, int len, const char *template_di
template_dir = prefix_path(exec_path, strlen(exec_path),
template_dir);
}
#if __MINGW32__
/*
* If it is an absolute Unix path it is prefixed with
* the git_install_prefix().
*/
else if (template_dir[0] == '/') {
const char* prefix = git_install_prefix();
template_dir = prefix_path(prefix, strlen(prefix),
template_dir);
}
#endif
}
strcpy(template_path, template_dir);
template_len = strlen(template_path);