From 3813a9b87235dcbf4dcecbaff8962b4e37e230e2 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Tue, 18 Mar 2008 11:16:56 +0000 Subject: INTEGRATION: CWS sb83 (1.12.16); FILE MERGED 2008/02/12 08:36:10 sb 1.12.16.1: #i86033# call pluginapp.bin with full path --- extensions/source/plugin/unx/unxmgr.cxx | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'extensions') diff --git a/extensions/source/plugin/unx/unxmgr.cxx b/extensions/source/plugin/unx/unxmgr.cxx index b15a962d7a50..0c8ceb3667f6 100644 --- a/extensions/source/plugin/unx/unxmgr.cxx +++ b/extensions/source/plugin/unx/unxmgr.cxx @@ -4,9 +4,9 @@ * * $RCSfile: unxmgr.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: ihi $ $Date: 2008-01-14 14:54:28 $ + * last change: $Author: vg $ $Date: 2008-03-18 12:16:56 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -87,11 +88,20 @@ static bool CheckPlugin( const ByteString& rPath, list< PluginDescription* >& rD rtl_TextEncoding aEncoding = osl_getThreadTextEncoding(); - ByteString aCommand( "pluginapp.bin \"" ); - aCommand.Append( rPath ); - aCommand.Append( '"' ); + rtl::OString path; + if (!UnxPluginComm::getPluginappPath(&path)) { +#if OSL_DEBUG_LEVEL > 1 + fprintf( stderr, "cannot construct path to pluginapp.bin\n" ); +#endif + return false; + } + rtl::OStringBuffer cmd; + tools::appendUnixShellWord(&cmd, path); + cmd.append(' '); + tools::appendUnixShellWord(&cmd, rPath); + rtl::OString aCommand(cmd.makeStringAndClear()); - FILE* pResult = popen( aCommand.GetBuffer(), "r" ); + FILE* pResult = popen( aCommand.getStr(), "r" ); int nDescriptions = 0; if( pResult ) { @@ -160,12 +170,12 @@ static bool CheckPlugin( const ByteString& rPath, list< PluginDescription* >& rD #if OSL_DEBUG_LEVEL > 1 else fprintf( stderr, "result of \"%s\" contains no mimtype\n", - aCommand.GetBuffer() ); + aCommand.getStr() ); #endif } #if OSL_DEBUG_LEVEL > 1 else - fprintf( stderr, "command \"%s\" failed\n", aCommand.GetBuffer() ); + fprintf( stderr, "command \"%s\" failed\n", aCommand.getStr() ); #endif return nDescriptions > 0; } @@ -272,4 +282,3 @@ Sequence XPluginManager_Impl::getPluginDescriptions() throw() } return aDescriptions; } - -- cgit