mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-12-22 04:11:18 +00:00
fusee: accept spaces inside ini values (we still left/right strip)
This commit is contained in:
parent
4ad300c33c
commit
443271de35
1 changed files with 6 additions and 2 deletions
|
@ -69,7 +69,7 @@ namespace ams::nxboot {
|
|||
TrailingSpace,
|
||||
};
|
||||
|
||||
char *sec_start, *key_start, *val_start;
|
||||
char *sec_start, *key_start, *val_start, *val_end;
|
||||
IniSection *cur_sec = nullptr;
|
||||
|
||||
State state = State::Newline;
|
||||
|
@ -144,13 +144,15 @@ namespace ams::nxboot {
|
|||
state = State::Newline;
|
||||
} else if (!IsWhiteSpace(c)) {
|
||||
val_start = buffer + i;
|
||||
val_end = buffer + i + 1;
|
||||
|
||||
state = State::Value;
|
||||
}
|
||||
break;
|
||||
case State::Value:
|
||||
if (IsWhiteSpace(c) || c == '\n') {
|
||||
if (c == '\r' || c == '\n') {
|
||||
buffer[i] = '\x00';
|
||||
*val_end = '\x00';
|
||||
|
||||
auto *entry = AllocateObject<IniKeyValueEntry>();
|
||||
entry->key = key_start;
|
||||
|
@ -159,6 +161,8 @@ namespace ams::nxboot {
|
|||
cur_sec->kv_list.push_back(*entry);
|
||||
|
||||
state = (c == '\n') ? State::Newline : State::TrailingSpace;
|
||||
} else if (c != ' ') {
|
||||
val_end = buffer + i + 1;
|
||||
}
|
||||
break;
|
||||
case State::TrailingSpace:
|
||||
|
|
Loading…
Reference in a new issue