inpcom.c, for mingw absolute pathnames may begin with /d/

allow this when variable 'mingwpath' is set in .spinit
This commit is contained in:
h_vogt 2013-10-25 21:32:49 +02:00 committed by rlar
parent 85ddc5b6db
commit 9959030765
1 changed files with 12 additions and 0 deletions

View File

@ -982,6 +982,18 @@ inp_pathopen(char *name, char *mode)
char buf[BSIZE_SP]; char buf[BSIZE_SP];
struct variable *v; 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 */ /* just try it */
if ((fp = fopen(name, mode)) != NULL) if ((fp = fopen(name, mode)) != NULL)
return fp; return fp;