mirror of
https://github.com/KingDuckZ/kamokan.git
synced 2025-06-07 00:51:41 +00:00
Fix wrong code that wasn't splitting on ? correctly
This commit is contained in:
parent
8795977da9
commit
a56014bed8
1 changed files with 3 additions and 6 deletions
|
@ -25,6 +25,7 @@
|
||||||
#include <srchilite/langmap.h>
|
#include <srchilite/langmap.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
namespace tawashi {
|
namespace tawashi {
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -36,13 +37,9 @@ namespace tawashi {
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::string_view get_pastie_name (boost::string_view parRequest) {
|
boost::string_view get_pastie_name (boost::string_view parRequest) {
|
||||||
using boost::string_view;
|
|
||||||
|
|
||||||
auto it_found = std::find(parRequest.begin(), parRequest.end(), '?');
|
auto it_found = std::find(parRequest.begin(), parRequest.end(), '?');
|
||||||
if (parRequest.end() == it_found)
|
assert(it_found - parRequest.begin() <= parRequest.size());
|
||||||
return parRequest.substr(0, it_found - parRequest.begin());
|
return parRequest.substr(0, it_found - parRequest.begin());
|
||||||
else
|
|
||||||
return parRequest;
|
|
||||||
}
|
}
|
||||||
} //unnamed namespace
|
} //unnamed namespace
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue