On 17:13 Thu 29 Jan , Ingo Karkat wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello Vim developers,
>
> the new range handling on :argdo (and :bufdo, :windo) proceeds even if
> a silly (and invalid) range is passed to it:
>
> $ vim -N -u NONE
> :args *.txt
> :/foo/,/bar/argdo echo bufnr('')
> E14: Invalid address
> 2
> "INSTALLmac.txt" 67 lines, 1942 characters
> 3
> "INSTALLpc.txt" 513 lines, 19434 characters
> 4
> "INSTALLvms.txt" 393 lines, 12432 characters
> 5
> "INSTALLx.txt" 165 lines, 5354 characters
> 6
> "README.txt" 143 lines, 5178 characters
> 7
>
> In contrast,
> :1,999argdo echo bufnr('')
> correctly aborts with
> E16: Invalid range
>
> - -- regards, ingoThe attached patch fixes this and also fixes a typo in a comment. Regards, Marcin -- -- 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.
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index a59bbd1..97259ff 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -4484,6 +4484,7 @@ get_address(ptr, addr_type, skip, to_other_file)
if (addr_type != ADDR_LINES)
{
EMSG(_(e_invaddr));
+ cmd = NULL;
goto error;
}
if (*cmd == '&')
@@ -4662,7 +4663,7 @@ invalid_range(eap)
return (char_u *)_(e_invrange);
break;
case ADDR_ARGUMENTS:
- if (eap->line2 > ARGCOUNT + (!ARGCOUNT)) // add 1 if ARCOUNT is 0
+ if (eap->line2 > ARGCOUNT + (!ARGCOUNT)) // add 1 if ARGCOUNT is 0
return (char_u *)_(e_invrange);
break;
case ADDR_BUFFERS:
signature.asc
Description: Digital signature
