mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 7.4.691 for Problem: Can't build with MzScheme.
Solution: Change "cwd" into the global variable "start_dir".
This commit is contained in:
25
src/main.c
25
src/main.c
@@ -147,6 +147,8 @@ static char *(main_errors[]) =
|
|||||||
#define ME_INVALID_ARG 5
|
#define ME_INVALID_ARG 5
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static char_u *start_dir = NULL; /* current working dir on startup */
|
||||||
|
|
||||||
#ifndef PROTO /* don't want a prototype for main() */
|
#ifndef PROTO /* don't want a prototype for main() */
|
||||||
#ifndef NO_VIM_MAIN /* skip this for unittests */
|
#ifndef NO_VIM_MAIN /* skip this for unittests */
|
||||||
int
|
int
|
||||||
@@ -168,7 +170,6 @@ main
|
|||||||
char_u *fname = NULL; /* file name from command line */
|
char_u *fname = NULL; /* file name from command line */
|
||||||
mparm_T params; /* various parameters passed between
|
mparm_T params; /* various parameters passed between
|
||||||
* main() and other functions. */
|
* main() and other functions. */
|
||||||
char_u *cwd = NULL; /* current workding dir on startup */
|
|
||||||
#ifdef STARTUPTIME
|
#ifdef STARTUPTIME
|
||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
@@ -405,17 +406,17 @@ main
|
|||||||
*/
|
*/
|
||||||
if (!params.literal)
|
if (!params.literal)
|
||||||
{
|
{
|
||||||
cwd = alloc(MAXPATHL);
|
start_dir = alloc(MAXPATHL);
|
||||||
if (cwd != NULL)
|
if (start_dir != NULL)
|
||||||
mch_dirname(cwd, MAXPATHL);
|
mch_dirname(start_dir, MAXPATHL);
|
||||||
/* Temporarily add '(' and ')' to 'isfname'. These are valid
|
/* Temporarily add '(' and ')' to 'isfname'. These are valid
|
||||||
* filename characters but are excluded from 'isfname' to make
|
* filename characters but are excluded from 'isfname' to make
|
||||||
* "gf" work on a file name in parenthesis (e.g.: see vim.h). */
|
* "gf" work on a file name in parenthesis (e.g.: see vim.h). */
|
||||||
do_cmdline_cmd((char_u *)":set isf+=(,)");
|
do_cmdline_cmd((char_u *)":set isf+=(,)");
|
||||||
alist_expand(NULL, 0);
|
alist_expand(NULL, 0);
|
||||||
do_cmdline_cmd((char_u *)":set isf&");
|
do_cmdline_cmd((char_u *)":set isf&");
|
||||||
if (cwd != NULL)
|
if (start_dir != NULL)
|
||||||
mch_chdir((char *)cwd);
|
mch_chdir((char *)start_dir);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
fname = alist_name(&GARGLIST[0]);
|
fname = alist_name(&GARGLIST[0]);
|
||||||
@@ -441,8 +442,8 @@ main
|
|||||||
* If the cd fails, it doesn't matter.
|
* If the cd fails, it doesn't matter.
|
||||||
*/
|
*/
|
||||||
(void)vim_chdirfile(fname);
|
(void)vim_chdirfile(fname);
|
||||||
if (cwd != NULL)
|
if (start_dir != NULL)
|
||||||
mch_dirnamem(cwd, MAXPATHL);
|
mch_dirname(start_dir, MAXPATHL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
TIME_MSG("expanding arguments");
|
TIME_MSG("expanding arguments");
|
||||||
@@ -496,8 +497,8 @@ main
|
|||||||
expand_env((char_u *)"$HOME", NameBuff, MAXPATHL);
|
expand_env((char_u *)"$HOME", NameBuff, MAXPATHL);
|
||||||
vim_chdir(NameBuff);
|
vim_chdir(NameBuff);
|
||||||
}
|
}
|
||||||
if (cwd != NULL)
|
if (start_dir != NULL)
|
||||||
mch_dirname(cwd, MAXPATHL);
|
mch_dirname(start_dir, MAXPATHL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -910,9 +911,9 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
|
|||||||
* If opened more than one window, start editing files in the other
|
* If opened more than one window, start editing files in the other
|
||||||
* windows.
|
* windows.
|
||||||
*/
|
*/
|
||||||
edit_buffers(¶ms, cwd);
|
edit_buffers(¶ms, start_dir);
|
||||||
#endif
|
#endif
|
||||||
vim_free(cwd);
|
vim_free(start_dir);
|
||||||
|
|
||||||
#ifdef FEAT_DIFF
|
#ifdef FEAT_DIFF
|
||||||
if (params.diff_mode)
|
if (params.diff_mode)
|
||||||
|
@@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
691,
|
||||||
/**/
|
/**/
|
||||||
690,
|
690,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user