mirror of
https://github.com/reactos/reactos.git
synced 2025-01-02 12:32:47 +00:00
Merged with wine. (Fixed const string handling)
svn path=/trunk/; revision=10827
This commit is contained in:
parent
b7cf80521b
commit
5a1180477c
1 changed files with 12 additions and 10 deletions
|
@ -86,11 +86,13 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
|
||||||
PWSTR res = out;
|
PWSTR res = out;
|
||||||
PCWSTR cmd;
|
PCWSTR cmd;
|
||||||
LPVOID pv;
|
LPVOID pv;
|
||||||
WCHAR tmpBuffer[1024];
|
WCHAR tmpBuffer[1024];
|
||||||
PWSTR tmpB = tmpBuffer;
|
PWSTR tmpB = tmpBuffer;
|
||||||
WCHAR tmpEnvBuff[MAX_PATH];
|
WCHAR tmpEnvBuff[MAX_PATH];
|
||||||
WCHAR* tmpE = tmpEnvBuff;
|
WCHAR* tmpE = tmpEnvBuff;
|
||||||
DWORD envRet;
|
DWORD envRet;
|
||||||
|
static const WCHAR wszSPerc[] = {'%','s','%','%',0};
|
||||||
|
static const WCHAR wszPerc[] = {'%',0};
|
||||||
|
|
||||||
TRACE("%p, %d, %s, %s, %p, %p\n", out, len, debugstr_w(fmt),
|
TRACE("%p, %d, %s, %s, %p, %p\n", out, len, debugstr_w(fmt),
|
||||||
debugstr_w(lpFile), pidl, args);
|
debugstr_w(lpFile), pidl, args);
|
||||||
|
@ -189,8 +191,8 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
|
||||||
* Check if this is a env-variable here...
|
* Check if this is a env-variable here...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Make sure that we have at least one more %.
|
/* Make sure that we have at least one more %.*/
|
||||||
if (strstrW(fmt, L"%"))
|
if (strstrW(fmt, wszPerc))
|
||||||
{
|
{
|
||||||
while (*fmt != '%')
|
while (*fmt != '%')
|
||||||
*tmpB++ = *fmt++;
|
*tmpB++ = *fmt++;
|
||||||
|
@ -202,16 +204,16 @@ static BOOL SHELL_ArgifyW(WCHAR* out, int len, const WCHAR* fmt, const WCHAR* lp
|
||||||
if (envRet == 0 || envRet > MAX_PATH)
|
if (envRet == 0 || envRet > MAX_PATH)
|
||||||
{
|
{
|
||||||
TRACE("The env. var can't be found or is bigger than MAX_PATH => useless.");
|
TRACE("The env. var can't be found or is bigger than MAX_PATH => useless.");
|
||||||
res += sprintfW(res, L"%s%%", tmpBuffer);
|
res += sprintfW(res, wszSPerc, tmpBuffer);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TRACE("Found it %s. Replacing... \n", debugstr_w(tmpEnvBuff));
|
TRACE("Found it %s. Replacing... \n", debugstr_w(tmpEnvBuff));
|
||||||
res += sprintfW(res, L"%s", tmpEnvBuff);
|
res += sprintfW(res, wszSPerc, tmpEnvBuff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // switch
|
} /* switch */
|
||||||
|
|
||||||
|
|
||||||
fmt++;
|
fmt++;
|
||||||
|
|
Loading…
Reference in a new issue