diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-03-01 21:57:32 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-03-01 21:57:32 +0100 |
commit | 072687032683b1994d25a114893d9a6f8bc36612 (patch) | |
tree | 92733e191032910aa84c907ee34d537a12250654 /src/main.c | |
parent | 5f73ef8d20070cd45c9aea4dc33c2e0657f5515c (diff) | |
download | vim-git-072687032683b1994d25a114893d9a6f8bc36612.tar.gz |
patch 8.0.1554: custom plugins loaded with --cleanv8.0.1554
Problem: Custom plugins loaded with --clean.
Solution: Do not include the home directory in 'runtimepath'.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c index 78a30182e..cf937a320 100644 --- a/src/main.c +++ b/src/main.c @@ -158,18 +158,25 @@ main #ifdef STARTUPTIME /* Need to find "--startuptime" before actually parsing arguments. */ - for (i = 1; i < argc; ++i) - { - if (STRICMP(argv[i], "--startuptime") == 0 && i + 1 < argc) + for (i = 1; i < argc - 1; ++i) + if (STRICMP(argv[i], "--startuptime") == 0) { time_fd = mch_fopen(argv[i + 1], "a"); TIME_MSG("--- VIM STARTING ---"); break; } - } #endif starttime = time(NULL); +#ifdef CLEAN_RUNTIMEPATH + /* Need to find "--clean" before actually parsing arguments. */ + for (i = 1; i < argc; ++i) + if (STRICMP(argv[i], "--clean") == 0) + { + params.clean = TRUE; + break; + } +#endif common_init(¶ms); #ifdef FEAT_CLIENTSERVER @@ -1024,7 +1031,7 @@ common_init(mparm_T *paramp) * First find out the home directory, needed to expand "~" in options. */ init_homedir(); /* find real value of $HOME */ - set_init_1(); + set_init_1(paramp->clean); TIME_MSG("inits 1"); #ifdef FEAT_EVAL @@ -1903,6 +1910,7 @@ command_line_scan(mparm_T *parmp) else if (STRNICMP(argv[0] + argv_idx, "clean", 5) == 0) { parmp->use_vimrc = (char_u *)"DEFAULTS"; + parmp->clean = TRUE; set_option_value((char_u *)"vif", 0L, (char_u *)"NONE", 0); } else if (STRNICMP(argv[0] + argv_idx, "literal", 7) == 0) |