Skip to content

Quoted strings are escaped incorrectly #207

@mikucionisaau

Description

@mikucionisaau

Describe the bug
External library loading feature takes a quoted string where special characters can be escaped.
Windows paths use backslashes \ which need to be escaped with \\ and it works most of the time, except when it clashes with other escaped characters.
For example folder\\table is interpreted as folder\ able, i.e. the backslash is applied on t and results in a tab character and not folder\table.

It's probably an issue in UTAP.

To Reproduce
Steps to reproduce the behavior:

  1. Download a libtable-dbg.dll library from uppaal-libs and put it in C:\.
  2. Create a sample CSV file in c:\table.csv
  3. In Uppaal declare the following:
import "C:\libtable-dbg.dll" { // strange, but works
    /** read the table from the csv file and return its id: */
    int table_read_csv(const string& filename, int skip_lines);
};
const int TID_GOOD = table_read_csv("C:/table.csv",1); // works
const int TID_BAD = table_read_csv("C:\\table.csv",1); // file not found, table is empty
  1. In errors.log (in current directory from where Uppaal was launched) observe errors

Expected behavior
The parser should interpret \\t as \t and not as \ .

Version(s) of UPPAAL tested
Uppaal 5 rc4

Desktop (please complete the following information):

  • Windows 10 64bit

Additional context
The library path parsing should also be revisited.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions