Mercurial > vim
diff src/ex_cmds.c @ 14:946da5994c01
updated for version 7.0006
author | vimboss |
---|---|
date | Mon, 05 Jul 2004 15:58:32 +0000 |
parents | 24d5189d3956 |
children | 631143ac4a01 |
line wrap: on
line diff
--- 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;