woohyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8f3be603c201c0785e234f9836cd98bad1b2279e

commit 8f3be603c201c0785e234f9836cd98bad1b2279e
Author: Ali Alzyod <[email protected]>
Date:   Mon Jun 22 17:16:34 2020 +0900

    eina_strbuf: if readonly strbuf is malloc, then it will stop being readonly
    
    Reviewers: cedric
    
    Reviewed By: cedric
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Maniphest Tasks: T8757
    
    Differential Revision: https://phab.enlightenment.org/D11992
---
 src/lib/eina/eina_strbuf_common.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/lib/eina/eina_strbuf_common.c 
b/src/lib/eina/eina_strbuf_common.c
index ebec119c2a..b4d3427a39 100644
--- a/src/lib/eina/eina_strbuf_common.c
+++ b/src/lib/eina/eina_strbuf_common.c
@@ -757,6 +757,7 @@ eina_strbuf_common_remove(size_t csize,
         if (!dest) return 0;
         memcpy(dest, buf->buf, buf->len);
         buf->buf = dest;
+        buf->ro = EINA_FALSE;
      }
 
    remove_len = end - start;
@@ -825,6 +826,7 @@ eina_strbuf_common_string_steal(size_t csize, Eina_Strbuf 
*buf)
         if (!dest) return 0;
         memcpy(dest, buf->buf, buf->len);
         buf->buf = dest;
+        buf->ro = EINA_FALSE;
      }
 
    ret = buf->buf;
@@ -958,6 +960,7 @@ eina_strbuf_replace(Eina_Strbuf *buf,
         if (!dest) return 0;
         memcpy(dest, buf->buf, buf->len);
         buf->buf = dest;
+        buf->ro = EINA_FALSE;
      }
 
    if (len1 != len2)
@@ -1003,6 +1006,7 @@ eina_strbuf_replace_all(Eina_Strbuf *buf, const char 
*str, const char *with)
         if (!dest) return 0;
         memcpy(dest, buf->buf, buf->len);
         buf->buf = dest;
+        buf->ro = EINA_FALSE;
      }
 
    len1 = strlen(str);

-- 


Reply via email to