diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2020-02-04 15:50:10 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2020-02-04 15:50:10 -0800 |
| commit | 6f66ad14fe9da11d4bf50f5b25b4da86ed971c53 (patch) | |
| tree | 0f5dbcd1719cd6a8e486c4058cfefd607d58aa6c /toolsrc/src/vcpkg.cpp | |
| parent | d502f061bb3ee0258d6453acbf258b9e5d93d564 (diff) | |
| parent | d808514c9df44bb97d6eccff952bfe8ec4e156f7 (diff) | |
| download | vcpkg-6f66ad14fe9da11d4bf50f5b25b4da86ed971c53.tar.gz vcpkg-6f66ad14fe9da11d4bf50f5b25b4da86ed971c53.zip | |
Merge remote-tracking branch 'origin/master' into HEAD
Diffstat (limited to 'toolsrc/src/vcpkg.cpp')
| -rw-r--r-- | toolsrc/src/vcpkg.cpp | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index c336d2f63..1f212dd94 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -262,31 +262,19 @@ static void load_config() } #if defined(_WIN32) -static std::string trim_path_from_command_line(const std::string& full_command_line) -{ - Checks::check_exit( - VCPKG_LINE_INFO, !full_command_line.empty(), "Internal failure - cannot have empty command line"); - - if (full_command_line[0] == '"') - { - auto it = std::find(full_command_line.cbegin() + 1, full_command_line.cend(), '"'); - if (it != full_command_line.cend()) // Skip over the quote - ++it; - while (it != full_command_line.cend() && *it == ' ') // Skip over a space - ++it; - return std::string(it, full_command_line.cend()); - } +// note: this prevents a false positive for -Wmissing-prototypes on clang-cl +int wmain(int, const wchar_t* const* const); - auto it = std::find(full_command_line.cbegin(), full_command_line.cend(), ' '); - while (it != full_command_line.cend() && *it == ' ') - ++it; - return std::string(it, full_command_line.cend()); +#if !defined(_MSC_VER) +#include <shellapi.h> +int main(int argc, const char* const* const /*argv*/) +{ + wchar_t **wargv; + wargv = CommandLineToArgvW(GetCommandLineW(), &argc); + return wmain(argc, wargv); } #endif -#if defined(_WIN32) -// note: this prevents a false positive for -Wmissing-prototypes on clang-cl -int wmain(int, const wchar_t* const*); int wmain(const int argc, const wchar_t* const* const argv) #else int main(const int argc, const char* const* const argv) |
