Refactor default_vim{,runtime}_dir to use char type. #2375

See: #459
Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
Reviewed-by: Eliseo Martínez <eliseomarmol@gmail.com>
This commit is contained in:
Mark Bainter 2015-04-08 14:39:44 +00:00 committed by Eliseo Martínez
parent ecc28fb2dd
commit 675e363316
4 changed files with 10 additions and 9 deletions

View File

@ -1,5 +1,5 @@
#include "${PROJECT_SOURCE_DIR}/src/nvim/vim.h"
char_u *default_vim_dir = (char_u *)"${CMAKE_INSTALL_PREFIX}/share/nvim";
char_u *default_vimruntime_dir = (char_u *)"";
char *default_vim_dir = "${CMAKE_INSTALL_PREFIX}/share/nvim";
char *default_vimruntime_dir = "";
char_u *compiled_user = (char_u *)"${USERNAME}";
char_u *compiled_sys = (char_u *)"${HOSTNAME}";

View File

@ -982,8 +982,8 @@ EXTERN char breakat_flags[256]; /* which characters are in 'breakat' */
* Makefile to make their value depend on the Makefile.
*/
#ifdef HAVE_PATHDEF
extern char_u *default_vim_dir;
extern char_u *default_vimruntime_dir;
extern char *default_vim_dir;
extern char *default_vimruntime_dir;
extern char_u *compiled_user;
extern char_u *compiled_sys;
#endif

View File

@ -495,13 +495,14 @@ char_u *vim_getenv(char_u *name, bool *mustfree)
if (p == NULL) {
/* Only use default_vimruntime_dir when it is not empty */
if (vimruntime && *default_vimruntime_dir != NUL) {
p = default_vimruntime_dir;
p = (char_u *)default_vimruntime_dir;
*mustfree = false;
} else if (*default_vim_dir != NUL) {
if (vimruntime && (p = vim_version_dir(default_vim_dir)) != NULL) {
if (vimruntime
&& (p = vim_version_dir((char_u *)default_vim_dir)) != NULL) {
*mustfree = true;
} else {
p = default_vim_dir;
p = (char_u *)default_vim_dir;
*mustfree = false;
}
}

View File

@ -915,13 +915,13 @@ void list_version(void)
if (*default_vim_dir != NUL) {
version_msg(_(" fall-back for $VIM: \""));
version_msg((char *)default_vim_dir);
version_msg(default_vim_dir);
version_msg("\"\n");
}
if (*default_vimruntime_dir != NUL) {
version_msg(_(" f-b for $VIMRUNTIME: \""));
version_msg((char *)default_vimruntime_dir);
version_msg(default_vimruntime_dir);
version_msg("\"\n");
}
#endif // ifdef HAVE_PATHDEF