Skip to content

Commit 8136d94

Browse files
oreo639fincs
authored andcommitted
Ensure path seperator between dirname and filename
Previously new-hbmenu assumed that dirname always ended with a '/'. This used to be the case with devkitARM, however this is not portable, and on for example, linux the path does not end in a '/'. Recently devkitARM was changed to ensure that the path never ends in '/'. devkitPro/newlib@806a4d3
1 parent ab65a14 commit 8136d94

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

source/menu-list.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ int menuFileAssocScan(const char* target)
138138
continue;
139139

140140
memset(temp, 0, sizeof(temp));
141-
snprintf(temp, sizeof(temp) - 1, "%s%s", s_menuFileAssoc[!s_curMenuFileAssoc].dirname, dp->d_name);
141+
snprintf(temp, sizeof(temp) - 1, "%s/%s", s_menuFileAssoc[!s_curMenuFileAssoc].dirname, dp->d_name);
142142

143143
const char* ext = getExtension(dp->d_name);
144144
if (strcasecmp(ext, ".cfg") != 0)
@@ -188,7 +188,7 @@ int menuScan(const char* target)
188188
if (!me)
189189
continue;
190190

191-
snprintf(me->path, sizeof(me->path), "%s%s", s_menu[!s_curMenu].dirname, dp->d_name);
191+
snprintf(me->path, sizeof(me->path), "%s/%s", s_menu[!s_curMenu].dirname, dp->d_name);
192192
if (menuEntryLoad(me, dp->d_name, shortcut))
193193
menuAddEntry(me);
194194
else

0 commit comments

Comments
 (0)