Skip to content
Snippets Groups Projects
Commit 639781e2 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Don't use global menu_dir for calls to menu() with path starting with '.'

For scripts that set the global menu_dir (e.g. via JS bbs.menu_dir), let's
not require that all the files moved from text to text/menu (for example).

Problem reported by Amessyroom when using his custom shell and bullseye.js.
parent 27ac3302
No related branches found
No related tags found
No related merge requests found
Pipeline #6814 passed
......@@ -317,8 +317,12 @@ bool sbbs_t::menu_exists(const char *code, const char* ext, char* path)
if(isfullpath(code))
SAFECOPY(prefix, code);
else {
backslash(menu_dir);
SAFEPRINTF3(prefix, "%smenu/%s%s", cfg.text_dir, menu_dir, code);
char subdir[MAX_PATH + 1];
SAFECOPY(subdir, menu_dir);
backslash(subdir);
if(*code == '.')
*subdir = '\0';
SAFEPRINTF3(prefix, "%smenu/%s%s", cfg.text_dir, subdir, code);
FULLPATH(path, prefix, MAX_PATH);
SAFECOPY(prefix, path);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment