Hi,

While refactoring the qf_init_ext() function, I found a couple of
bugs in quickfix. The patch to fix these bugs is attached.

- Yegappan

-- 
-- 
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/quickfix.c b/src/quickfix.c
index b72f7d1..cb75aa7 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -623,8 +623,8 @@ qf_init_ext(
                if (buflnum > lnumlast)
                    break;
                p_buf = ml_get_buf(buf, buflnum++, FALSE);
-               linelen = (int)STRLEN(p_buf);
-               if (linelen > IOSIZE - 2)
+               len = (int)STRLEN(p_buf);
+               if (len > IOSIZE - 2)
                {
                    linebuf = qf_grow_linebuf(&growbuf, &growbufsiz, len,
                                                                    &linelen);
@@ -632,7 +632,10 @@ qf_init_ext(
                        goto qf_init_end;
                }
                else
+               {
                    linebuf = IObuff;
+                   linelen = len;
+               }
                vim_strncpy(linebuf, p_buf, linelen);
            }
        }
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim
index 380d64b..56bf9cb 100644
--- a/src/testdir/test_quickfix.vim
+++ b/src/testdir/test_quickfix.vim
@@ -653,6 +653,8 @@ endfunction
 
 " Test for quickfix directory stack support
 function! s:dir_stack_tests(cchar)
+  call s:setup_commands(a:cchar)
+
   let save_efm=&efm
   set efm=%DEntering\ dir\ '%f',%f:%l:%m,%XLeaving\ dir\ '%f'
 

Raspunde prin e-mail lui