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

updated for version 7.0169

This commit is contained in:
Bram Moolenaar
2005-12-13 20:02:15 +00:00
parent 900b4d77f0
commit b0bf8580c3
6 changed files with 370 additions and 200 deletions

View File

@@ -4549,6 +4549,11 @@ getargopt(eap)
arg += 8;
pp = &eap->force_enc;
}
else if (STRNCMP(arg, "bad", 3) == 0)
{
arg += 3;
pp = &eap->bad_char;
}
#endif
if (pp == NULL || *arg != '=')
@@ -4568,12 +4573,26 @@ getargopt(eap)
return FAIL;
#ifdef FEAT_MBYTE
}
else
else if (pp == &eap->force_enc)
{
/* Make 'fileencoding' lower case. */
for (p = eap->cmd + eap->force_enc; *p != NUL; ++p)
*p = TOLOWER_ASC(*p);
}
else
{
/* Check ++bad= argument. Must be a single-byte character, "keep" or
* "drop". */
p = eap->cmd + eap->bad_char;
if (STRICMP(p, "keep") == 0)
eap->bad_char = BAD_KEEP;
else if (STRICMP(p, "drop") == 0)
eap->bad_char = BAD_DROP;
else if (MB_BYTE2LEN(*p) == 1 && p[1] == NUL)
eap->bad_char = *p;
else
return FAIL;
}
#endif
return OK;