diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-08-27 19:36:36 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-08-28 09:17:26 -0700 |
commit | 4e89085e113c63de223cbcfe78cbff1b60f95199 (patch) | |
tree | bb4acecd7d338633bd84dbb8a00f38df71972013 /src/common | |
parent | 61dc59e612df9c6d2b3a3f4f27f1cb88b6fca98b (diff) | |
download | tmwa-4e89085e113c63de223cbcfe78cbff1b60f95199.tar.gz tmwa-4e89085e113c63de223cbcfe78cbff1b60f95199.tar.bz2 tmwa-4e89085e113c63de223cbcfe78cbff1b60f95199.tar.xz tmwa-4e89085e113c63de223cbcfe78cbff1b60f95199.zip |
Fix bug with mapnames being falsy
Fixes #7
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/mmo.hpp | 2 | ||||
-rw-r--r-- | src/common/strings.hpp | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/common/mmo.hpp b/src/common/mmo.hpp index 89ff50a..0d3403c 100644 --- a/src/common/mmo.hpp +++ b/src/common/mmo.hpp @@ -65,7 +65,7 @@ public: MapName(VString<15> v) : _impl(v.oislice_h(std::find(v.begin(), v.end(), '.'))) {} iterator begin() const { return &*_impl.begin(); } - iterator end() const { return &*_impl.begin(); } + iterator end() const { return &*_impl.end(); } const char *c_str() const { return _impl.c_str(); } operator FString() const { return _impl; } diff --git a/src/common/strings.hpp b/src/common/strings.hpp index ead3f52..0b10570 100644 --- a/src/common/strings.hpp +++ b/src/common/strings.hpp @@ -119,6 +119,10 @@ namespace strings operator bool() const { return size(); } bool operator !() const { return !size(); } + // the existence of this has led to bugs + // it's not really sane from a unicode perspective anyway ... + // prefer startswith or extract + __attribute__((deprecated)) char operator[](size_t i) const { return begin()[i]; } char front() const { return *begin(); } char back() const { return end()[-1]; } |