diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-09-12 13:29:40 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-12 14:18:10 +0200 |
commit | bb5ea68ed5e48b1ac39a279a9fc9a0d9b6ff71e4 (patch) | |
tree | 30370f7cddcb737097a510e6853dbc5ca7af1a69 /sal/osl/unx/process.cxx | |
parent | dbb77c1448e58ee42fade4fa2f4d478a9ac91f1c (diff) |
Simplify osl_searchPath_impl
Change-Id: I78a97b5a1abbcb7921eba60b8014a21373c0b596
Diffstat (limited to 'sal/osl/unx/process.cxx')
-rw-r--r-- | sal/osl/unx/process.cxx | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx index 280b7ece317f..eb1fdf4a98f2 100644 --- a/sal/osl/unx/process.cxx +++ b/sal/osl/unx/process.cxx @@ -120,14 +120,6 @@ oslProcessError SAL_CALL osl_psz_executeProcess(sal_Char *pszImageName, oslFileHandle *pErrorRead ); -oslProcessError SAL_CALL osl_searchPath_impl( - const sal_Char* pszName, - const sal_Char* pszPath, - sal_Char Separator, - sal_Char *pszBuffer, - sal_uInt32 Max); - - sal_Bool osl_getFullPath(const sal_Char* pszFilename, sal_Char* pszPath, sal_uInt32 MaxLen); static oslProcessImpl* ChildList; @@ -140,8 +132,8 @@ static oslMutex ChildListMutex; A new implemenation is in file_path_helper.cxx *****************************************************************************/ -oslProcessError SAL_CALL osl_searchPath_impl(const sal_Char* pszName, const sal_Char* pszPath, - sal_Char Separator, sal_Char *pszBuffer, sal_uInt32 Max) +static oslProcessError SAL_CALL osl_searchPath_impl(const sal_Char* pszName, + sal_Char *pszBuffer, sal_uInt32 Max) { sal_Char path[PATH_MAX + 1]; sal_Char *pchr; @@ -155,14 +147,7 @@ oslProcessError SAL_CALL osl_searchPath_impl(const sal_Char* pszName, const sal_ return osl_Process_E_NotFound; } - if (pszPath == NULL) - pszPath = "PATH"; - - if (Separator == '\0') - Separator = ':'; - - - if ( (pchr = getenv(pszPath)) != 0 ) + if ( (pchr = getenv("PATH")) != 0 ) { sal_Char *pstr; @@ -170,7 +155,7 @@ oslProcessError SAL_CALL osl_searchPath_impl(const sal_Char* pszName, const sal_ { pstr = path; - while ((*pchr != '\0') && (*pchr != Separator)) + while ((*pchr != '\0') && (*pchr != ':')) *pstr++ = *pchr++; if ((pstr > path) && ((*(pstr - 1) != '/'))) @@ -192,7 +177,7 @@ oslProcessError SAL_CALL osl_searchPath_impl(const sal_Char* pszName, const sal_ return osl_Process_E_None; } - if (*pchr == Separator) + if (*pchr == ':') pchr++; } } @@ -698,7 +683,7 @@ oslProcessError SAL_CALL osl_psz_executeProcess(sal_Char *pszImageName, } if ((Options & osl_Process_SEARCHPATH) && - (osl_searchPath_impl(pszImageName, NULL, '\0', path, sizeof(path)) == osl_Process_E_None)) + (osl_searchPath_impl(pszImageName, path, sizeof(path)) == osl_Process_E_None)) pszImageName = path; Data.m_pszArgs[0] = strdup(pszImageName); |