Commit edde4be9c1302f917bfdde6211a3cda64d64a2be

Thomas de Grivel 2024-05-06T00:27:20

fix buf_parse_var

diff --git a/libc3/buf_parse.c b/libc3/buf_parse.c
index 91e40e9..8923827 100644
--- a/libc3/buf_parse.c
+++ b/libc3/buf_parse.c
@@ -3906,12 +3906,15 @@ sw buf_parse_var (s_buf *buf, s_var *dest)
   assert(buf);
   (void) dest;
   buf_save_init(buf, &save);
-  if ((r = buf_parse_paren_sym(buf, &tmp.type)) <= 0)
+  tmp.type = &g_sym_Tag;
+  if ((r = buf_parse_paren_sym(buf, &tmp.type)) < 0)
     goto clean;
   result += r;
-  if ((r = buf_ignore_spaces(buf)) < 0)
-    goto restore;
-  result += r;
+  if (r) {
+    if ((r = buf_ignore_spaces(buf)) <= 0)
+      goto restore;
+    result += r;
+  }
   if ((r = buf_read_1(buf, "?")) <= 0)
     goto restore;
   result += r;