Fix executing tools without toolName defined
This commit is contained in:
@@ -90,17 +90,18 @@ void addRadioScriptTool(uint8_t index, const char * path)
|
|||||||
{
|
{
|
||||||
char toolName[TOOL_NAME_MAXLEN + 1];
|
char toolName[TOOL_NAME_MAXLEN + 1];
|
||||||
const char * label;
|
const char * label;
|
||||||
|
char * ext = (char *)getFileExtension(path);
|
||||||
if (readToolName(path, toolName)) {
|
if (readToolName(path, toolName)) {
|
||||||
label = toolName;
|
label = toolName;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char * ext = (char *)getFileExtension(path);
|
|
||||||
*ext = '\0';
|
*ext = '\0';
|
||||||
label = getBasename(path);
|
label = getBasename(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addRadioTool(index, label)) {
|
if (addRadioTool(index, label)) {
|
||||||
f_chdir("/SCRIPTS/TOOLS/");
|
f_chdir("/SCRIPTS/TOOLS/");
|
||||||
|
*ext = '.';
|
||||||
luaExec(path);
|
luaExec(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user