summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorOliver Braun <obr@openoffice.org>2001-11-01 13:23:42 +0000
committerOliver Braun <obr@openoffice.org>2001-11-01 13:23:42 +0000
commit9a054612e8a77121357bb827a5e5e2b2ec8d5124 (patch)
tree9711a77e3bffd15522a88a7a2a1b6221638c4382 /shell
parentf630edda35666f19569209cddfd52ccf0085a507 (diff)
#93801# throw exception if url handler does not exist
Diffstat (limited to 'shell')
-rw-r--r--shell/source/unix/exec/shellexec.cxx19
1 files changed, 17 insertions, 2 deletions
diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx
index df7fe46b5e51..c891edc0218d 100644
--- a/shell/source/unix/exec/shellexec.cxx
+++ b/shell/source/unix/exec/shellexec.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: shellexec.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: obr $ $Date: 2001-08-29 09:50:53 $
+ * last change: $Author: obr $ $Date: 2001-11-01 14:23:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -294,6 +294,9 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar
if( aHandler.getLength() )
{
+ // search handler in system path if no absolute path given
+ FileBase::searchFileURL( aHandler, OUString(), aHandler );
+
// handler may be stored as file URL
FileBase::getSystemPathFromFileURL( aHandler, aHandler );
@@ -335,6 +338,18 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar
aCommandLine = aBuffer.makeStringAndClear();
}
+ // check if the handler really exists and is executable
+ OString aHandler = aCommandLine.copy( 1, aCommandLine.indexOf( '\"', 1 ) - 1 );
+ if( 0 != access( aHandler.getStr(), X_OK ) )
+ {
+ int nerr = errno;
+
+ throw SystemShellExecuteException(
+ OUString::createFromAscii( strerror( nerr ) ),
+ static_cast < XSystemShellExecute * > (this),
+ nerr );
+ }
+
// do not wait for completion
aCommandLine += " &";