From ad705bd01ed5b993544042cd5d42db985235878b Mon Sep 17 00:00:00 2001 From: Abs62 Date: Mon, 19 Mar 2018 17:42:30 +0300 Subject: [PATCH] Fix isNameOf...() functions for case of string contains whitespaces only --- filetype.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/filetype.cc b/filetype.cc index 9eaad6f6..40f36285 100644 --- a/filetype.cc +++ b/filetype.cc @@ -27,6 +27,9 @@ string simplifyString( string const & str ) while( endPos && Utf8::isspace( str[ endPos - 1 ] ) ) --endPos; + if( endPos <= beginPos ) + return string(); + result.reserve( endPos - beginPos ); while( beginPos < endPos )