aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_create.cpp
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2016-09-23 17:57:50 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2016-09-23 17:57:50 -0700
commita8b0651e50bf217e361789d1d6a59905309a3372 (patch)
tree2ee8a56d0b59ddb34c41c06fae60e4011f934daa /toolsrc/src/commands_create.cpp
parent1cd1f6a46bdd2eb8a27dabb8e8eb69d36694d6d6 (diff)
downloadvcpkg-a8b0651e50bf217e361789d1d6a59905309a3372.tar.gz
vcpkg-a8b0651e50bf217e361789d1d6a59905309a3372.zip
`vcpkg create` now checks for invalid chars in the zip file
Diffstat (limited to 'toolsrc/src/commands_create.cpp')
-rw-r--r--toolsrc/src/commands_create.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/toolsrc/src/commands_create.cpp b/toolsrc/src/commands_create.cpp
index c08842d65..76ba644e4 100644
--- a/toolsrc/src/commands_create.cpp
+++ b/toolsrc/src/commands_create.cpp
@@ -1,6 +1,7 @@
#include "vcpkg_Commands.h"
#include "vcpkg_System.h"
#include "vcpkg_Environment.h"
+#include "vcpkg_Files.h"
namespace vcpkg
{
@@ -23,7 +24,11 @@ namespace vcpkg
std::wstring custom_filename = L" ";
if (args.command_arguments.size() >= 3)
{
- custom_filename = Strings::format(LR"( -DFILENAME="%s" )", Strings::utf8_to_utf16(args.command_arguments.at(2)));
+ const std::string& zip_file_name = args.command_arguments.at(2);
+ Checks::check_exit(!Files::has_invalid_chars_for_filesystem(zip_file_name),
+ R"(Filename cannot contain invalid chars %s, but was %s)",
+ Files::FILESYSTEM_INVALID_CHARACTERS, zip_file_name);
+ custom_filename = Strings::format(LR"( -DFILENAME="%s" )", Strings::utf8_to_utf16(zip_file_name));
}
const std::wstring cmdline = Strings::format(LR"(cmake -DCMD=SCAFFOLD -DPORT=%s -DTARGET_TRIPLET=%s -DURL=%s%s-P "%s")",