[Libreoffice-commits] .: tools/source
Stephan Bergmann
sbergmann at kemper.freedesktop.org
Tue Nov 22 03:15:51 PST 2011
tools/source/fsys/dirent.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 5de43a57cde537507de607c31573a31e90b4c5c8
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Nov 22 12:15:39 2011 +0100
Avoid rtl::OString::copy(getLength() + 1).
diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx
index 315be4e..647dcfc 100644
--- a/tools/source/fsys/dirent.cxx
+++ b/tools/source/fsys/dirent.cxx
@@ -1805,7 +1805,8 @@ FSysError DirEntry::ImpParseUnixName( const rtl::OString& rPfad, FSysPathStyle e
}
// den Restpfad bestimmen
- aPfad = aPfad.copy(nPos + 1);
+ aPfad = nPos < aPfad.getLength()
+ ? aPfad.copy(nPos + 1) : rtl::OString();
while ( aPfad.getLength() && ( aPfad[0] == '/' ) )
aPfad = aPfad.copy(1);
}
More information about the Libreoffice-commits
mailing list