diff options
author | xiphon <xiphon@protonmail.com> | 2018-10-01 06:39:37 +0000 |
---|---|---|
committer | xiphon <xiphon@protonmail.com> | 2018-10-02 01:53:27 +0300 |
commit | d5541e44feaa2be10c6a4ffb2746d59bb01a2b26 (patch) | |
tree | 3051a9d03be0e5fbfa0dd970f312f7e07636d272 /src/common/notify.cpp | |
parent | Merge pull request #4333 (diff) | |
download | monero-d5541e44feaa2be10c6a4ffb2746d59bb01a2b26.tar.xz |
common: Windows 'spawn' support for tx and block notifications
Diffstat (limited to 'src/common/notify.cpp')
-rw-r--r-- | src/common/notify.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/common/notify.cpp b/src/common/notify.cpp index b7869ad84..cadc68ea7 100644 --- a/src/common/notify.cpp +++ b/src/common/notify.cpp @@ -29,12 +29,17 @@ #include <boost/algorithm/string.hpp> #include "misc_log_ex.h" #include "file_io_utils.h" -#include "exec.h" +#include "spawn.h" #include "notify.h" namespace tools { +/* + TODO: + - Improve tokenization to handle paths containing whitespaces, quotes, etc. + - Windows unicode support (implies implementing unicode command line parsing code) +*/ Notify::Notify(const char *spec) { CHECK_AND_ASSERT_THROW_MES(spec, "Null spec"); @@ -51,11 +56,7 @@ int Notify::notify(const char *parameter) for (std::string &s: margs) boost::replace_all(s, "%s", parameter); - char **cargs = (char**)alloca(sizeof(char*) * (margs.size() + 1)); - for (size_t n = 0; n < margs.size(); ++n) - cargs[n] = (char*)margs[n].c_str(); - cargs[margs.size()] = NULL; - return tools::exec(filename.c_str(), cargs, false); + return tools::spawn(filename.c_str(), margs, false); } } |