diff src/quickfix.c @ 2770:25672ad7f377 v7.3.161

updated for version 7.3.161 Problem: Items on the stack may be too big. Solution: Make items static or allocate them.
author Bram Moolenaar <bram@vim.org>
date Mon, 11 Apr 2011 21:35:11 +0200
parents b254cfdd7405
children 0a0d7961b4fe
line wrap: on
line diff
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -3049,8 +3049,8 @@ ex_vimgrep(eap)
     int		flags = 0;
     colnr_T	col;
     long	tomatch;
-    char_u	dirname_start[MAXPATHL];
-    char_u	dirname_now[MAXPATHL];
+    char_u	*dirname_start = NULL;
+    char_u	*dirname_now = NULL;
     char_u	*target_dir = NULL;
 #ifdef FEAT_AUTOCMD
     char_u	*au_name =  NULL;
@@ -3128,6 +3128,11 @@ ex_vimgrep(eap)
 	goto theend;
     }
 
+    dirname_start = alloc(MAXPATHL);
+    dirname_now = alloc(MAXPATHL);
+    if (dirname_start == NULL || dirname_now == NULL)
+	goto theend;
+
     /* Remember the current directory, because a BufRead autocommand that does
      * ":lcd %:p:h" changes the meaning of short path names. */
     mch_dirname(dirname_start, MAXPATHL);
@@ -3364,6 +3369,8 @@ ex_vimgrep(eap)
     }
 
 theend:
+    vim_free(dirname_now);
+    vim_free(dirname_start);
     vim_free(target_dir);
     vim_free(regmatch.regprog);
 }