AlgorithmicBotany / vlab

Virtual Laboratory
GNU General Public License v3.0
41 stars 6 forks source link

funcedit won't load noname.func #5

Open gilgamec opened 2 months ago

gilgamec commented 2 months ago

The default function name in funcedit is noname.func. Unfortunately, if you load a file called 'noname.func', the file isn't actually loaded; instead, the default function is displayed.

It looks like the problem is around line 150 of ctrl.cpp, where the function is actually loaded from the file only when the file name isn't 'noname.func'. I think that, instead of setting the file name before parsing the arguments (line 97), the program should instead record whether a file name has been provided, and if not, then set the file name to noname.func at the end of initialization. This is what cuspy does (ctrl.cpp, line 265).

mikcieslak commented 2 months ago

Thanks for finding and posting about this issue. I've pushed a fix to the repo. You should be able to load files called "noname.func" now.