From f9178eb084acc624320f2de26c16a1a7652f55a6 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 20 Apr 2023 17:40:34 -0500 Subject: [PATCH] fix: no such file or directory warning in transmission-cli (#5426) --- cli/cli.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/cli.cc b/cli/cli.cc index decf13b2b..d4858a388 100644 --- a/cli/cli.cc +++ b/cli/cli.cc @@ -259,7 +259,8 @@ int tr_main(int argc, char* argv[]) tr_ctorSetPaused(ctor, TR_FORCE, false); - if (tr_ctorSetMetainfoFromFile(ctor, torrentPath, nullptr) || tr_ctorSetMetainfoFromMagnetLink(ctor, torrentPath, nullptr)) + if (tr_sys_path_exists(torrentPath) ? tr_ctorSetMetainfoFromFile(ctor, torrentPath, nullptr) : + tr_ctorSetMetainfoFromMagnetLink(ctor, torrentPath, nullptr)) { // all good }