From 87a8a3e22f7d25c88c344cd195bde58d237716a0 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 2 Mar 2015 21:48:37 +0100 Subject: PlaylistFile: move memchr() call to class Path --- src/fs/Path.hxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/fs/Path.hxx') diff --git a/src/fs/Path.hxx b/src/fs/Path.hxx index 8126a668a..962518896 100644 --- a/src/fs/Path.hxx +++ b/src/fs/Path.hxx @@ -122,6 +122,16 @@ public: return value; } + /** + * Does the path contain a newline character? (Which is + * usually rejected by MPD because its protocol cannot + * transfer newline characters). + */ + gcc_pure + bool HasNewline() const { + return strchr(value, '\n') != nullptr; + } + /** * Convert the path to UTF-8. * Returns empty string on error or if this instance is "nulled" -- cgit v1.2.3