allow parsing node names with spaces in raw files (variable list is tab separated so there is no ambiguity)

This commit is contained in:
stefan schippers 2026-02-15 13:20:23 +01:00
parent 9532340a0e
commit 7a262c451f
2 changed files with 3 additions and 2 deletions

View File

@ -782,7 +782,7 @@ static int read_dataset(FILE *fd, Raw **rawptr, const char *type, int no_warning
if(!raw->names) raw->names = my_calloc(_ALLOC_ID_, raw->nvars, sizeof(char *));
if(!raw->cursor_b_val) raw->cursor_b_val = my_calloc(_ALLOC_ID_, raw->nvars, sizeof(double));
my_realloc(_ALLOC_ID_, &varname, strlen(line) + 1) ;
n = sscanf(line, "%d %s", &i, varname); /* read index and name of saved waveform */
n = sscanf(line, "%*[\t]%d%*[\t]%[^\t]", &i, varname); /* read index and name of saved waveform */
if(n < 2) {
dbg(0, "read_dataset(): WAARNING: malformed raw file, aborting\n");
extra_rawfile(3, NULL, NULL, -1.0, -1.0);

View File

@ -3132,10 +3132,11 @@ proc graph_delete_nodes {} {
proc graph_get_signal_list {siglist pattern } {
global graph_sort
set siglist [split $siglist \n]
set direction {-decreasing}
if {$graph_sort} {set direction {-increasing}}
set result {}
set siglist [join [lsort $direction -dictionary $siglist] \n]
set siglist [lsort $direction -dictionary $siglist]
# just check if pattern is a valid regexp
set err [catch {regexp $pattern {12345}} res]
if {$err} {set pattern {}}