diff --git a/src/file_collection.cc b/src/file_collection.cc index 81224f95..cc1819b2 100644 --- a/src/file_collection.cc +++ b/src/file_collection.cc @@ -649,10 +649,9 @@ file_collection::expand_filename( } auto filename_key = loo.loo_filename.empty() ? path : loo.loo_filename; - auto glob_flags = lnav::filesystem::is_glob(path) ? 0 : GLOB_NOCHECK; - if (glob(path.c_str(), glob_flags, nullptr, gl.inout()) == 0) { - int lpc; - + auto glob_flags = lnav::filesystem::is_glob(path) ? GLOB_NOCHECK : 0; + auto glob_rc = glob(path.c_str(), glob_flags, nullptr, gl.inout()); + if (glob_rc == 0) { if (gl->gl_pathc == 1 /*&& gl.gl_matchc == 0*/) { /* It's a pattern that doesn't match any files * yet, allow it through since we'll load it in @@ -696,7 +695,7 @@ file_collection::expand_filename( } std::lock_guard lg(REALPATH_CACHE_MUTEX); - for (lpc = 0; lpc < (int) gl->gl_pathc; lpc++) { + for (size_t lpc = 0; lpc < gl->gl_pathc; lpc++) { auto path_str = std::string(gl->gl_pathv[lpc]); auto iter = REALPATH_CACHE.find(path_str); @@ -768,6 +767,8 @@ file_collection::expand_filename( } } } + } else if (glob_rc != GLOB_NOMATCH) { + log_error("glob(%s) failed -- %s", path.c_str(), strerror(errno)); } } diff --git a/src/lnav.cc b/src/lnav.cc index 0e98c520..6dcce06b 100644 --- a/src/lnav.cc +++ b/src/lnav.cc @@ -3077,9 +3077,8 @@ SELECT tbl_name FROM sqlite_master WHERE sql LIKE 'CREATE VIRTUAL TABLE%' = file_path_str.substr(0, colon_index); file_loc = vis_line_t(scan_res.value()); } else { - log_warning( - "failed to parse line number from file path " - "with colon: %s", + log_info( + "did not parse line number from file path with colon: %s", file_path_str.c_str()); } } diff --git a/test/test_remote.sh b/test/test_remote.sh index 946b19f1..318d3d59 100644 --- a/test/test_remote.sh +++ b/test/test_remote.sh @@ -81,6 +81,17 @@ check_error_output "no error for nonexistent-host?" < test_remote.err + +mv test_remote.err `test_err_filename` +check_error_output "no error for nonexistent-host?" <