Fix executing tools without toolName defined

This commit is contained in:
Kilrah
2019-07-14 10:07:04 +02:00
parent 4f180b157c
commit 99b460f9ba
+2 -1
View File
@@ -90,17 +90,18 @@ void addRadioScriptTool(uint8_t index, const char * path)
{
char toolName[TOOL_NAME_MAXLEN + 1];
const char * label;
char * ext = (char *)getFileExtension(path);
if (readToolName(path, toolName)) {
label = toolName;
}
else {
char * ext = (char *)getFileExtension(path);
*ext = '\0';
label = getBasename(path);
}
if (addRadioTool(index, label)) {
f_chdir("/SCRIPTS/TOOLS/");
*ext = '.';
luaExec(path);
}
}