Skip to content

Commit

Permalink
fix menu item placement in load_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
yongchaofan authored Aug 12, 2020
1 parent 6ef3ec4 commit 399b954
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/tiny2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,6 @@ void load_dict()
}
}
if ( fp!=NULL ) {
int iScript=pMenuBar->find_index("Script");
char line[256];
while ( fgets(line, 256, fp)!=NULL ) {
line[strcspn(line, "\r\n")] = 0;
Expand Down Expand Up @@ -782,12 +781,14 @@ void load_dict()
strncmp(line+1, "telnet ",7)==0 ||
strncmp(line+1, "serial ",7)==0 ||
strncmp(line+1, "netconf ",8)==0 ) {
pMenuBar->insert(iScript-1,line+1,0,menu_host_cb);
pMenuBar->insert(pMenuBar->find_index("Script")-1,
line+1, 0, menu_host_cb);
pHostname->add(strchr(line+1, ' ')+1);
}
else if (strncmp(line+1, "script ", 7)==0 ) {
pMenuBar->insert(iScript+3, fl_filename_name(line+8),
0, script_cb, strdup(line+8));
pMenuBar->insert(pMenuBar->find_index("Options")-1,
fl_filename_name(line+8), 0,
script_cb, strdup(line+8));
}
else if ( strncmp(line+1, "Boot ", 5)==0 ) {
script_open(line+6);
Expand Down

0 comments on commit 399b954

Please sign in to comment.