aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-09-04 21:32:55 +0800
committerXan Lopez <xan@igalia.com>2012-09-04 21:32:55 +0800
commitc11081599dd7f6b9f2c1fd627afa8af93d99fa0e (patch)
treec402f7adcbacd3bc453abbcc60f6c01a65e349a8
parent18b87ec8068c5bf98aed9f507d43cba451dab665 (diff)
downloadgsoc2013-epiphany-c11081599dd7f6b9f2c1fd627afa8af93d99fa0e.tar.gz
gsoc2013-epiphany-c11081599dd7f6b9f2c1fd627afa8af93d99fa0e.tar.zst
gsoc2013-epiphany-c11081599dd7f6b9f2c1fd627afa8af93d99fa0e.zip
embed-utils: remove extra indentation level in method
The whole method is inside an if block, just do an early return.
-rw-r--r--embed/ephy-embed-utils.c51
1 files changed, 24 insertions, 27 deletions
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c
index 6d4b98acd..5ffa4f053 100644
--- a/embed/ephy-embed-utils.c
+++ b/embed/ephy-embed-utils.c
@@ -37,40 +37,37 @@ ephy_embed_utils_link_message_parse (const char *message)
char *status_message;
char **splitted_message;
+ int i = 1;
+ char *p;
+ GString *tmp;
status_message = ephy_string_blank_chr (g_strdup (message));
- if (status_message && g_str_has_prefix (status_message, "mailto:")) {
- int i = 1;
- char *p;
- GString *tmp;
-
- /* We first want to eliminate all the things after "?", like
- * cc, subject and alike.
- */
-
- p = strchr (status_message, '?');
- if (p != NULL) *p = '\0';
-
- /* Then we also want to check if there is more than an email address
- * in the mailto: list.
- */
+ if (!status_message || !g_str_has_prefix (status_message, "mailto:"))
+ return status_message;
+
+ /* We first want to eliminate all the things after "?", like cc,
+ * subject and alike.
+ */
+ p = strchr (status_message, '?');
+ if (p != NULL) *p = '\0';
- splitted_message = g_strsplit_set (status_message, ";", -1);
- tmp = g_string_new (g_strdup_printf (_("Send an email message to “%s”"),
- (splitted_message[0] + 7)));
+ /* Then we also want to check if there is more than an email address
+ * in the mailto: list.
+ */
+ splitted_message = g_strsplit_set (status_message, ";", -1);
+ tmp = g_string_new (g_strdup_printf (_("Send an email message to “%s”"),
+ (splitted_message[0] + 7)));
- while (splitted_message [i] != NULL) {
- g_string_append_printf (tmp, ", “%s”", splitted_message[i]);
- i++;
- }
+ while (splitted_message [i] != NULL) {
+ g_string_append_printf (tmp, ", “%s”", splitted_message[i]);
+ i++;
+ }
- g_free (status_message);
- g_strfreev (splitted_message);
+ g_free (status_message);
+ g_strfreev (splitted_message);
- return g_string_free (tmp, FALSE);
- } else
- return status_message;
+ return g_string_free (tmp, FALSE);
}
gboolean