Skip to content

Commit

Permalink
also applies to .gvimrc
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbra committed Sep 1, 2024
1 parent 3190987 commit f9b0dd7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -8243,7 +8243,7 @@ vimrc_found(char_u *fname, char_u *envname)
if (p != NULL)
{
vim_setenv(envname, p);
if (STRNCMP(envname, (char_u *)"MYVIMRC", 7) == 0)
if (vim_getenv((char_u *)"MYVIMDIR", &dofree) == NULL)
{
size_t usedlen = 0;
int len = 0;
Expand All @@ -8254,6 +8254,19 @@ vimrc_found(char_u *fname, char_u *envname)
len = STRLEN(p) - 2;
p[len] = '/';
}
else if (STRNCMP(gettail(fname), ".gvimrc", 7) == 0)
{
len = STRLEN(p);
char_u *buf = alloc(len);
if (buf != NULL)
{
mch_memmove(buf, fname, len - 7);
mch_memmove(buf + len - 7, (char_u *)".vim/", 5);
len -= 2; // decrement len, so that we can set len+1 = NUL below
vim_free(p);
p = buf;
}
}
#ifdef MSWIN
else if (STRNCMP(gettail(fname), "_vimrc", 6) == 0)
{
Expand Down

0 comments on commit f9b0dd7

Please sign in to comment.