diff options
author | Bram Moolenaar <Bram@vim.org> | 2004-07-05 15:58:32 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2004-07-05 15:58:32 +0000 |
commit | 325b7a2fb5b970b77f7b9ec28ba15eb794f6edf8 (patch) | |
tree | a2b0cfed6da973286326442419e56938dc966ea4 /src/ex_cmds.c | |
parent | 592e0a2a1dbc542134c3fd88b4cdfa40e258f41b (diff) | |
download | vim-325b7a2fb5b970b77f7b9ec28ba15eb794f6edf8.zip |
updated for version 7.0006
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r-- | src/ex_cmds.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 62e489967..4f53f59d6 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -1998,7 +1998,18 @@ ex_file(eap) char_u *fname, *sfname, *xfname; buf_T *buf; - if (*eap->arg != NUL) + /* ":0file" removes the file name. Check for illegal uses ":3file", + * "0file name", etc. */ + if (eap->addr_count > 0 + && (*eap->arg != NUL + || eap->line2 > 0 + || eap->addr_count > 1)) + { + EMSG(_(e_invarg)); + return; + } + + if (*eap->arg != NUL || eap->addr_count == 1) { #ifdef FEAT_AUTOCMD buf = curbuf; |