mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 22:18:33 +00:00
removed get_user_name() and replaced calls with mch_get_user_name()
This commit is contained in:

committed by
Thiago de Arruda

parent
ce31410c79
commit
ad77ff53d3
21
src/misc2.c
21
src/misc2.c
@@ -47,8 +47,6 @@
|
||||
#include "window.h"
|
||||
#include "os/os.h"
|
||||
|
||||
static char_u *username = NULL; /* cached result of mch_get_user_name() */
|
||||
|
||||
static int coladvance2(pos_T *pos, int addspaces, int finetune,
|
||||
colnr_T wcol);
|
||||
|
||||
@@ -935,7 +933,6 @@ void free_all_mem(void) {
|
||||
clear_sb_text(); /* free any scrollback text */
|
||||
|
||||
/* Free some global vars. */
|
||||
vim_free(username);
|
||||
vim_free(last_cmdline);
|
||||
vim_free(new_last_cmdline);
|
||||
set_keep_msg(NULL, 0);
|
||||
@@ -1876,24 +1873,6 @@ int vim_chdir(char_u *new_dir)
|
||||
return r;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get user name from machine-specific function.
|
||||
* Returns the user name in "buf[len]".
|
||||
* Some systems are quite slow in obtaining the user name (Windows NT), thus
|
||||
* cache the result.
|
||||
* Returns OK or FAIL.
|
||||
*/
|
||||
int get_user_name(char_u *buf, int len)
|
||||
{
|
||||
if (username == NULL) {
|
||||
if (mch_get_user_name((char *)buf, len) == FAIL)
|
||||
return FAIL;
|
||||
username = vim_strsave(buf);
|
||||
} else
|
||||
vim_strncpy(buf, username, len - 1);
|
||||
return OK;
|
||||
}
|
||||
|
||||
#ifndef HAVE_QSORT
|
||||
/*
|
||||
* Our own qsort(), for systems that don't have it.
|
||||
|
Reference in New Issue
Block a user