aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 541a255dcc..9f99ccc110 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -12145,8 +12145,12 @@ static void get_maparg(typval_T *argvars, typval_T *rettv, int exact)
if (!get_dict) {
// Return a string.
if (rhs != NULL) {
- rettv->vval.v_string = (char_u *)str2special_save(
- (const char *)rhs, false, false);
+ if (*rhs == NUL) {
+ rettv->vval.v_string = vim_strsave((char_u *)"<Nop>");
+ } else {
+ rettv->vval.v_string = (char_u *)str2special_save(
+ (char *)rhs, false, false);
+ }
}
} else {