mirror of
https://github.com/rkd77/elinks.git
synced 2025-10-21 19:54:04 -04:00
gopher: ensure slash after entity type in links
This prevents links with null selectors being interpreted as pointing to a (likely non-existent) file gopher://server/1 An example of a page with such links: gopher://gopher.floodgap.com/1/new
This commit is contained in:
committed by
Witold Filipczyk
parent
38c12d9dfc
commit
e9152c8772
@@ -527,6 +527,10 @@ add_gopher_menu_line(struct string *buffer, unsigned char *line)
|
||||
add_format_to_string(&address, "gopher://%s/%c",
|
||||
host, entity);
|
||||
|
||||
/* Ensure we put a slash after entity type */
|
||||
if (selector[0] != '/')
|
||||
add_char_to_string(&address, '/');
|
||||
|
||||
/* Encode selector string */
|
||||
encode_selector_string(&address, selector);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user