summaryrefslogtreecommitdiff
path: root/idl/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2023-02-08 15:45:45 +0100
committerStephan Bergmann <sbergman@redhat.com>2023-02-08 16:03:33 +0000
commitd7100211be8c79d00f6044e76e2102206dad9432 (patch)
treea03220c5b888234677afc062d515b660dffe8546 /idl/source
parent52d070f753228cf99e76cb5656f12181fc0a397c (diff)
Fix bogus uses of OUString::createFromAscii
We got a report on IRC of builds failing with > svidl: /home/dolezvo1/Downloads/libreoffice/sal/rtl/ustring.cxx:278: void rtl_uString_newFromAscii(rtl_uString**, const char*): Assertion `static_cast<unsigned char>(*pCharStr) < 0x80' failed. when the "l" in "Downloads" was some non-ASCII character (whose exact identity was apparently obscured by the used pastebin service, though). Change-Id: Ib460793b0f8aa5e8f8822fa224d67e5a622a234d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146664 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'idl/source')
-rw-r--r--idl/source/prj/command.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/idl/source/prj/command.cxx b/idl/source/prj/command.cxx
index 0c9436ce313e..e73d9615c776 100644
--- a/idl/source/prj/command.cxx
+++ b/idl/source/prj/command.cxx
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <osl/diagnose.h>
+#include <osl/thread.h>
#include <rtl/character.hxx>
#include <command.hxx>
@@ -127,12 +128,14 @@ bool ReadIdl( SvIdlWorkingBase * pDataBase, const SvCommand & rCommand )
static bool ResponseFile( std::vector<OUString> * pList, int argc, char ** argv )
{
// program name
- pList->push_back( OUString::createFromAscii(*argv) );
+ pList->push_back( OStringToOUString(*argv, osl_getThreadTextEncoding()) );
for( int i = 1; i < argc; i++ )
{
if( '@' == **(argv +i) )
{ // when @, then response file
- SvFileStream aStm( OUString::createFromAscii((*(argv +i)) +1), StreamMode::STD_READ );
+ SvFileStream aStm(
+ OStringToOUString((*(argv +i)) +1, osl_getThreadTextEncoding()),
+ StreamMode::STD_READ );
if( aStm.GetError() != ERRCODE_NONE )
return false;
@@ -158,7 +161,7 @@ static bool ResponseFile( std::vector<OUString> * pList, int argc, char ** argv
}
}
else if( argv[ i ] )
- pList->push_back( OUString::createFromAscii( argv[ i ] ) );
+ pList->push_back( OStringToOUString( argv[ i ], osl_getThreadTextEncoding() ) );
}
return true;
}