Commit 4df52e1d3cc4663fca9a335df54838a420ff7fa5

Thomas de Grivel 2023-12-11T21:14:20

wip plist

diff --git a/libc3/assert.h b/libc3/assert.h
index 8a419a0..fc9759f 100644
--- a/libc3/assert.h
+++ b/libc3/assert.h
@@ -16,6 +16,8 @@
 #include "env.h"
 #include "io.h"
 
+void abort (void);
+
 #ifdef DEBUG
 # define assert(test)                                                  \
   do {                                                                 \
@@ -33,6 +35,7 @@
       err_write_1(__func__);                                           \
       err_write_1(": ");                                               \
       err_puts(# test);                                                \
+      abort();                                                         \
     }                                                                  \
   } while(0)
 #else
diff --git a/libc3/buf_parse.c b/libc3/buf_parse.c
index 97cbbbe..d01db6c 100644
--- a/libc3/buf_parse.c
+++ b/libc3/buf_parse.c
@@ -1869,11 +1869,17 @@ sw buf_parse_list_tag (s_buf *buf, s_tag *dest)
   buf_save_init(buf, &save);
   if ((r = buf_parse_tag_sym(buf, &key)) < 0)
     goto clean;
-  result += r;
   if (r > 0) {
+    result += r;
     if ((r = buf_read_1(buf, ":") <= 0))
       goto tag;
     result += r;
+    if ((r = buf_parse_comments(buf)) < 0)
+      goto tag;
+    result += r;
+    if ((r = buf_ignore_spaces(buf)) < 0)
+      goto tag;
+    result += r;
     if ((r = buf_parse_tag(buf, &value)) <= 0)
       goto tag;
     result += r;
diff --git a/libc3/call.c b/libc3/call.c
index 9c63714..4af4be6 100644
--- a/libc3/call.c
+++ b/libc3/call.c
@@ -221,6 +221,7 @@ s_call * call_init_1 (s_call *call, const s8 *p)
   sw r;
   len = strlen(p);
   buf_init(&buf, false, len, (s8 *) p);
+  buf.wpos = len;
   r = buf_parse_call(&buf, call);
   if (r < 0 || (uw) r != len) {
     err_write_1("call_init_1: invalid call: ");