From 14e995d2bcca571fe2414e6fa3253f074788b5ed Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 26 Nov 2016 16:26:33 +0900 Subject: [PATCH] Allow block device file to -i option --- src/download_helper.cc | 6 ++++-- 1 file 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 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; }