Skip to content

BUG: fplot wraps filenames in double quotes, but Gnuplot is destroying Windows paths #2

Description

@ItsMeForLua

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.

Pinned by ItsMeForLua

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions