diff options
author | Tor Lillqvist <tlillqvist@suse.com> | 2012-01-04 09:06:16 +0200 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-01-04 15:27:54 +0200 |
commit | d4b0e98d50916e9a0a2810bb0484bdeb76214254 (patch) | |
tree | c301f1c9386cdbc47f32884d50dc0aa5246a2995 /sal | |
parent | Page Break: show the page break right under the mouse (diff) | |
download | core-d4b0e98d50916e9a0a2810bb0484bdeb76214254.tar.gz core-d4b0e98d50916e9a0a2810bb0484bdeb76214254.zip |
Probably using a local rtl::OString is better
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/uunxapi.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx index 3c2067bb318d..61fac80895e8 100644 --- a/sal/osl/unx/uunxapi.cxx +++ b/sal/osl/unx/uunxapi.cxx @@ -84,14 +84,14 @@ int access_u(const rtl_uString* pustrPath, int mode) { #ifndef MACOSX // not MACOSX - const char *path = OUStringToOString(pustrPath).getStr(); + rtl::OString fn = OUStringToOString(pustrPath); #ifdef ANDROID - if (strncmp(path, "/assets", sizeof("/assets")-1) == 0 && - (path[sizeof("/assets")-1] == '\0' || - path[sizeof("/assets")-1] == '/')) + if (strncmp(fn.getStr(), "/assets", sizeof("/assets")-1) == 0 && + (fn.getStr()[sizeof("/assets")-1] == '\0' || + fn.getStr()[sizeof("/assets")-1] == '/')) { struct stat stat; - if (lo_apk_lstat(path, &stat) == -1) + if (lo_apk_lstat(fn.getStr(), &stat) == -1) return -1; if (mode & W_OK) { @@ -101,7 +101,7 @@ return 0; } #endif - return access(path, mode); + return access(fn.getStr(), mode); #else return access(macxp_resolveAliasAndConvert(pustrPath).getStr(), mode); #endif @@ -135,14 +135,14 @@ int lstat_u(const rtl_uString* pustrPath, struct stat* buf) { #ifndef MACOSX // not MACOSX - const char *path = OUStringToOString(pustrPath).getStr(); + rtl::OString fn = OUStringToOString(pustrPath); #ifdef ANDROID - if (strncmp(path, "/assets", sizeof("/assets")-1) == 0 && - (path[sizeof("/assets")-1] == '\0' || - path[sizeof("/assets")-1] == '/')) - return lo_apk_lstat(path, buf); + if (strncmp(fn.getStr(), "/assets", sizeof("/assets")-1) == 0 && + (fn.getStr()[sizeof("/assets")-1] == '\0' || + fn.getStr()[sizeof("/assets")-1] == '/')) + return lo_apk_lstat(fn.getStr(), buf); #endif - return lstat(path, buf); + return lstat(fn.getStr(), buf); #else return lstat(macxp_resolveAliasAndConvert(pustrPath).getStr(), buf); #endif |