diff --git a/NEWS b/NEWS index eb286605..166539a3 100644 --- a/NEWS +++ b/NEWS @@ -43,6 +43,8 @@ Miscellaneous: * Really retry forever when connection.retries = 0. * enhancement: Session-specific options. Any options changed with toggle-* actions no longer affect other tabs or other terminals. +* Do not crash when document.browse.minimum_refresh_time = 0 and + a document has a meta refresh with a delay of 0. * enhancement: Domain-specific options. Use set_domain in elinks.conf to e.g. disable cookies for google.com. The option manager window does not yet support this. diff --git a/src/document/refresh.c b/src/document/refresh.c index 1580e1ef..4d815409 100644 --- a/src/document/refresh.c +++ b/src/document/refresh.c @@ -15,6 +15,7 @@ #include "document/document.h" #include "document/refresh.h" #include "document/view.h" +#include "main/select.h" #include "main/timer.h" #include "protocol/uri.h" #include "session/download.h" @@ -120,6 +121,14 @@ start_document_refresh(struct document_refresh *refresh, if (compare_uri(refresh->uri, type_query->uri, URI_BASE)) return; + if (time == 0) { + /* Use register_bottom_half() instead of install_timer() + * because the latter asserts that the delay is greater + * than 0. */ + register_bottom_half(do_document_refresh, doc_view); + return; + } + install_timer(&refresh->timer, time, do_document_refresh, doc_view); } diff --git a/test/refresh-0timeout.html b/test/refresh-0timeout.html new file mode 100644 index 00000000..9bf59f1f --- /dev/null +++ b/test/refresh-0timeout.html @@ -0,0 +1,6 @@ + + + + Redirect to / after 0 seconds. + +