There is a bug which only really reveals itself in curtain circumstances.
Because fplot currently puts filenames in double quotes, Gnuplot ends up destroying Windows paths in particular contexts.
There are two places in the code we need to review and possibly update to make fplot compatible on Windows environments (such as in MSYS2).
FYR:
In Gnuplot:
Double Quotes evaluate C-style escape sequences, so, \t becomes a tab, \n becomes a newline, et cetera.
Single Quotes read the string as a literal. Backslashes are thus treated as normal characters.
There are two particular blocks of code which need review:
dataset->plot-clause
We need to change the double quotes to single quotes.
option->cmd
We need to ensure the :output-file also uses single quotes so that Windows users don't trigger the bug when defining their own paths.
n.b., It might be good to also sanitize get-tempfile---since we are concatenating tmp with / anyway, it may be a good idea to normalize the directory string inside Lua so it's uniform regardless of the environment.
There is a bug which only really reveals itself in curtain circumstances.
Because fplot currently puts filenames in double quotes, Gnuplot ends up destroying Windows paths in particular contexts.
There are two places in the code we need to review and possibly update to make fplot compatible on Windows environments (such as in MSYS2).
FYR:
In Gnuplot:
Double Quotes evaluate C-style escape sequences, so, \t becomes a tab, \n becomes a newline, et cetera.
Single Quotes read the string as a literal. Backslashes are thus treated as normal characters.
There are two particular blocks of code which need review:
dataset->plot-clauseWe need to change the double quotes to single quotes.
option->cmdWe need to ensure the
:output-filealso uses single quotes so that Windows users don't trigger the bug when defining their own paths.n.b., It might be good to also sanitize
get-tempfile---since we are concatenating tmp with / anyway, it may be a good idea to normalize the directory string inside Lua so it's uniform regardless of the environment.These have been fixed, and will be pushed to the develop branch -> staging branch -> main as a release.