diff options
author | Hans-Joachim Lankenau <hjs@openoffice.org> | 2001-11-06 11:43:23 +0000 |
---|---|---|
committer | Hans-Joachim Lankenau <hjs@openoffice.org> | 2001-11-06 11:43:23 +0000 |
commit | bd2c5e6d0e7fb2889047c5813a8ae6f490c5dac8 (patch) | |
tree | 1216971494fb4d1fa3739a783d828131f19c679f /rsc/source | |
parent | 5ff143046caa9cf020435ef0d1fb1f24aa1e8588 (diff) |
#94297# use mktemp
Diffstat (limited to 'rsc/source')
-rw-r--r-- | rsc/source/rsc/rsc.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx index fa020e194dff..a243c92d4dd9 100644 --- a/rsc/source/rsc/rsc.cxx +++ b/rsc/source/rsc/rsc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: rsc.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: hjs $ $Date: 2001-11-06 11:30:26 $ + * last change: $Author: hjs $ $Date: 2001-11-06 12:43:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -855,7 +855,9 @@ ERRTYPE RscCompiler::Link() // rc-Datei schreiben ByteString aDir( it->aOutputRc ); aDir.SetToken( aDir.GetTokenCount( PATHSEP )-1, PATHSEP, ByteString() ); - char* pTmp = tempnam( aDir.GetBuffer(), "rsc" ); + aDir.Append( "rscXXXXXX" ); + char* pTmp = strdup( aDir.GetBuffer() ); + mktemp( pTmp ); if ( NULL == (fExitFile = foutput = fopen( pTmp, "wb" )) ) pTC->pEH->FatalError( ERR_OPENFILE, RscId(), pTmp ); @@ -863,7 +865,7 @@ ERRTYPE RscCompiler::Link() // Schreibe Datei #ifdef DEBUG - fprintf( stderr, "using tmp file %s\n", pTmp ); + fprintf( stderr, "using tmp file %s %s\n", pTmp, aDir.GetBuffer() ); #endif pTC->ChangeLanguage( it->nLangTypeId ); pTC->ChangeDefLanguage( International::GetNeutralLanguage( it->nLangTypeId ) ); @@ -875,6 +877,7 @@ ERRTYPE RscCompiler::Link() #ifdef DEBUG fprintf( stderr, "move %s -> %s\n", pTmp, it->aOutputRc.GetBuffer() ); #endif + unlink( it->aOutputRc.GetBuffer() ); if( rename( pTmp, it->aOutputRc.GetBuffer() ) ) { char aBuf[1024]; |