From a8adfa7f67840dec0fd94f25eecfb4abda208f23 Mon Sep 17 00:00:00 2001 From: 15596858998 Date: Wed, 1 Dec 2021 21:47:35 +0800 Subject: [PATCH] fixbug CLI's -D fails when the argument is not a regular file --- programs/fileio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/programs/fileio.c b/programs/fileio.c index 8e5301deed1..d3995a43436 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -742,6 +742,8 @@ static size_t FIO_createDictBuffer(void** bufferPtr, const char* fileName, FIO_p if (fileHandle==NULL) EXM_THROW(31, "%s: %s", fileName, strerror(errno)); fileSize = UTIL_getFileSize(fileName); + if (fileSize == UTIL_FILESIZE_UNKNOWN) + EXM_THROW(32, "This file format is not supported : Dictionary file %s\n", fileName); { size_t const dictSizeMax = prefs->patchFromMode ? prefs->memLimit : DICTSIZE_MAX; if (fileSize > dictSizeMax) {