mirror of
https://github.com/KingDuckZ/kamokan.git
synced 2024-11-23 00:33:44 +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 <sstream>
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
||||
namespace tawashi {
|
||||
namespace {
|
||||
|
@ -36,13 +37,9 @@ namespace tawashi {
|
|||
}
|
||||
|
||||
boost::string_view get_pastie_name (boost::string_view parRequest) {
|
||||
using boost::string_view;
|
||||
|
||||
auto it_found = std::find(parRequest.begin(), parRequest.end(), '?');
|
||||
if (parRequest.end() == it_found)
|
||||
return parRequest.substr(0, it_found - parRequest.begin());
|
||||
else
|
||||
return parRequest;
|
||||
assert(it_found - parRequest.begin() <= parRequest.size());
|
||||
return parRequest.substr(0, it_found - parRequest.begin());
|
||||
}
|
||||
} //unnamed namespace
|
||||
|
||||
|
|
Loading…
Reference in a new issue