From 9959030765eb21c6ed6b30f3932b10367b9b3900 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Fri, 25 Oct 2013 21:32:49 +0200 Subject: [PATCH] inpcom.c, for mingw absolute pathnames may begin with /d/ allow this when variable 'mingwpath' is set in .spinit --- src/frontend/inpcom.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index db85182f8..6e76a6557 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -982,6 +982,18 @@ inp_pathopen(char *name, char *mode) char buf[BSIZE_SP]; struct variable *v; +#if defined(__MINGW32__) || defined(_MSC_VER) + + /* If variable 'mingwpath' is set: convert mingw /d/... to d:/... */ + if (cp_getvar("mingwpath", CP_BOOL, NULL) && name[0] == DIR_TERM_LINUX && isalpha(name[1]) && name[2] == DIR_TERM_LINUX) { + strcpy(buf, name); + buf[0] = buf[1]; + buf[1] = ':'; + return inp_pathopen(buf, mode); + } + +#endif + /* just try it */ if ((fp = fopen(name, mode)) != NULL) return fp;