aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-02-06 23:14:49 +0800
committerGitHub <noreply@github.com>2017-02-06 23:14:49 +0800
commit3cbdafcfe947eafef7b8f6bbafd06f769261ae28 (patch)
tree7e50d65e9af042225324a8e7843f8df1e069d07d
parent06de89aef074a78320dc44b0b461583a2208f62a (diff)
parenta5d0fd9c8a21af4a524ae60470c9381e94af446a (diff)
downloaddexon-solidity-3cbdafcfe947eafef7b8f6bbafd06f769261ae28.tar
dexon-solidity-3cbdafcfe947eafef7b8f6bbafd06f769261ae28.tar.gz
dexon-solidity-3cbdafcfe947eafef7b8f6bbafd06f769261ae28.tar.bz2
dexon-solidity-3cbdafcfe947eafef7b8f6bbafd06f769261ae28.tar.lz
dexon-solidity-3cbdafcfe947eafef7b8f6bbafd06f769261ae28.tar.xz
dexon-solidity-3cbdafcfe947eafef7b8f6bbafd06f769261ae28.tar.zst
dexon-solidity-3cbdafcfe947eafef7b8f6bbafd06f769261ae28.zip
Merge pull request #1649 from ethereum/solc-fix-mkdir
Do not create directories . and ..
-rw-r--r--Changelog.md1
-rw-r--r--solc/CommandLineInterface.cpp4
2 files changed, 4 insertions, 1 deletions
diff --git a/Changelog.md b/Changelog.md
index 038d944f..0c4e8329 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -5,6 +5,7 @@ Features:
Bugfixes:
* Commandline interface: Always escape filenames (replace ``/``, ``:`` and ``.`` with ``_``).
+ * Commandline interface: Do not try creating paths ``.`` and ``..``.
* Type system: Disallow arrays with negative length.
### 0.4.9 (2017-01-31)
diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp
index 26355353..6759727f 100644
--- a/solc/CommandLineInterface.cpp
+++ b/solc/CommandLineInterface.cpp
@@ -461,7 +461,9 @@ void CommandLineInterface::createFile(string const& _fileName, string const& _da
namespace fs = boost::filesystem;
// create directory if not existent
fs::path p(m_args.at(g_argOutputDir).as<string>());
- fs::create_directories(p);
+ // Do not try creating the directory if the first item is . or ..
+ if (p.filename() != "." && p.filename() != "..")
+ fs::create_directories(p);
string pathName = (p / _fileName).string();
ofstream outFile(pathName);
outFile << _data;