summaryrefslogtreecommitdiff
path: root/sal/osl/unx/uunxapi.cxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-12-19 15:16:41 +0200
committerTor Lillqvist <tml@collabora.com>2013-12-19 16:17:57 +0200
commitdf500ead2914c76983db8d40e2bad21c903b7ee9 (patch)
treec5daca21c9b9d9e797b234622b484717580c84fe /sal/osl/unx/uunxapi.cxx
parenta4b5fdc2942d45c5c8aad5d77ca3346bd0862ec3 (diff)
Fix crash on Android
Fallout from 0e6a2601b39cbadaff7f7506ba9e804f108060db ("Convert code that calls OUString::getStr()[] to use the [] operator"). The code was a bit silly and "hand-optimized" in the first place so no wonder a bug was introduced accidentally in that commit. Make it simpler and more obvious. Change-Id: Idafb1c0741289e915dfbaa108383a926321764d2
Diffstat (limited to 'sal/osl/unx/uunxapi.cxx')
-rw-r--r--sal/osl/unx/uunxapi.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx
index a9f3c5ff6d2a..8d495f20c280 100644
--- a/sal/osl/unx/uunxapi.cxx
+++ b/sal/osl/unx/uunxapi.cxx
@@ -128,9 +128,7 @@ int access_u(const rtl_uString* pustrPath, int mode)
{
rtl::OString fn = OUStringToOString(pustrPath);
#ifdef ANDROID
- if (fn.startsWith("/assets") &&
- (fn[sizeof("/assets")-1] == '\0' ||
- fn[sizeof("/assets")-1] == '/'))
+ if (fn == "/assets" || fn.startsWith("/assets/"))
{
struct stat stat;
if (lo_apk_lstat(fn.getStr(), &stat) == -1)
@@ -161,9 +159,7 @@ sal_Bool realpath_u(const rtl_uString* pustrFileName, rtl_uString** ppustrResolv
{
rtl::OString fn = OUStringToOString(pustrFileName);
#ifdef ANDROID
- if (fn.startsWith("/assets") &&
- (fn[sizeof("/assets")-1] == '\0' ||
- fn[sizeof("/assets")-1] == '/'))
+ if (fn == "/assets" || fn.startsWith("/assets/"))
{
if (access_u(pustrFileName, F_OK) == -1)
return sal_False;