mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #1649 from ethereum/solc-fix-mkdir
Do not create directories . and ..
This commit is contained in:
commit
3cbdafcfe9
@ -5,6 +5,7 @@ Features:
|
|||||||
|
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
* Commandline interface: Always escape filenames (replace ``/``, ``:`` and ``.`` with ``_``).
|
* Commandline interface: Always escape filenames (replace ``/``, ``:`` and ``.`` with ``_``).
|
||||||
|
* Commandline interface: Do not try creating paths ``.`` and ``..``.
|
||||||
* Type system: Disallow arrays with negative length.
|
* Type system: Disallow arrays with negative length.
|
||||||
|
|
||||||
### 0.4.9 (2017-01-31)
|
### 0.4.9 (2017-01-31)
|
||||||
|
@ -461,6 +461,8 @@ void CommandLineInterface::createFile(string const& _fileName, string const& _da
|
|||||||
namespace fs = boost::filesystem;
|
namespace fs = boost::filesystem;
|
||||||
// create directory if not existent
|
// create directory if not existent
|
||||||
fs::path p(m_args.at(g_argOutputDir).as<string>());
|
fs::path p(m_args.at(g_argOutputDir).as<string>());
|
||||||
|
// Do not try creating the directory if the first item is . or ..
|
||||||
|
if (p.filename() != "." && p.filename() != "..")
|
||||||
fs::create_directories(p);
|
fs::create_directories(p);
|
||||||
string pathName = (p / _fileName).string();
|
string pathName = (p / _fileName).string();
|
||||||
ofstream outFile(pathName);
|
ofstream outFile(pathName);
|
||||||
|
Loading…
Reference in New Issue
Block a user