Hi

Using Vim-7.3f (2559:84ba6293f9d7) on Linux, I see 2 bugs with
the ":find" command.

Bug #1:

I can reproduce the following error with Valgrind:

==13725== Source and destination overlap in strcat(0x469774c, 0x4697756)
==13725==    at 0x4025E30: strcat (mc_replace_strmem.c:176)
==13725==    by 0x810BA06: uniquefy_paths (misc1.c:9558)
==13725==    by 0x810C14D: gen_expand_wildcards (misc1.c:9842)
==13725==    by 0x810A9AF: expand_wildcards (misc1.c:8593)
==13725==    by 0x810A95E: expand_wildcards_eval (misc1.c:8564)
==13725==    by 0x80B6214: ExpandFromContext (ex_getln.c:4468)
==13725==    by 0x80B4C5E: ExpandOne (ex_getln.c:3496)
==13725==    by 0x80B4843: nextwild (ex_getln.c:3319)
==13725==    by 0x80B0BBA: getcmdline (ex_getln.c:803)
==13725==    by 0x80B2CF6: getexline (ex_getln.c:2126)
==13725==    by 0x809D9F3: do_cmdline (ex_docmd.c:1018)
==13725==    by 0x8121DFF: nv_colon (normal.c:5319)
==13725==    by 0x811BEC3: normal_cmd (normal.c:1190)
==13725==    by 0x80DF966: main_loop (main.c:1260)
==13725==    by 0x80DF3A9: main (main.c:965)

Steps to reproduce:

   $ mkdir /tmp/foo
   $ touch /tmp/foo/xxxxxx

   $ valgrind 2> /tmp/vg.log vim -u NONE -N -c ':cd /tmp/foo' \
      -c ':call feedkeys(":find /tmp/foo/\<C-D>")'

And observe error in /tmp/vg.log.

Attached patch fixes this bug.

Bug #2:

Using the same file /tmp/foo/xxxxxx as above, file completion does
not work if I do:

  :cd /tmp
  :find /tmp/fo<C-D>          " does not work, no completion.

For file completion to work in the current directory, I have to use:

  :cd /tmp
  :find ./fo<C-D>             " this works.

I have not fixed this second bug yet. I assume that's not the expected
behavior, is it?

Regards
-- Dominique

-- 
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
diff -r 84ba6293f9d7 src/misc1.c
--- a/src/misc1.c	Fri Aug 13 22:05:54 2010 +0200
+++ b/src/misc1.c	Sat Aug 14 00:26:08 2010 +0200
@@ -9555,7 +9555,7 @@
 	    {
 		STRCPY(path, ".");
 		add_pathsep(path);
-		STRCAT(path, short_name);
+		STRMOVE(path + STRLEN(path), short_name);
 	    }
 	}
 	ui_breakcheck();

Raspunde prin e-mail lui