lint: problems with default in switch statements

This commit is contained in:
Kurtis Rader
2016-11-02 18:29:14 -07:00
parent 72e687296b
commit f05fe4e292
11 changed files with 44 additions and 39 deletions

View File

@@ -1146,31 +1146,35 @@ bool completer_t::try_complete_variable(const wcstring &str) {
}
switch (c) {
case L'\\':
case L'\\': {
in_pos++;
break;
case L'$':
}
case L'$': {
if (mode == e_unquoted || mode == e_double_quoted) {
variable_start = in_pos;
}
break;
case L'\'':
}
case L'\'': {
if (mode == e_single_quoted) {
mode = e_unquoted;
} else if (mode == e_unquoted) {
mode = e_single_quoted;
}
break;
case L'"':
}
case L'"': {
if (mode == e_double_quoted) {
mode = e_unquoted;
} else if (mode == e_unquoted) {
mode = e_double_quoted;
}
break;
}
default: {
break; // all other chars ignored here
}
}
}