aboutsummaryrefslogtreecommitdiffstats
path: root/solc/CommandLineInterface.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-02-06 03:19:29 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-02-06 03:19:29 +0800
commit46412473b6d198106a0b80dc79645eeb693f1492 (patch)
tree36e6db75be5d60344d23a983fef32d0a0c671d48 /solc/CommandLineInterface.cpp
parentab54cd100ec11e82f6e7c3405356fbc48fd2ed8c (diff)
downloaddexon-solidity-46412473b6d198106a0b80dc79645eeb693f1492.tar
dexon-solidity-46412473b6d198106a0b80dc79645eeb693f1492.tar.gz
dexon-solidity-46412473b6d198106a0b80dc79645eeb693f1492.tar.bz2
dexon-solidity-46412473b6d198106a0b80dc79645eeb693f1492.tar.lz
dexon-solidity-46412473b6d198106a0b80dc79645eeb693f1492.tar.xz
dexon-solidity-46412473b6d198106a0b80dc79645eeb693f1492.tar.zst
dexon-solidity-46412473b6d198106a0b80dc79645eeb693f1492.zip
Always escape filenames in solc
Diffstat (limited to 'solc/CommandLineInterface.cpp')
-rw-r--r--solc/CommandLineInterface.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp
index dd80e189..26355353 100644
--- a/solc/CommandLineInterface.cpp
+++ b/solc/CommandLineInterface.cpp
@@ -200,7 +200,7 @@ void CommandLineInterface::handleBinary(string const& _contract)
if (m_args.count(g_argCloneBinary))
{
if (m_args.count(g_argOutputDir))
- createFile(_contract + ".clone_bin", m_compiler->cloneObject(_contract).toHex());
+ createFile(m_compiler->filesystemFriendlyName(_contract) + ".clone_bin", m_compiler->cloneObject(_contract).toHex());
else
{
cout << "Clone Binary: " << endl;
@@ -210,7 +210,7 @@ void CommandLineInterface::handleBinary(string const& _contract)
if (m_args.count(g_argBinaryRuntime))
{
if (m_args.count(g_argOutputDir))
- createFile(_contract + ".bin-runtime", m_compiler->runtimeObject(_contract).toHex());
+ createFile(m_compiler->filesystemFriendlyName(_contract) + ".bin-runtime", m_compiler->runtimeObject(_contract).toHex());
else
{
cout << "Binary of the runtime part: " << endl;
@@ -222,7 +222,7 @@ void CommandLineInterface::handleBinary(string const& _contract)
void CommandLineInterface::handleOpcode(string const& _contract)
{
if (m_args.count(g_argOutputDir))
- createFile(_contract + ".opcode", solidity::disassemble(m_compiler->object(_contract).bytecode));
+ createFile(m_compiler->filesystemFriendlyName(_contract) + ".opcode", solidity::disassemble(m_compiler->object(_contract).bytecode));
else
{
cout << "Opcodes: " << endl;
@@ -249,7 +249,7 @@ void CommandLineInterface::handleSignatureHashes(string const& _contract)
out += toHex(it.first.ref()) + ": " + it.second->externalSignature() + "\n";
if (m_args.count(g_argOutputDir))
- createFile(_contract + ".signatures", out);
+ createFile(m_compiler->filesystemFriendlyName(_contract) + ".signatures", out);
else
cout << "Function signatures: " << endl << out;
}
@@ -261,7 +261,7 @@ void CommandLineInterface::handleOnChainMetadata(string const& _contract)
string data = m_compiler->onChainMetadata(_contract);
if (m_args.count("output-dir"))
- createFile(_contract + "_meta.json", data);
+ createFile(m_compiler->filesystemFriendlyName(_contract) + "_meta.json", data);
else
cout << "Metadata: " << endl << data << endl;
}
@@ -302,7 +302,7 @@ void CommandLineInterface::handleMeta(DocumentationType _type, string const& _co
output = dev::jsonPrettyPrint(m_compiler->metadata(_contract, _type));
if (m_args.count(g_argOutputDir))
- createFile(_contract + suffix, output);
+ createFile(m_compiler->filesystemFriendlyName(_contract) + suffix, output);
else
{
cout << title << endl;
@@ -981,7 +981,7 @@ void CommandLineInterface::outputCompilationResults()
{
stringstream data;
m_compiler->streamAssembly(data, contract, m_sourceCodes, m_args.count(g_argAsmJson));
- createFile(contract + (m_args.count(g_argAsmJson) ? "_evm.json" : ".evm"), data.str());
+ createFile(m_compiler->filesystemFriendlyName(contract) + (m_args.count(g_argAsmJson) ? "_evm.json" : ".evm"), data.str());
}
else
{