removed obsolete fopen

This commit is contained in:
Philipp Lohmann 2001-05-10 18:50:04 +00:00
parent 3444b58404
commit 8c3d09f5a8

View file

@ -2,9 +2,9 @@
* *
* $RCSfile: idlcproduce.cxx,v $ * $RCSfile: idlcproduce.cxx,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change: $Author: pl $ $Date: 2001-05-10 13:07:49 $ * last change: $Author: pl $ $Date: 2001-05-10 19:50:04 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@ -107,12 +107,14 @@ static sal_Bool checkOutputPath(const OString& completeName)
buffer.append(token); buffer.append(token);
buffer.append(SEPARATOR); buffer.append(SEPARATOR);
} }
else
nIndex = 0;
do do
{ {
buffer.append(completeName.getToken(0, SEPARATOR, nIndex)); buffer.append(completeName.getToken(0, SEPARATOR, nIndex));
if ( buffer.getLength() > 0 ) if ( buffer.getLength() > 0 && nIndex != -1 )
{ {
#ifdef SAL_UNX #ifdef SAL_UNX
if (mkdir((char*)buffer.getStr(), 0777) == -1) if (mkdir((char*)buffer.getStr(), 0777) == -1)
@ -133,8 +135,7 @@ static sal_Bool checkOutputPath(const OString& completeName)
pCreatedDirectories->push_front(buffer.getStr()); pCreatedDirectories->push_front(buffer.getStr());
} }
} }
if ( nIndex != -1 ) buffer.append(SEPARATOR);
buffer.append(SEPARATOR);
} while( nIndex != -1 ); } while( nIndex != -1 );
return sal_True; return sal_True;
} }
@ -166,12 +167,7 @@ static sal_Bool cleanPath()
void SAL_CALL removeIfExists(const OString& fileName) void SAL_CALL removeIfExists(const OString& fileName)
{ {
FILE* pDest = fopen(fileName.getStr(), "r"); unlink(fileName.getStr());
if ( pDest )
{
fclose(pDest);
unlink(fileName.getStr());
}
} }
sal_Int32 SAL_CALL produceFile(const OString& fileName) sal_Int32 SAL_CALL produceFile(const OString& fileName)