summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-01-21 17:09:32 +0000
committerMichael Meeks <michael.meeks@suse.com>2012-01-21 17:09:32 +0000
commit96c2f2bc8093c1dbf729d3d0c4849eefb87b5ce1 (patch)
treed4717936f45eb873784bb8a16a91a645de68de6b
parent59cefd339d0c3fcde5b614d7f142a957397672d9 (diff)
android: remove nonsensical write to file buffer during readLine
also expose in-memory file method for unit testing.
-rw-r--r--sal/inc/osl/detail/file.h3
-rw-r--r--sal/osl/unx/file.cxx8
-rw-r--r--sal/util/sal.map1
3 files changed, 8 insertions, 4 deletions
diff --git a/sal/inc/osl/detail/file.h b/sal/inc/osl/detail/file.h
index e6a6671dcb29..8e2c910f258c 100644
--- a/sal/inc/osl/detail/file.h
+++ b/sal/inc/osl/detail/file.h
@@ -54,6 +54,9 @@ SAL_DLLPUBLIC oslFileError SAL_CALL osl_getFileOSHandle(
oslFileHandle Handle,
sal_IntPtr *piFileHandle );
+/* for unit testing. */
+SAL_DLLPUBLIC oslFileError SAL_CALL osl_openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandle );
+
#if defined __cplusplus
}
#endif
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 84cb2f006811..7dd557a7cef5 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -699,8 +699,8 @@ oslFileError FileHandle_Impl::readLineAt (
}
if (state != LINE_STATE_BEGIN)
{
- /* store (and eat) the newline char */
- m_buffer[curpos] = 0x0A, curpos++;
+ /* skip the newline char */
+ curpos++;
/* flush buffer to sequence */
result = writeSequence_Impl (
@@ -854,9 +854,9 @@ static int osl_file_queryLocking (sal_uInt32 uFlags)
return 0;
}
-#ifdef ANDROID
+#ifdef UNX
-static oslFileError
+oslFileError
SAL_CALL osl_openMemoryAsFile( void *address, size_t size, oslFileHandle *pHandle )
{
oslFileError eRet;
diff --git a/sal/util/sal.map b/sal/util/sal.map
index 1e9753b4845d..472ea8f45614 100644
--- a/sal/util/sal.map
+++ b/sal/util/sal.map
@@ -649,6 +649,7 @@ PRIVATE_textenc.1 { # LibreOffice 3.6
PRIVATE_file.1 { # LibreOffice 3.6
global:
osl_getFileOSHandle;
+ osl_openMemoryAsFile;
};
# Unique libstdc++ symbols: