summaryrefslogtreecommitdiff
path: root/rsc
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2016-04-30 14:09:13 +0100
committerMichael Meeks <michael.meeks@collabora.com>2016-04-30 17:24:00 +0000
commit81d2967bc7be11e7efa40a296fee40210843e5e7 (patch)
treecd77052efa87a8adb94a4a91aab4e15ee086513a /rsc
parent9f363ee99482c86140f8aa7e6503e316d6d085f2 (diff)
tdf#99587 - make rsc work in tr_TR.UTF-8 locale.
toupper / tolower problematic with exciting Turkish 'i's, bug introduced: |* Ersterstellung MM 13.02.91 Change-Id: Ifa5cfa7cf28cc3948b9206cda426eb1409dd7cc7 Reviewed-on: https://gerrit.libreoffice.org/24519 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'rsc')
-rw-r--r--rsc/inc/rsctools.hxx1
-rw-r--r--rsc/source/prj/start.cxx15
-rw-r--r--rsc/source/tools/rsctools.cxx36
3 files changed, 12 insertions, 40 deletions
diff --git a/rsc/inc/rsctools.hxx b/rsc/inc/rsctools.hxx
index ca5d3fe3aefd..8cfb5b983a67 100644
--- a/rsc/inc/rsctools.hxx
+++ b/rsc/inc/rsctools.hxx
@@ -48,7 +48,6 @@ char * ResponseFile( RscPtrPtr * ppCmd, char ** ppArgv,
void RscExit( sal_uInt32 nExit );
-// Ansi-Function Forwards
int rsc_strnicmp( const char *string1, const char *string2, size_t count );
int rsc_stricmp( const char *string1, const char *string2 );
char* rsc_strdup( const char* );
diff --git a/rsc/source/prj/start.cxx b/rsc/source/prj/start.cxx
index bf496473af48..1fd4eadc2a1a 100644
--- a/rsc/source/prj/start.cxx
+++ b/rsc/source/prj/start.cxx
@@ -45,8 +45,8 @@ static bool CallPrePro( const OString& rInput,
const OString& rOutput, RscPtrPtr * pCmdLine,
bool bResponse )
{
- RscPtrPtr aNewCmdL; // Kommandozeile
- RscPtrPtr aRespCmdL; // Kommandozeile
+ RscPtrPtr aNewCmdL;
+ RscPtrPtr aRespCmdL;
RscPtrPtr * pCmdL = &aNewCmdL;
int i, nRet;
FILE* fRspFile = nullptr;
@@ -261,11 +261,11 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
{
if( !rsc_stricmp( (*ppStr) + 1, "p" )
|| !rsc_stricmp( (*ppStr) + 1, "l" ) )
- { // kein Preprozessor
+ { // no pre-processor
bPrePro = false;
}
else if( !rsc_stricmp( (*ppStr) + 1, "h" ) )
- { // Hilfe anzeigen
+ { // print help
bHelp = true;
}
else if( !rsc_strnicmp( (*ppStr) + 1, "presponse", 9 ) )
@@ -273,18 +273,17 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
bResponse = true;
}
else if( !rsc_strnicmp( (*ppStr) + 1, "fo=", 3 ) )
- { // anderer Name fuer .res-file
+ { // another Name for .res-file
aResName = (*ppStr) + 4;
}
else if( !rsc_strnicmp( (*ppStr) + 1, "fp=", 3 ) )
- { // anderer Name fuer .srs-file
+ { // another Name for .srs-file
bSetSrs = true;
aSrsName = (*ppStr);
}
}
else
{
- // Eingabedatei
aInputList.push_back( new OString(*ppStr) );
}
ppStr++;
@@ -293,7 +292,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
if( !aInputList.empty() )
{
- /* build the output file names */
+ // build the output file names
if (!aResName.getLength())
aResName = OutputFile( *aInputList[ 0 ], "res" );
if( ! bSetSrs )
diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx
index 9c206f5eedab..e043f451c3c1 100644
--- a/rsc/source/tools/rsctools.cxx
+++ b/rsc/source/tools/rsctools.cxx
@@ -36,40 +36,14 @@
/* case insensitive compare of two strings up to a given length */
int rsc_strnicmp( const char *string1, const char *string2, size_t count )
{
- size_t i;
-
- for( i = 0; ( i < count ) && string1[ i ] && string2[ i ] ; i++ )
- {
- if( tolower( string1[ i ] ) < tolower( string2[ i ] ) )
- return -1;
- else if( tolower( string1[ i ] ) > tolower( string2[ i ] ) )
- return 1;
- }
- if( i == count )
- return 0;
- else if( tolower( string1[ i ] ) < tolower( string2[ i ] ) )
- return -1;
- else if( tolower( string1[ i ] ) > tolower( string2[ i ] ) )
- return 1;
- return 0;
+ return rtl_str_shortenedCompareIgnoreAsciiCase_WithLength(
+ string1, strlen (string1), string2, strlen (string2), count);
}
/* case insensitive compare of two strings */
-int rsc_stricmp( const char *string1, const char *string2 ){
- int i;
-
- for( i = 0; string1[ i ] && string2[ i ]; i++ )
- {
- if( tolower( string1[ i ] ) < tolower( string2[ i ] ) )
- return -1;
- else if( tolower( string1[ i ] ) > tolower( string2[ i ] ) )
- return 1;
- }
- if( tolower( string1[ i ] ) < tolower( string2[ i ] ) )
- return -1;
- else if( tolower( string1[ i ] ) > tolower( string2[ i ] ) )
- return 1;
- return 0;
+int rsc_stricmp( const char *string1, const char *string2 )
+{
+ return rtl_str_compareIgnoreAsciiCase( string1, string2 );
}
char* rsc_strdup( const char* pStr )