Change flExtension() to return the empty string if there is no extension.

This should fix #15909, thanks to raorn for investigating.
This commit is contained in:
Alex V. Myltsev 2008-08-27 21:51:47 +04:00 committed by Alex V. Myltsev
parent c2a7ba45e0
commit f2922999ae

View File

@ -169,14 +169,14 @@ string flNotFile(string File)
return string(File,0,Res);
}
/*}}}*/
// flExtension - Return the extension for the file /*{{{*/
// flExtension - Return the extension for the file or "" if none /*{{{*/
// ---------------------------------------------------------------------
/* */
string flExtension(string File)
{
string::size_type Res = File.rfind('.');
if (Res == string::npos)
return File;
return string();
Res++;
return string(File,Res,Res - File.length());
}