diff options
author | Max Kellermann <max@musicpd.org> | 2017-01-23 19:34:55 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-01-23 19:34:55 +0100 |
commit | 44dd9af27659dbf44831a2fa099505219adb7ad6 (patch) | |
tree | d5986fe7c2a2fdab037edc7b6709342b23f0fe30 /src/lib | |
parent | d3013d4f8c277a3945a78a276e73322fe982ccd8 (diff) |
lib/upnp/Util: pass single delimiter character to stringToTokens()
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/upnp/Util.cxx | 6 | ||||
-rw-r--r-- | src/lib/upnp/Util.hxx | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/upnp/Util.cxx b/src/lib/upnp/Util.cxx index f433af6f1..61c11719d 100644 --- a/src/lib/upnp/Util.cxx +++ b/src/lib/upnp/Util.cxx @@ -71,11 +71,11 @@ path_getfather(const std::string &s) std::list<std::string> stringToTokens(const std::string &str, - const char *delims) + const char delim) { std::list<std::string> tokens; - std::string::size_type startPos = str.find_first_not_of(delims, 0); + std::string::size_type startPos = str.find_first_not_of(delim, 0); // Skip initial delims, return empty if this eats all. if (startPos == std::string::npos) @@ -83,7 +83,7 @@ stringToTokens(const std::string &str, while (startPos < str.size()) { // Find next delimiter or end of string (end of token) - auto pos = str.find_first_of(delims, startPos); + auto pos = str.find_first_of(delim, startPos); // Add token to the vector and adjust start if (pos == std::string::npos) { diff --git a/src/lib/upnp/Util.hxx b/src/lib/upnp/Util.hxx index 4123a076d..b935611ec 100644 --- a/src/lib/upnp/Util.hxx +++ b/src/lib/upnp/Util.hxx @@ -33,8 +33,7 @@ path_getfather(const std::string &s); gcc_pure std::list<std::string> -stringToTokens(const std::string &str, - const char *delims = "/"); +stringToTokens(const std::string &str, char delim); template <class T> bool |