@@ -544,18 +544,19 @@ void MainWindow::editor_plugin(Fl_Widget *w, void *eventData) {
544544 if (editWidget) {
545545 Fl_Text_Editor *editor = editWidget->getEditor ();
546546 char filename[PATH_MAX];
547- char path[PATH_MAX];
548- strcpy (filename, editWidget->getFilename ());
547+ strlcpy (filename, editWidget->getFilename (), PATH_MAX);
549548
550549 if (runMode == edit_state) {
551550 if (editWidget->checkSave (false ) && filename[0 ]) {
551+ char path[PATH_MAX];
552552 int pos = editor->insert_position ();
553553 int row, col, s1r, s1c, s2r, s2c;
554554 editWidget->getRowCol (&row, &col);
555555 editWidget->getSelStartRowCol (&s1r, &s1c);
556556 editWidget->getSelEndRowCol (&s2r, &s2c);
557- snprintf (opt_command, sizeof (opt_command), " %s|%d|%d|%d|%d|%d|%d" ,
558- filename, row - 1 , col, s1r - 1 , s1c, s2r - 1 , s2c);
557+ strlcpy (opt_command, filename, PATH_MAX);
558+ snprintf (path, sizeof (path), " |%d|%d|%d|%d|%d|%d" , row - 1 , col, s1r - 1 , s1c, s2r - 1 , s2c);
559+ strlcat (opt_command, path, PATH_MAX);
559560 runMode = run_state;
560561 editWidget->runState (rs_run);
561562 snprintf (path, sizeof (path), " %s/%s" , packageHome, (const char *)eventData);
@@ -626,17 +627,6 @@ void MainWindow::load_file(Fl_Widget *w, void *eventData) {
626627
627628// --Startup functions-----------------------------------------------------------
628629
629- /* *
630- *Adds a plug-in to the menu
631- */
632- void MainWindow::addPlugin (Fl_Menu_Bar *menu, const char *label, const char *filename) {
633- char path[PATH_MAX];
634- snprintf (path, PATH_MAX, " %s/%s" , pluginHome, filename);
635- if (access (path, R_OK) == 0 ) {
636- menu->add (label, 0 , editor_plugin_cb, strdup (path));
637- }
638- }
639-
640630/* *
641631 * scan for recent files
642632 */
@@ -952,7 +942,6 @@ MainWindow::MainWindow(int w, int h) :
952942 m->add (" &File/_Close Others" , 0 , close_other_tabs_cb);
953943 m->add (" &File/&Save File" , FL_CTRL + ' s' , EditorWidget::save_file_cb);
954944 m->add (" &File/_Save File &As" , FL_CTRL + FL_SHIFT + ' S' , save_file_as_cb);
955- addPlugin (m, " &File/Publish Online" , " publish.bas" );
956945 m->add (" &File/_Export" , FL_CTRL + FL_F+9 , export_file_cb);
957946 m->add (" &File/E&xit" , FL_CTRL + ' q' , quit_cb);
958947 m->add (" &Edit/_&Undo" , FL_CTRL + ' z' , EditorWidget::undo_cb);
0 commit comments