[gnome-online-accounts] utils: Domain names may not have a dot; usernames shouldn't be empty



commit 331fa0111b35a72d75ee93d40b810895e26e09a4
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Nov 3 19:54:59 2017 +0100

    utils: Domain names may not have a dot; usernames shouldn't be empty
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789187

 src/goabackend/goautils.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/src/goabackend/goautils.c b/src/goabackend/goautils.c
index 5029e07..9b00449 100644
--- a/src/goabackend/goautils.c
+++ b/src/goabackend/goautils.c
@@ -833,17 +833,12 @@ gboolean
 goa_utils_parse_email_address (const gchar *email, gchar **out_username, gchar **out_domain)
 {
   gchar *at;
-  gchar *dot;
 
   if (email == NULL || email[0] == '\0')
     return FALSE;
 
   at = strchr (email, '@');
-  if (at == NULL || *(at + 1) == '\0')
-    return FALSE;
-
-  dot = strchr (at + 1, '.');
-  if (dot == NULL || *(dot + 1) == '\0')
+  if (at == NULL || at == email || *(at + 1) == '\0')
     return FALSE;
 
   if (out_username != NULL)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]