diff options
author | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:56:07 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:56:07 +0200 |
commit | de73d25e0b27f4bee2de116d19cab32800785d64 (patch) | |
tree | 21de1736d12a92223ad04c02a5b0826d77e5e71c /zen/shell_execute.h | |
parent | 7.1 (diff) | |
download | FreeFileSync-de73d25e0b27f4bee2de116d19cab32800785d64.tar.gz FreeFileSync-de73d25e0b27f4bee2de116d19cab32800785d64.tar.bz2 FreeFileSync-de73d25e0b27f4bee2de116d19cab32800785d64.zip |
7.2
Diffstat (limited to 'zen/shell_execute.h')
-rw-r--r-- | zen/shell_execute.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/zen/shell_execute.h b/zen/shell_execute.h index 628e957a..b36bc5ea 100644 --- a/zen/shell_execute.h +++ b/zen/shell_execute.h @@ -60,14 +60,14 @@ bool shellExecuteImpl(Function fillExecInfo, ExecutionType type) } -void shellExecute(const void* /*PCIDLIST_ABSOLUTE*/ shellItemPidl, const Zstring& displayPath, ExecutionType type) //throw FileError +void shellExecute(const void* /*PCIDLIST_ABSOLUTE*/ shellItemPidl, const std::wstring& displayPath, ExecutionType type) //throw FileError { if (!shellExecuteImpl([&](SHELLEXECUTEINFO& execInfo) { execInfo.fMask |= SEE_MASK_IDLIST; execInfo.lpIDList = const_cast<void*>(shellItemPidl); //lpIDList is documented as PCIDLIST_ABSOLUTE! }, type)) //throw FileError - throwFileError(_("Incorrect command line:") + L"\n" + fmtFileName(displayPath), L"ShellExecuteEx", ::GetLastError()); + throwFileError(_("Incorrect command line:") + L"\n" + fmtPath(displayPath), L"ShellExecuteEx", ::GetLastError()); } #endif @@ -102,7 +102,7 @@ void shellExecute(const Zstring& command, ExecutionType type) //throw FileError execInfo.lpFile = filepath.c_str(); execInfo.lpParameters = arguments.c_str(); }, type)) - throwFileError(_("Incorrect command line:") + L"\nFile: " + fmtFileName(filepath) + L"\nArg: " + arguments, L"ShellExecuteEx", ::GetLastError()); + throwFileError(_("Incorrect command line:") + L"\nFile: " + fmtPath(filepath) + L"\nArg: " + copyStringTo<std::wstring>(arguments), L"ShellExecuteEx", ::GetLastError()); #elif defined ZEN_LINUX || defined ZEN_MAC /* @@ -117,10 +117,10 @@ void shellExecute(const Zstring& command, ExecutionType type) //throw FileError //Posix::system - execute a shell command int rv = ::system(command.c_str()); //do NOT use std::system as its documentation says nothing about "WEXITSTATUS(rv)", ect... if (rv == -1 || WEXITSTATUS(rv) == 127) //http://linux.die.net/man/3/system "In case /bin/sh could not be executed, the exit status will be that of a command that does exit(127)" - throw FileError(_("Incorrect command line:") + L"\n" + command); + throw FileError(_("Incorrect command line:") + L"\n" + utfCvrtTo<std::wstring>(command)); } else - async([=] { int rv = ::system(command.c_str()); (void)rv; }); + runAsync([=] { int rv = ::system(command.c_str()); (void)rv; }); #endif } } |