Commit 8803d3b969696018e3e2244983852ec39df3df70

Thomas de Grivel 2023-12-15T02:06:36

fix ic3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/ic3/buf_linenoise.c b/ic3/buf_linenoise.c
index c3a4831..4b6f968 100644
--- a/ic3/buf_linenoise.c
+++ b/ic3/buf_linenoise.c
@@ -101,7 +101,8 @@ sw buf_linenoise_refill_linenoise (s_buf *buf)
     return -1;
   buf_linenoise_len = buf_linenoise->buf.wpos - buf_linenoise->buf.rpos;
   if (buf_linenoise_len == 0) {
-    free(buf_linenoise->buf.ptr.p);
+    if (buf_linenoise->buf.free)
+      free(buf_linenoise->buf.ptr.p);
     if (! (buf_linenoise->buf.ptr.p = linenoise(buf_linenoise->prompt))) {
       buf_linenoise->eof = true;
       buf_linenoise->buf.rpos =