1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[session] const in goto_url_with_hook

This commit is contained in:
Witold Filipczyk 2022-02-21 18:34:06 +01:00
parent f3496ae098
commit f97d3e6164
2 changed files with 6 additions and 8 deletions

View File

@ -742,14 +742,14 @@ goto_url(struct session *ses, char *url)
}
struct uri *
get_hooked_uri(char *uristring, struct session *ses, char *cwd)
get_hooked_uri(const char *uristring_, struct session *ses, char *cwd)
{
struct uri *uri;
char *uristring = stracpy(uristring_);
#if defined(CONFIG_SCRIPTING) || defined(CONFIG_URI_REWRITE)
static int goto_url_event_id = EVENT_NONE;
uristring = stracpy(uristring);
if (!uristring) return NULL;
set_event_id(goto_url_event_id, "goto-url");
@ -759,14 +759,12 @@ get_hooked_uri(char *uristring, struct session *ses, char *cwd)
uri = *uristring ? get_translated_uri(uristring, cwd) : NULL;
#if defined(CONFIG_SCRIPTING) || defined(CONFIG_URI_REWRITE)
mem_free(uristring);
#endif
return uri;
}
void
goto_url_with_hook(struct session *ses, char *url)
goto_url_with_hook(struct session *ses, const char *url)
{
char *cwd = ses->tab->term->cwd;
struct uri *uri;
@ -785,7 +783,7 @@ goto_url_with_hook(struct session *ses, char *url)
int
goto_url_home(struct session *ses)
{
char *homepage = get_opt_str("ui.sessions.homepage", ses);
const char *homepage = get_opt_str("ui.sessions.homepage", ses);
if (!*homepage) homepage = getenv("WWW_HOME");
if (!homepage || !*homepage) homepage = WWW_HOME_URL;

View File

@ -31,13 +31,13 @@ void ses_goto(struct session *, struct uri *, char *,
struct location *, cache_mode_T, enum task_type, int);
struct view_state *ses_forward(struct session *, int);
struct uri *get_hooked_uri(char *uristring, struct session *ses, char *cwd);
struct uri *get_hooked_uri(const char *uristring, struct session *ses, char *cwd);
void goto_uri(struct session *ses, struct uri *uri);
void goto_uri_frame(struct session *, struct uri *, char *, cache_mode_T);
void delayed_goto_uri_frame(void *);
void goto_url(struct session *, char *);
void goto_url_with_hook(struct session *, char *);
void goto_url_with_hook(struct session *, const char *);
int goto_url_home(struct session *ses);
void goto_imgmap(struct session *, struct uri *, char *);
void map_selected(struct terminal *term, void *ld, void *ses);