From b7bb7895bf3bf0a4790ec76de7045e1e414cc7a1 Mon Sep 17 00:00:00 2001 From: Konstantin Isakov Date: Sat, 4 Apr 2009 16:32:40 +0000 Subject: [PATCH] *! Fixed a bug where leading blanks in a filename would hang the program while determining the corresponding file type. --- src/filetype.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/filetype.cc b/src/filetype.cc index b757bf60..284933a0 100644 --- a/src/filetype.cc +++ b/src/filetype.cc @@ -18,7 +18,8 @@ string simplifyString( string const & str ) size_t beginPos = 0; - while( beginPos < str.size() && isblank( str[ beginPos ] ) ); + while( beginPos < str.size() && isblank( str[ beginPos ] ) ) + ++beginPos; size_t endPos = str.size();