systemlist() returns locked value.

45 views
Skip to first unread message

Yukihiro Nakadaira

unread,
Jan 26, 2015, 12:01:14 AM1/26/15
to vim...@googlegroups.com
systemlist() returns locked value.

Steps to reproduce:
  $ vim -u NONE
  :echo map(systemlist('ls'), '0')
  E741: Value is locked: map() argument
    or
  E742: Cannot change value of map() argument

v_lock is not initialized when creating result list.

diff -r e9538738fd8c src/eval.c
--- a/src/eval.c    Wed Jan 07 19:04:29 2015 +0100
+++ b/src/eval.c    Mon Jan 26 13:48:30 2015 +0900
@@ -18708,6 +18708,7 @@
         goto errret;
         }
         li->li_tv.v_type = VAR_STRING;
+        li->li_tv.v_lock = 0;
         li->li_tv.vval.v_string = s;
         list_append(list, li);
     }

--
Yukihiro Nakadaira - yukihiro....@gmail.com

Bram Moolenaar

unread,
Jan 27, 2015, 7:50:27 AM1/27/15
to Yukihiro Nakadaira, vim...@googlegroups.com
Thanks!

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages