Mercurial > vim
comparison src/eval.c @ 20126:831b1ea43020 v8.2.0618
patch 8.2.0618: echoing a null list results in no output
Commit: https://github.com/vim/vim/commit/db950e4c0318c084c31bc7b50665284f4a47c285
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Apr 22 19:13:19 2020 +0200
patch 8.2.0618: echoing a null list results in no output
Problem: Echoing a null list results in no output. (Yegappan Lakshmanan)
Solution: Return "[]" instead of NULL in echo_string_core().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 22 Apr 2020 19:15:04 +0200 |
parents | f40231487a49 |
children | 0b35a7ffceb2 |
comparison
equal
deleted
inserted
replaced
20125:4d065d193bf6 | 20126:831b1ea43020 |
---|---|
4526 break; | 4526 break; |
4527 | 4527 |
4528 case VAR_LIST: | 4528 case VAR_LIST: |
4529 if (tv->vval.v_list == NULL) | 4529 if (tv->vval.v_list == NULL) |
4530 { | 4530 { |
4531 // NULL list is equivalent to empty list. | |
4531 *tofree = NULL; | 4532 *tofree = NULL; |
4532 r = NULL; | 4533 r = (char_u *)"[]"; |
4533 } | 4534 } |
4534 else if (copyID != 0 && tv->vval.v_list->lv_copyID == copyID | 4535 else if (copyID != 0 && tv->vval.v_list->lv_copyID == copyID |
4535 && tv->vval.v_list->lv_len > 0) | 4536 && tv->vval.v_list->lv_len > 0) |
4536 { | 4537 { |
4537 *tofree = NULL; | 4538 *tofree = NULL; |