[Libreoffice-commits] .: l10ntools/source
Fridrich Strba
fridrich at kemper.freedesktop.org
Wed Feb 16 00:40:56 PST 2011
l10ntools/source/cfgmerge.cxx | 39 +++++++++++++++++++++------------------
1 file changed, 21 insertions(+), 18 deletions(-)
New commits:
commit f80a743b2abc08b77b0132c75d7b7e138b9bcf7b
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date: Wed Feb 16 09:40:19 2011 +0100
Fix a crash when using on cygwin with symlinked directories
But only God knows where is actually the root cause of this crash
diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx
index 02874eb..c441ccd 100644
--- a/l10ntools/source/cfgmerge.cxx
+++ b/l10ntools/source/cfgmerge.cxx
@@ -42,17 +42,17 @@ extern "C" { int yyerror( char * ); }
extern "C" { int YYWarning( char * ); }
// defines to parse command line
-#define STATE_NON 0x0001
-#define STATE_INPUT 0x0002
-#define STATE_OUTPUT 0x0003
-#define STATE_PRJ 0x0004
-#define STATE_ROOT 0x0005
-#define STATE_MERGESRC 0x0006
-#define STATE_ERRORLOG 0x0007
-#define STATE_UTF8 0x0008
-#define STATE_LANGUAGES 0X0009
-#define STATE_ISOCODE99 0x000A
-#define STATE_FORCE 0x000B
+#define STATE_NON 0x0001
+#define STATE_INPUT 0x0002
+#define STATE_OUTPUT 0x0003
+#define STATE_PRJ 0x0004
+#define STATE_ROOT 0x0005
+#define STATE_MERGESRC 0x0006
+#define STATE_ERRORLOG 0x0007
+#define STATE_UTF8 0x0008
+#define STATE_LANGUAGES 0X0009
+#define STATE_ISOCODE99 0x000A
+#define STATE_FORCE 0x000B
// set of global variables
BOOL bEnableExport;
@@ -136,7 +136,7 @@ extern char *GetOutputFile( int argc, char* argv[])
else {
switch ( nState ) {
case STATE_NON: {
- return NULL; // no valid command line
+ return NULL; // no valid command line
}
case STATE_INPUT: {
sInputFileName = argv[ i ];
@@ -149,7 +149,7 @@ extern char *GetOutputFile( int argc, char* argv[])
break;
case STATE_PRJ: {
sPrj = ByteString( argv[ i ]);
-// sPrj.ToLowerAscii(); // the project
+// sPrj.ToLowerAscii(); // the project
}
break;
case STATE_ROOT: {
@@ -253,7 +253,7 @@ extern FILE *GetCfgFile()
// create file name, beginnig with project root
// (e.g.: source\ui\src\menue.src)
-// printf("sFullEntry = %s\n",sFullEntry.GetBuffer());
+// printf("sFullEntry = %s\n",sFullEntry.GetBuffer());
sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 );
// printf("sActFileName = %s\n",sActFileName.GetBuffer());
@@ -337,7 +337,10 @@ CfgStackData *CfgStack::GetStackData( size_t nPos )
/*****************************************************************************/
{
if ( nPos == LIST_APPEND )
- nPos = maList.size() - 1;
+ if (maList.size())
+ nPos = maList.size() - 1;
+ else
+ return 0;
return maList[ nPos ];
}
@@ -578,7 +581,7 @@ int CfgParser::Execute( int nToken, char * pToken )
void CfgParser::Error( const ByteString &rError )
/*****************************************************************************/
{
-// ByteString sError( rError );
+// ByteString sError( rError );
// sError.Append("Error: In file ");
// sError.Append( sActFileName );
yyerror(( char * ) rError.GetBuffer());
@@ -659,7 +662,7 @@ void CfgExport::WorkOnRessourceEnd()
ByteString sFallback = pStackData->sText[ ByteString("en-US") ];
//if ( pStackData->sText[ ByteString("en-US") ].Len())
- // sFallback = pStackData->sText[ ByteString("en-US") ];
+ // sFallback = pStackData->sText[ ByteString("en-US") ];
ByteString sLocalId = pStackData->sIdentifier;
ByteString sGroupId;
@@ -777,7 +780,7 @@ void CfgMerge::WorkOnText(
}
//if ( nLangIndex.EqualsIgnoreCaseAscii("de") )
- // bGerman = TRUE;
+ // bGerman = TRUE;
if (( nLangIndex.EqualsIgnoreCaseAscii("en-US") ))
bEnglish = TRUE;
More information about the Libreoffice-commits
mailing list