]> khamidou — GitHub mirrors - electron.git/commitdiff
atomMain: initialise uv_setup_args
authorRobo <hop2deep@gmail.com>
Sat, 4 Apr 2015 13:50:21 +0000 (19:20 +0530)
committerRobo <hop2deep@gmail.com>
Sat, 4 Apr 2015 13:50:21 +0000 (19:20 +0530)
atom/app/atom_main_args.cc

index 9d1f0db07d7c019ea91ba8d33f9b9e490dda0991..b9ef7c43a34b866ea9d2a9d81a9fcf0d91112e69 100644 (file)
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 #include "atom/app/atom_main_args.h"
+#include "vendor/node/deps/uv/include/uv.h"
 
 namespace atom {
 
@@ -11,8 +12,10 @@ std::vector<std::string> AtomCommandLine::argv_;
 
 // static
 void AtomCommandLine::Init(int argc, const char* const* argv) {
+  // Hack around with the argv pointer. Used for process.title = "blah"
+  char** new_argv = uv_setup_args(argc, const_cast<char**>(argv));
   for (int i = 0; i < argc; ++i) {
-    argv_.push_back(argv[i]);
+    argv_.push_back(new_argv[i]);
   }
 }