|
From: Yoda-JM <yo...@us...> - 2010-08-15 14:52:52
|
Module: performous
Branch: joinmenu
Commit: e94fa6f85f83b4490ec5a6873e5a4d8d38277677
Author: Tapio Vierros <tap...@gm...>
Date: Sun Jul 18 16:45:32 2010 +0300
Allow spaces before key start in key=value parser.
---
game/audio.cc | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index 3d34946..b92264f 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -29,11 +29,11 @@ namespace {
continue;
}
// Space in key (bad)
- if (st[i] == ' ' && parsing_key)
- throw std::logic_error("Error: Space in key in string: " + st);
+ if (st[i] == ' ' && parsing_key && !key.empty())
+ throw std::logic_error("Space in key in string: " + st);
// Value start
if (st[i] == '=' && !inside_quotes) {
- if (key.empty()) throw std::logic_error("Error: Empty key in string: " + st);
+ if (key.empty()) throw std::logic_error("Empty key in string: " + st);
parsing_key = false;
continue;
}
|