summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2008-06-24 22:09:24 +0000
committerBram Moolenaar <Bram@vim.org>2008-06-24 22:09:24 +0000
commitc1a11ed54c7974b74be38f2aef6a200d7cfc878e (patch)
treecbd3d302d09444426d21d905b56dbfafb6cf2497 /src/option.c
parent446cb837a017fc1c1b144cb5c2a35cb90abfbbcf (diff)
downloadvim-git-c1a11ed54c7974b74be38f2aef6a200d7cfc878e.tar.gz
updated for version 7.2a
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/src/option.c b/src/option.c
index 885c547b6..8543b48e0 100644
--- a/src/option.c
+++ b/src/option.c
@@ -2846,7 +2846,6 @@ static char *(p_bsdir_values[]) = {"current", "last", "buffer", NULL};
#ifdef FEAT_SCROLLBIND
static char *(p_scbopt_values[]) = {"ver", "hor", "jump", NULL};
#endif
-static char *(p_swb_values[]) = {"useopen", "usetab", "split", NULL};
static char *(p_debug_values[]) = {"msg", "throw", "beep", NULL};
#ifdef FEAT_VERTSPLIT
static char *(p_ead_values[]) = {"both", "ver", "hor", NULL};
@@ -3276,20 +3275,8 @@ set_init_1()
}
# else
# ifdef MACOS_CONVERT
- if (mch_getenv((char_u *)"LANG") == NULL)
- {
- char buf[20];
- if (LocaleRefGetPartString(NULL,
- kLocaleLanguageMask | kLocaleLanguageVariantMask |
- kLocaleRegionMask | kLocaleRegionVariantMask,
- sizeof buf, buf) == noErr && *buf)
- {
- vim_setenv((char_u *)"LANG", (char_u *)buf);
-# ifdef HAVE_LOCALE_H
- setlocale(LC_ALL, "");
-# endif
- }
- }
+ /* Moved to os_mac_conv.c to avoid dependency problems. */
+ mac_lang_init();
# endif
# endif
@@ -4599,8 +4586,7 @@ do_set(arg, opt_flags)
else
{
i = (int)STRLEN(newval);
- mch_memmove(newval + i + comma, origval,
- STRLEN(origval) + 1);
+ STRMOVE(newval + i + comma, origval);
}
if (comma)
newval[i] = ',';
@@ -4629,8 +4615,7 @@ do_set(arg, opt_flags)
++i;
}
}
- mch_memmove(newval + (s - origval), s + i,
- STRLEN(s + i) + 1);
+ STRMOVE(newval + (s - origval), s + i);
}
}
@@ -4641,7 +4626,7 @@ do_set(arg, opt_flags)
if ((!(flags & P_COMMA) || *s != ',')
&& vim_strchr(s + 1, *s) != NULL)
{
- mch_memmove(s, s + 1, STRLEN(s));
+ STRMOVE(s, s + 1);
--s;
}
}
@@ -6230,7 +6215,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
/* 'switchbuf' */
else if (varp == &p_swb)
{
- if (check_opt_strings(p_swb, p_swb_values, TRUE) != OK)
+ if (opt_strings_flags(p_swb, p_swb_values, &swb_flags, TRUE) != OK)
errmsg = e_invarg;
}
@@ -7183,7 +7168,7 @@ set_bool_option(opt_idx, varp, value, opt_flags)
}
/* remove 's' from p_shm */
else if (!p_terse && p != NULL)
- mch_memmove(p, p + 1, STRLEN(p));
+ STRMOVE(p, p + 1);
}
/* when 'paste' is set or reset also change other options */
@@ -8177,7 +8162,8 @@ get_option_value(name, numval, stringval, opt_flags)
{
#ifdef FEAT_CRYPT
/* never return the value of the crypt key */
- if ((char_u **)varp == &curbuf->b_p_key)
+ if ((char_u **)varp == &curbuf->b_p_key
+ && **(char_u **)(varp) != NUL)
*stringval = vim_strsave((char_u *)"*****");
else
#endif
@@ -10032,7 +10018,7 @@ ExpandOldSetting(num_file, file)
&& (options[expand_option_idx].flags & P_EXPAND)
&& vim_isfilec(var[2])
&& (var[2] != '\\' || (var == buf && var[4] != '\\')))
- mch_memmove(var, var + 1, STRLEN(var));
+ STRMOVE(var, var + 1);
#endif
*file[0] = buf;