updated for version 7.3.161
Problem: Items on the stack may be too big.
Solution: Make items static or allocate them.
diff --git a/src/main.c b/src/main.c
index 0527a91..a296cd4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3814,7 +3814,7 @@
int i;
char_u *inicmd = NULL;
char_u *p;
- char_u cwd[MAXPATHL];
+ char_u *cwd;
if (filec > 0 && filev[0][0] == '+')
{
@@ -3827,15 +3827,23 @@
mainerr_arg_missing((char_u *)filev[-1]);
/* Temporarily cd to the current directory to handle relative file names. */
- if (mch_dirname(cwd, MAXPATHL) != OK)
+ cwd = alloc(MAXPATHL);
+ if (cwd == NULL)
return NULL;
- if ((p = vim_strsave_escaped_ext(cwd,
+ if (mch_dirname(cwd, MAXPATHL) != OK)
+ {
+ vim_free(cwd);
+ return NULL;
+ }
+ p = vim_strsave_escaped_ext(cwd,
#ifdef BACKSLASH_IN_FILENAME
"", /* rem_backslash() will tell what chars to escape */
#else
PATH_ESC_CHARS,
#endif
- '\\', TRUE)) == NULL)
+ '\\', TRUE);
+ vim_free(cwd);
+ if (p == NULL)
return NULL;
ga_init2(&ga, 1, 100);
ga_concat(&ga, (char_u *)"<C-\\><C-N>:cd ");