0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.2-238

This commit is contained in:
Bram Moolenaar
2009-07-22 12:28:17 +00:00
parent 20de1c20e6
commit 363cb67afa
4 changed files with 29 additions and 3 deletions

View File

@@ -403,8 +403,9 @@ struct vimoption
#define P_NUM 0x02 /* the option is numeric */ #define P_NUM 0x02 /* the option is numeric */
#define P_STRING 0x04 /* the option is a string */ #define P_STRING 0x04 /* the option is a string */
#define P_ALLOCED 0x08 /* the string option is in allocated memory, #define P_ALLOCED 0x08 /* the string option is in allocated memory,
must use vim_free() when assigning new must use free_string_option() when
value. Not set if default is the same. */ assigning new value. Not set if default is
the same. */
#define P_EXPAND 0x10 /* environment expansion. NOTE: P_EXPAND can #define P_EXPAND 0x10 /* environment expansion. NOTE: P_EXPAND can
never be used for local or hidden options! */ never be used for local or hidden options! */
#define P_NODEFAULT 0x40 /* don't set to default value */ #define P_NODEFAULT 0x40 /* don't set to default value */
@@ -8926,6 +8927,28 @@ free_termoptions()
clear_termcodes(); clear_termcodes();
} }
/*
* Free the string for one term option, if it was allocated.
* Set the string to empty_option and clear allocated flag.
* "var" points to the option value.
*/
void
free_one_termoption(var)
char_u *var;
{
struct vimoption *p;
for (p = &options[0]; p->fullname != NULL; p++)
if (p->var == var)
{
if (p->flags & P_ALLOCED)
free_string_option(*(char_u **)(p->var));
*(char_u **)(p->var) = empty_option;
p->flags &= ~P_ALLOCED;
break;
}
}
/* /*
* Set the terminal option defaults to the current value. * Set the terminal option defaults to the current value.
* Used after setting the terminal name. * Used after setting the terminal name.

View File

@@ -29,6 +29,7 @@ int makeset __ARGS((FILE *fd, int opt_flags, int local_only));
int makefoldset __ARGS((FILE *fd)); int makefoldset __ARGS((FILE *fd));
void clear_termoptions __ARGS((void)); void clear_termoptions __ARGS((void));
void free_termoptions __ARGS((void)); void free_termoptions __ARGS((void));
void free_one_termoption __ARGS((char_u *var));
void set_term_defaults __ARGS((void)); void set_term_defaults __ARGS((void));
void comp_col __ARGS((void)); void comp_col __ARGS((void));
char_u *get_equalprg __ARGS((void)); char_u *get_equalprg __ARGS((void));

View File

@@ -2881,7 +2881,7 @@ ttest(pairs)
/* if 'Sb' and 'AB' are not defined, reset "Co" */ /* if 'Sb' and 'AB' are not defined, reset "Co" */
if (*T_CSB == NUL && *T_CAB == NUL) if (*T_CSB == NUL && *T_CAB == NUL)
T_CCO = empty_option; free_one_termoption(T_CCO);
/* Set 'weirdinvert' according to value of 't_xs' */ /* Set 'weirdinvert' according to value of 't_xs' */
p_wiv = (*T_XS != NUL); p_wiv = (*T_XS != NUL);

View File

@@ -676,6 +676,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
238,
/**/ /**/
237, 237,
/**/ /**/