On Do, 17 Apr 2014, Bram Moolenaar wrote:

> Christian Brabandt wrote:
> 
> > I accidentally called append($, 'foobar') and was surprised the string 
> > was actually entered at the top. I did rather expect E116 invalid 
> > arguments for function append.
> > 
> > So here is a patch:
> 
> Thanks!

This is better, I think:

diff --git a/src/eval.c b/src/eval.c
--- a/src/eval.c
+++ b/src/eval.c
@@ -7789,7 +7789,6 @@ string2float(text, value)
  * Get the value of an environment variable.
  * "arg" is pointing to the '$'.  It is advanced to after the name.
  * If the environment variable was not set, silently assume it is empty.
- * Always return OK.
  */
     static int
 get_env_tv(arg, rettv, evaluate)
@@ -7834,6 +7833,9 @@ get_env_tv(arg, rettv, evaluate)
            }
            name[len] = cc;
        }
+       else
+           return FAIL; /* no length, can't be an environment variable */
+
        rettv->v_type = VAR_STRING;
        rettv->vval.v_string = string;
     }


Best,
Christian
-- 
Große Schatten werfen ihre Ereignisse hinter sich.
                -- Heinz Erhardt

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui