Skip to content

Commit a5d0fd9

Browse files
committed
Do not create directories . and ..
1 parent 06de89a commit a5d0fd9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Features:
55

66
Bugfixes:
77
* Commandline interface: Always escape filenames (replace ``/``, ``:`` and ``.`` with ``_``).
8+
* Commandline interface: Do not try creating paths ``.`` and ``..``.
89
* Type system: Disallow arrays with negative length.
910

1011
### 0.4.9 (2017-01-31)

solc/CommandLineInterface.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,9 @@ void CommandLineInterface::createFile(string const& _fileName, string const& _da
461461
namespace fs = boost::filesystem;
462462
// create directory if not existent
463463
fs::path p(m_args.at(g_argOutputDir).as<string>());
464-
fs::create_directories(p);
464+
// Do not try creating the directory if the first item is . or ..
465+
if (p.filename() != "." && p.filename() != "..")
466+
fs::create_directories(p);
465467
string pathName = (p / _fileName).string();
466468
ofstream outFile(pathName);
467469
outFile << _data;

0 commit comments

Comments
 (0)