# HG changeset patch # User rosfran # Date 1164921906 0 # Node ID 585b3db817a13c890d38a8f89f7e4c4f789e7587 # Parent 4b24a328c65512a41441e2a5b8addc8349ffccb4 [svn r158] Fixes seg fault when getting URI fields. diff -r 4b24a328c655 -r 585b3db817a1 gmyth/src/gmyth_uri.h --- a/gmyth/src/gmyth_uri.h Thu Nov 30 21:05:13 2006 +0000 +++ b/gmyth/src/gmyth_uri.h Thu Nov 30 21:25:06 2006 +0000 @@ -104,15 +104,15 @@ GType gmyth_uri_get_type (void); GMythURI* gmyth_uri_new (void); GMythURI* gmyth_uri_new_with_value (const gchar *value); -gboolean gmyth_uri_is_equals (GMythURI* uri1, GMythURI* uri2); -#define gmyth_uri_get_host(urip) (urip->host->str) -#define gmyth_uri_get_port(urip) (urip->port) -#define gmyth_uri_get_protocol(urip) (urip->protocol->str) -#define gmyth_uri_get_path(urip) (urip->path->str) -#define gmyth_uri_get_user(urip) (urip->user->str) -#define gmyth_uri_get_password(urip) (urip->password->str) -#define gmyth_uri_get_fragment(urip) (urip->fragment->str) -#define gmyth_uri_get_query(urip) (urip->query->str) +gboolean gmyth_uri_is_equals (GMythURI* uri1, GMythURI* uri2); +#define gmyth_uri_get_host(urip) ( urip->host != NULL ? urip->host->str : "" ) +#define gmyth_uri_get_port(urip) (urip->port) +#define gmyth_uri_get_protocol(urip) ( urip->protocol != NULL ? urip->protocol->str : "" ) +#define gmyth_uri_get_path(urip) ( urip->path != NULL ? urip->path->str : "" ) +#define gmyth_uri_get_user(urip) ( urip->user != NULL ? urip->user->str : "" ) +#define gmyth_uri_get_password(urip) ( urip->password != NULL ? urip->password->str : "" ) +#define gmyth_uri_get_fragment(urip) ( urip->fragment != NULL ? urip->fragment->str : "" ) +#define gmyth_uri_get_query(urip) ( urip->query != NULL ? urip->query->str : "" ) G_END_DECLS