updated for version 7.0026
This commit is contained in:
15
src/eval.c
15
src/eval.c
@ -3427,25 +3427,12 @@ find_buffer(avar)
|
||||
VAR avar;
|
||||
{
|
||||
buf_T *buf = NULL;
|
||||
char_u *name;
|
||||
|
||||
if (avar->var_type == VAR_NUMBER)
|
||||
buf = buflist_findnr((int)avar->var_val.var_number);
|
||||
else if (avar->var_val.var_string != NULL)
|
||||
{
|
||||
/* First make the name into a full path name */
|
||||
name = FullName_save(avar->var_val.var_string,
|
||||
#ifdef UNIX
|
||||
TRUE /* force expansion, get rid of symbolic links */
|
||||
#else
|
||||
FALSE
|
||||
#endif
|
||||
);
|
||||
if (name != NULL)
|
||||
{
|
||||
buf = buflist_findname(name);
|
||||
vim_free(name);
|
||||
}
|
||||
buf = buflist_findname_exp(avar->var_val.var_string);
|
||||
if (buf == NULL)
|
||||
{
|
||||
/* No full path name match, try a match with a URL or a "nofile"
|
||||
|
||||
16
src/main.c
16
src/main.c
@ -141,7 +141,8 @@ main
|
||||
int full_path = FALSE;
|
||||
#endif
|
||||
#ifdef FEAT_CLIENTSERVER
|
||||
char_u *serverStr = NULL;
|
||||
char_u *serverStr = NULL; /* remote server command */
|
||||
char_u *serverStrEnc = NULL; /* encoding of serverStr */
|
||||
char_u *serverName_arg = NULL; /* cmdline arg for server name */
|
||||
int serverArg = FALSE; /* TRUE when argument for a server */
|
||||
char_u *servername = NULL; /* allocated name for our server */
|
||||
@ -378,10 +379,16 @@ main
|
||||
|
||||
/*
|
||||
* When a command server argument was found, execute it. This may
|
||||
* exit Vim when it was successful.
|
||||
* exit Vim when it was successful. Otherwise it's executed further
|
||||
* on. Remember the encoding used here in "serverStrEnc".
|
||||
*/
|
||||
if (serverArg)
|
||||
{
|
||||
cmdsrv_main(&argc, argv, serverName_arg, &serverStr);
|
||||
# ifdef FEAT_MBYTE
|
||||
serverStrEnc = vim_strsave(p_enc);
|
||||
# endif
|
||||
}
|
||||
|
||||
/* If we're still running, get the name to register ourselves.
|
||||
* On Win32 can register right now, for X11 need to setup the
|
||||
@ -1662,7 +1669,10 @@ scripterror:
|
||||
* else we would have exited above).
|
||||
*/
|
||||
if (serverStr != NULL)
|
||||
server_to_input_buf(serverStr);
|
||||
{
|
||||
server_to_input_buf(serverConvert(serverStrEnc, serverStr, &p));
|
||||
vim_free(p);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@ -425,7 +425,8 @@ ml_setname(buf)
|
||||
{
|
||||
if (*dirp == NUL) /* tried all directories, fail */
|
||||
break;
|
||||
fname = findswapname(buf, &dirp, mfp->mf_fname); /* alloc's fname */
|
||||
fname = findswapname(buf, &dirp, mfp->mf_fname);
|
||||
/* alloc's fname */
|
||||
if (fname == NULL) /* no file name found for this dir */
|
||||
continue;
|
||||
|
||||
@ -529,7 +530,7 @@ ml_open_file(buf)
|
||||
/* There is a small chance that between chosing the swap file name and
|
||||
* creating it, another Vim creates the file. In that case the
|
||||
* creation will fail and we will use another directory. */
|
||||
fname = findswapname(buf, &dirp, NULL); /* allocates fname */
|
||||
fname = findswapname(buf, &dirp, NULL); /* allocates fname */
|
||||
if (fname == NULL)
|
||||
continue;
|
||||
if (mf_open_file(mfp, fname) == OK) /* consumes fname! */
|
||||
@ -3731,7 +3732,8 @@ findswapname(buf, dirp, old_fname)
|
||||
* viewing a help file or when the path of the file is different
|
||||
* (happens when all .swp files are in one directory).
|
||||
*/
|
||||
if (!recoverymode && buf->b_fname != NULL && !buf->b_help)
|
||||
if (!recoverymode && buf->b_fname != NULL
|
||||
&& !buf->b_help && !(buf->b_flags & BF_DUMMY))
|
||||
{
|
||||
int fd;
|
||||
struct block0 b0;
|
||||
|
||||
@ -13,7 +13,7 @@ int bt_nofile __ARGS((buf_T *buf));
|
||||
int bt_dontwrite __ARGS((buf_T *buf));
|
||||
int bt_dontwrite_msg __ARGS((buf_T *buf));
|
||||
int buf_hide __ARGS((buf_T *buf));
|
||||
int grep_internal __ARGS((exarg_T *eap));
|
||||
int grep_internal __ARGS((cmdidx_T cmdidx));
|
||||
void ex_make __ARGS((exarg_T *eap));
|
||||
void ex_cc __ARGS((exarg_T *eap));
|
||||
void ex_cnext __ARGS((exarg_T *eap));
|
||||
|
||||
Reference in New Issue
Block a user