MGL: support for absolute paths.

This commit is contained in:
Sorgelig
2023-09-07 23:16:45 +08:00
parent 3bfadb39e8
commit b613044f89

View File

@@ -2383,7 +2383,11 @@ void HandleUI(void)
case MENU_GENERIC_FILE_SELECTED:
{
if (!mgl->done) snprintf(selPath, sizeof(selPath), "%s/%s", HomeDir(), mgl->item[mgl->current].path);
if (!mgl->done)
{
if(mgl->item[mgl->current].path[0] == '/') snprintf(selPath, sizeof(selPath), "%s", mgl->item[mgl->current].path);
else snprintf(selPath, sizeof(selPath), "%s/%s", HomeDir(), mgl->item[mgl->current].path);
}
MenuHide();
printf("File selected: %s\n", selPath);
@@ -2434,7 +2438,11 @@ void HandleUI(void)
case MENU_GENERIC_IMAGE_SELECTED:
{
if (!mgl->done) snprintf(selPath, sizeof(selPath), "%s/%s", HomeDir(((is_pce() && !strncasecmp(fs_pFileExt, "CUE", 3)) ? PCECD_DIR : NULL)), mgl->item[mgl->current].path);
if (!mgl->done)
{
if (mgl->item[mgl->current].path[0] == '/') snprintf(selPath, sizeof(selPath), "%s", mgl->item[mgl->current].path);
else snprintf(selPath, sizeof(selPath), "%s/%s", HomeDir(((is_pce() && !strncasecmp(fs_pFileExt, "CUE", 3)) ? PCECD_DIR : NULL)), mgl->item[mgl->current].path);
}
if (store_name)
{