Compare commits

...

5 Commits

Author SHA1 Message Date
Bram Moolenaar
e511f29adb updated for version 7.2-012 2008-09-07 13:50:37 +00:00
Bram Moolenaar
a85fb757a1 updated for version 7.2-011 2008-09-07 11:55:43 +00:00
Bram Moolenaar
3094a9e1a7 updated for version 7.2-010 2008-09-06 14:44:59 +00:00
Bram Moolenaar
ccf22171f1 updated for version 7.2-009 2008-09-01 15:56:45 +00:00
Bram Moolenaar
5bd266c96d updated for version 7.2-008 2008-09-01 15:33:17 +00:00
8 changed files with 86 additions and 41 deletions

View File

@@ -1351,11 +1351,12 @@ set_curbuf(buf, action)
}
}
#ifdef FEAT_AUTOCMD
/* An autocommand may have deleted "buf", already entered it (e.g., when
* it did ":bunload") or aborted the script processing! */
# ifdef FEAT_EVAL
/* An autocommand may have deleted buf or aborted the script processing! */
if (buf_valid(buf) && !aborting())
if (buf_valid(buf) && buf != curbuf && !aborting())
# else
if (buf_valid(buf)) /* an autocommand may have deleted buf! */
if (buf_valid(buf) && buf != curbuf)
# endif
#endif
enter_buffer(buf);

View File

@@ -1256,23 +1256,26 @@ skip_expr(pp)
/*
* Top level evaluation function, returning a string.
* When "convert" is TRUE convert a List into a sequence of lines and convert
* a Float to a String.
* Return pointer to allocated memory, or NULL for failure.
*/
char_u *
eval_to_string(arg, nextcmd, dolist)
eval_to_string(arg, nextcmd, convert)
char_u *arg;
char_u **nextcmd;
int dolist; /* turn List into sequence of lines */
int convert;
{
typval_T tv;
char_u *retval;
garray_T ga;
char_u numbuf[NUMBUFLEN];
if (eval0(arg, &tv, nextcmd, TRUE) == FAIL)
retval = NULL;
else
{
if (dolist && tv.v_type == VAR_LIST)
if (convert && tv.v_type == VAR_LIST)
{
ga_init2(&ga, (int)sizeof(char), 80);
if (tv.vval.v_list != NULL)
@@ -1280,6 +1283,13 @@ eval_to_string(arg, nextcmd, dolist)
ga_append(&ga, NUL);
retval = (char_u *)ga.ga_data;
}
#ifdef FEAT_FLOAT
else if (convert && tv.v_type == VAR_FLOAT)
{
vim_snprintf((char *)numbuf, NUMBUFLEN, "%g", tv.vval.v_float);
retval = vim_strsave(numbuf);
}
#endif
else
retval = vim_strsave(get_tv_string(&tv));
clear_tv(&tv);

View File

@@ -3145,8 +3145,8 @@ do_source(fname, check_other, is_vimrc)
verbose_leave();
}
#ifdef STARTUPTIME
vim_snprintf(IObuff, IOSIZE, "sourcing %s", fname);
time_msg(IObuff, &tv_start);
vim_snprintf((char *)IObuff, IOSIZE, "sourcing %s", fname);
time_msg((char *)IObuff, &tv_start);
time_pop(&tv_rel);
#endif

View File

@@ -136,6 +136,9 @@ EXTERN_C void boot_DynaLoader __ARGS((pTHX_ CV*));
# define Perl_newXS_flags dll_Perl_newXS_flags
#endif
# define Perl_sv_free dll_Perl_sv_free
# if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
# define Perl_sv_free2 dll_Perl_sv_free2
# endif
# define Perl_sv_isa dll_Perl_sv_isa
# define Perl_sv_magic dll_Perl_sv_magic
# define Perl_sv_setiv dll_Perl_sv_setiv
@@ -268,6 +271,7 @@ static SV* (*Perl_Isv_yes_ptr)(register PerlInterpreter*);
static void (*boot_DynaLoader)_((pTHX_ CV*));
#if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
static void (*Perl_sv_free2)(pTHX_ SV*);
static void (*Perl_sys_init3)(int* argc, char*** argv, char*** env);
static void (*Perl_sys_term)(void);
static SV** (*Perl_ISv_ptr)(register PerlInterpreter*);
@@ -367,6 +371,7 @@ static struct {
{"Perl_TXpv_ptr", (PERL_PROC*)&Perl_TXpv_ptr},
{"Perl_Tna_ptr", (PERL_PROC*)&Perl_Tna_ptr},
#else
{"Perl_sv_free2", (PERL_PROC*)&Perl_sv_free2},
{"Perl_sys_init3", (PERL_PROC*)&Perl_sys_init3},
{"Perl_sys_term", (PERL_PROC*)&Perl_sys_term},
{"Perl_ISv_ptr", (PERL_PROC*)&Perl_ISv_ptr},

View File

@@ -2540,7 +2540,6 @@ utf_head_off(base, p)
return (int)(p - q);
}
#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Copy a character from "*fp" to "*tp" and advance the pointers.
*/
@@ -2555,7 +2554,6 @@ mb_copy_char(fp, tp)
*tp += l;
*fp += l;
}
#endif
/*
* Return the offset from "p" to the first byte of a character. When "p" is

View File

@@ -1257,7 +1257,6 @@ vim_strsave_escaped_ext(string, esc_chars, cc, bsl)
return escaped_string;
}
#if !defined(BACKSLASH_IN_FILENAME) || defined(FEAT_EVAL) || defined(PROTO)
/*
* Return TRUE when 'shell' has "csh" in the tail.
*/
@@ -1266,9 +1265,7 @@ csh_like_shell()
{
return (strstr((char *)gettail(p_sh), "csh") != NULL);
}
#endif
#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Escape "string" for use as a shell argument with system().
* This uses single quotes, except when we know we need to use double qoutes
@@ -1391,7 +1388,6 @@ vim_strsave_shellescape(string, do_special)
return escaped_string;
}
#endif
/*
* Like vim_strsave(), but make all characters uppercase.

View File

@@ -5469,6 +5469,11 @@ nv_ident(cap)
STRCPY(buf, "he! ");
else
{
/* An external command will probably use an argument starting
* with "-" as an option. To avoid trouble we skip the "-". */
while (*ptr == '-')
++ptr;
/* When a count is given, turn it into a range. Is this
* really what we want? */
isman = (STRCMP(kp, "man") == 0);
@@ -5511,37 +5516,57 @@ nv_ident(cap)
/*
* Now grab the chars in the identifier
*/
if (cmdchar == '*')
aux_ptr = (char_u *)(p_magic ? "/.*~[^$\\" : "/^$\\");
else if (cmdchar == '#')
aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\");
else if (cmdchar == 'K' && !kp_help)
aux_ptr = (char_u *)" \t\\\"|!";
else
/* Don't escape spaces and Tabs in a tag with a backslash */
aux_ptr = (char_u *)"\\|\"";
p = buf + STRLEN(buf);
while (n-- > 0)
if (cmdchar == 'K' && !kp_help)
{
/* put a backslash before \ and some others */
if (vim_strchr(aux_ptr, *ptr) != NULL)
*p++ = '\\';
#ifdef FEAT_MBYTE
/* When current byte is a part of multibyte character, copy all bytes
* of that character. */
if (has_mbyte)
/* Escape the argument properly for a shell command */
p = vim_strsave_shellescape(ptr, TRUE);
if (p == NULL)
{
int i;
int len = (*mb_ptr2len)(ptr) - 1;
for (i = 0; i < len && n >= 1; ++i, --n)
*p++ = *ptr++;
vim_free(buf);
return;
}
#endif
*p++ = *ptr++;
buf = (char_u *)vim_realloc(buf, STRLEN(buf) + STRLEN(p) + 1);
if (buf == NULL)
{
vim_free(buf);
vim_free(p);
return;
}
STRCAT(buf, p);
vim_free(p);
}
else
{
if (cmdchar == '*')
aux_ptr = (char_u *)(p_magic ? "/.*~[^$\\" : "/^$\\");
else if (cmdchar == '#')
aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\");
else
/* Don't escape spaces and Tabs in a tag with a backslash */
aux_ptr = (char_u *)"\\|\"\n*?[";
p = buf + STRLEN(buf);
while (n-- > 0)
{
/* put a backslash before \ and some others */
if (vim_strchr(aux_ptr, *ptr) != NULL)
*p++ = '\\';
#ifdef FEAT_MBYTE
/* When current byte is a part of multibyte character, copy all
* bytes of that character. */
if (has_mbyte)
{
int i;
int len = (*mb_ptr2len)(ptr) - 1;
for (i = 0; i < len && n >= 1; ++i, --n)
*p++ = *ptr++;
}
#endif
*p++ = *ptr++;
}
*p = NUL;
}
*p = NUL;
/*
* Execute the command.

View File

@@ -676,6 +676,16 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
12,
/**/
11,
/**/
10,
/**/
9,
/**/
8,
/**/
7,
/**/