-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 29-Jan-2015 22:05, Marcin Szamotulski wrote:
> 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, ingo
> 
> The attached patch fixes this and also fixes a typo in a comment.
> 
> Regards, Marcin

Thanks Marcin for that very quick response. However, your patch didn't
fix the given problem; two very similar other places need to set cmd
to NULL, too. Please see the attached, revised patch (still including
the fixed typo).

- -- regards, ingo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)

iQEbBAEBAgAGBQJUy5ZVAAoJEA7ziXlAzQ/vTuEH+MnYWHVNoxtenyyq7H9wOipY
+urClwSca9BRfXBWVBocGsQwgu4hs8cwSjtxud7RUx0oMWbiFj+T4YX9DUOPmkit
DT7EAZ8JuYvy0xjniqT6q/cB0IPmfj8x5OdYadA/sT7qMRQ+xDia7YdN8p5DdfVl
Fw9pYxxyVxoPxltaga34Z3pyKeDMQyZ0FQwDCZCbhWfbe9b/6vIpyZKe6I333e3j
0CZUTfobRLm4yeipHpEMmIBovqsMxa/NkjUofb/zNQZ6N2IXdEUikjkpNnwcVLGa
6nDfEnHEPxTOI7VA9HD07Ah1E0aS+ZTE0swsYHzI/7yxXvbNhoMiaNs2MyrsLg==
=vag4
-----END PGP SIGNATURE-----

-- 
-- 
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
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -4405,6 +4405,7 @@ get_address(ptr, addr_type, skip, to_oth
 		if (addr_type != ADDR_LINES)
 		{
 		    EMSG(_(e_invaddr));
+		    cmd = NULL;
 		    goto error;
 		}
 		if (skip)
@@ -4436,6 +4437,7 @@ get_address(ptr, addr_type, skip, to_oth
 		if (addr_type != ADDR_LINES)
 		{
 		    EMSG(_(e_invaddr));
+		    cmd = NULL;
 		    goto error;
 		}
 		if (skip)	/* skip "/pat/" */
@@ -4484,6 +4486,7 @@ get_address(ptr, addr_type, skip, to_oth
 		if (addr_type != ADDR_LINES)
 		{
 		    EMSG(_(e_invaddr));
+		    cmd = NULL;
 		    goto error;
 		}
 		if (*cmd == '&')
@@ -4662,7 +4665,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:

Attachment: get_address.patch.sig
Description: Binary data

Raspunde prin e-mail lui