]> www.infradead.org Git - users/dedekind/aiaiai.git/commitdiff
email-sh-functions: fix e-mail addresses processing
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 5 Feb 2014 13:39:30 +0000 (15:39 +0200)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 5 Feb 2014 15:12:12 +0000 (17:12 +0200)
This patch is a bug-fix. It fixes the 'strip_address()' and 'merge_addresses()'
which were for some reason removing all the blanks from the list of addresses.
The result was that "Artem Bityutskiy" became "ArtemBityutskiy".

Instead of removing all blanks, it is supposed to make multiple blanks to
become a single white-space.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
email/aiaiai-email-sh-functions

index 01acc9d104a72749a4d47c1fa89a471ec5cd8a84..5474577f067165ae7131d7fc360e157045a19a55 100644 (file)
@@ -76,7 +76,7 @@ strip_address()
        # address is equivalent to the local+xyz@domain address.
        printf "%s" "$list" | LC_ALL=C sed -e "s/[^,]*$l+\{0,1\}[^@]*@$d[^,]*//g" \
                                           -e "s/,,/,/g" -e "s/^,//" -e "s/,$//" \
-                                          -e "s/[[:blank:]]\+//g"
+                                          -e "s/[[:blank:]]\+/ /g"
 }
 
 # Fetch project name from a list of e-mail address. The project is specified like
@@ -109,7 +109,7 @@ merge_addresses()
        local list="$(printf "%s" "$addr1,$addr2" | LC_ALL=C tr -d "\n")"
 
        printf "%s" "$list" | LC_ALL=C sed -e "s/,,/,/g" -e "s/^,//" \
-                                          -e "s/,$//" -e "s/[[:blank:]]\+//g"
+                                          -e "s/,$//" -e "s/[[:blank:]]\+/ /g"
 }
 
 # A helper function for 'ini_config_get()' (from libshell) which fails when