sigh, missed refresh

pull/1265/head
Tim Stack 2 months ago
parent 4d87676a2a
commit e0ff892d02

@ -3056,6 +3056,7 @@ com_open(exec_context& ec, std::string cmdline, std::vector<std::string>& args)
if (file_iter == lnav_data.ld_active_files.fc_files.end()) { if (file_iter == lnav_data.ld_active_files.fc_files.end()) {
auto_mem<char> abspath; auto_mem<char> abspath;
struct stat st; struct stat st;
size_t url_index;
if (is_url(fn.c_str())) { if (is_url(fn.c_str())) {
#ifndef HAVE_LIBCURL #ifndef HAVE_LIBCURL
@ -3075,9 +3076,16 @@ com_open(exec_context& ec, std::string cmdline, std::vector<std::string>& args)
retval = ""; retval = "";
} }
#endif #endif
} else if (fn.find("://") != std::string::npos) { } else if ((url_index = fn.find("://")) != std::string::npos) {
const auto& cfg const auto& cfg
= injector::get<const lnav::url_handler::config&>(); = injector::get<const lnav::url_handler::config&>();
const auto HOST_REGEX
= lnav::pcre2pp::code::from_const("://(?:\\?|$)");
auto find_res = HOST_REGEX.find_in(fn).ignore_error();
if (find_res) {
fn.insert(url_index + 3, "localhost");
}
auto_mem<CURLU> cu(curl_url_cleanup); auto_mem<CURLU> cu(curl_url_cleanup);
cu = curl_url(); cu = curl_url();

Loading…
Cancel
Save