eve: uri_sanitize also the input homepage

Plus some style fixes and set the input as const char

Author:    Marco Trevisan (Treviño) <mail@3v1n0.net>

SVN revision: 55065
This commit is contained in:
Leandro Pereira 2010-11-29 15:29:31 +00:00
parent ea13d66f2a
commit ae8e02ef0c
4 changed files with 9 additions and 5 deletions

View File

@ -2112,7 +2112,7 @@ on_action_load_page(void *data, Evas_Object *view, void *event_info __UNUSED__)
const char *entry_data = elm_scrolled_entry_entry_get(view);
char *uri;
if ((uri = uri_sanitize((char *)entry_data)))
if ((uri = uri_sanitize(entry_data)))
{
ewk_view_uri_set(ewk_view, uri);
evas_object_focus_set(ewk_view, EINA_TRUE);

View File

@ -277,9 +277,13 @@ inline void
config_home_page_set(Config *config, const char *home_page)
{
EINA_SAFETY_ON_NULL_RETURN(config);
eina_stringshare_replace(&(config->home_page), home_page);
char *tmp_uri;
if ((tmp_uri = uri_sanitize(home_page))) {
eina_stringshare_replace(&(config->home_page), tmp_uri);
free(tmp_uri);
}
}
inline const char *
config_proxy_get(const Config *config)
{

View File

@ -579,7 +579,7 @@ session_restore(void)
}
char *
uri_sanitize(char *uri) {
uri_sanitize(const char *uri) {
char *fixed_uri;
if (!uri || !*uri) return NULL;

View File

@ -103,6 +103,6 @@ Eina_Bool tab_close_nth(Browser_Window *win, int n);
Eina_Bool tab_close_view(Browser_Window *win, Evas_Object *view);
Eina_Bool tab_close_chrome(Browser_Window *win, Evas_Object *chrome);
char * uri_sanitize(char *uri);
char * uri_sanitize(const char *uri);
#endif