diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-11-26 16:26:33 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-11-26 16:26:33 +0900 |
| commit | 14e995d2bcca571fe2414e6fa3253f074788b5ed (patch) | |
| tree | fa4fa4d4372ed8e599a0f690135469e6f810ee1a | |
| parent | bebd602ba7ee686b7eb7a176e71efa1c0621108f (diff) | |
Allow block device file to -i option
| -rw-r--r-- | src/download_helper.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/download_helper.cc b/src/download_helper.cc index 42b96513..6de3d12e 100644 --- a/src/download_helper.cc +++ b/src/download_helper.cc @@ -529,8 +529,10 @@ std::shared_ptr<UriListParser> openUriListParser(const std::string& filename) listPath = DEV_STDIN; } else { - if (!File(filename).isFile()) { - throw DL_ABORT_EX(fmt(EX_FILE_OPEN, filename.c_str(), "No such file")); + auto f = File(filename); + if (!f.exists() || f.isDir()) { + throw DL_ABORT_EX(fmt(EX_FILE_OPEN, filename.c_str(), + "File not found or it is a directory")); } listPath = filename; } |
