Fixes #3024: Companion 2.1 (windows) - Lua 'execute' fails in non-root directory (ported from master, re #3025)
This commit is contained in:
committed by
Damjan Adamic
parent
a1bb31b521
commit
ee95c973e9
@@ -720,7 +720,7 @@ FATFS g_FATFS_Obj;
|
|||||||
char * convertSimuPath(const char *path)
|
char * convertSimuPath(const char *path)
|
||||||
{
|
{
|
||||||
static char result[1024];
|
static char result[1024];
|
||||||
if (path[0] == '/' && strcmp(simuSdDirectory, "/") != 0)
|
if (((path[0] == '/') || (path[0] == '\\')) && (strcmp(simuSdDirectory, "/") != 0))
|
||||||
sprintf(result, "%s%s", simuSdDirectory, path);
|
sprintf(result, "%s%s", simuSdDirectory, path);
|
||||||
else
|
else
|
||||||
strcpy(result, path);
|
strcpy(result, path);
|
||||||
@@ -1044,6 +1044,7 @@ FRESULT f_getcwd (TCHAR *path, UINT sz_path)
|
|||||||
|
|
||||||
// remove simuSdDirectory from the cwd
|
// remove simuSdDirectory from the cwd
|
||||||
strcpy(path, cwd + strlen(simuSdDirectory));
|
strcpy(path, cwd + strlen(simuSdDirectory));
|
||||||
|
|
||||||
TRACE("f_getcwd() = %s", path);
|
TRACE("f_getcwd() = %s", path);
|
||||||
return FR_OK;
|
return FR_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user