codemaker: fix^2 invalid string index access

...originally the past-the-end checks in destination where always true, and thus
happend to work as intended for empty destionation, but
614e04019a broke that, so calling cppumaker w/o
-O was broken now.

Change-Id: I8d41dfe8d4c12e4a73a9782d4d5e7c9fa4d9df81
This commit is contained in:
Stephan Bergmann
2014-01-10 10:16:48 +01:00
parent 16ae82c772
commit d320760dc1

View File

@@ -87,11 +87,8 @@ OString createFileNameFromType( const OString& destination,
length += prefix.getLength() + type.getLength() + postfix.getLength();
sal_Bool withSeparator = sal_False;
if (!destination.isEmpty() &&
destination[destination.getLength() - 1] != '\\' &&
destination[destination.getLength() - 1] != '/' &&
type[0] != '\\' &&
type[0] != '/')
if (!(destination.endsWith("\\") || destination.endsWith("/"))
&& !(type.startsWith("\\") || type.startsWith("/")))
{
length++;
withSeparator = sal_True;