From 97db844944215b218125f34fde1cf33294563ab1 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 25 Oct 2020 15:55:23 +0100 Subject: [PATCH] Prevent raw file entries (by the 'write' command) like 6 i(i(v_vsupply2)) current --- src/frontend/rawfile.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontend/rawfile.c b/src/frontend/rawfile.c index 348011cf7..8881816c4 100644 --- a/src/frontend/rawfile.c +++ b/src/frontend/rawfile.c @@ -161,7 +161,11 @@ void raw_write(char *name, struct plot *pl, bool app, bool binary) if ((branch = strstr(v->v_name, "#branch")) != NULL) { *branch = '\0'; } - fprintf(fp, "\t%d\ti(%s)\t%s", i++, v->v_name, ft_typenames(v->v_type)); + /* If the branch name is a number, the vector is already called i(name) */ + if (ciprefix("i(", v->v_name)) + fprintf(fp, "\t%d\t%s\t%s", i++, v->v_name, ft_typenames(v->v_type)); + else + fprintf(fp, "\t%d\ti(%s)\t%s", i++, v->v_name, ft_typenames(v->v_type)); /* restore name#branch */ if (branch != NULL) *branch = '#'; }