Fair warning: this slightly changes the behaviour, as $testname would
previously contain the email if $testcc didn't contain a name.
Shouldn't affect anything though.

Signed-off-by: Eric Engestrom <eric.engest...@imgtec.com>
---
 dim | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/dim b/dim
index 4ffac497c621..481a53e23035 100755
--- a/dim
+++ b/dim
@@ -1965,7 +1965,9 @@ function email_get_address
 
 function email_get_name
 {
-       sed -e 's/[[:space:]]*<.*$//' <<< "$1"
+       if grep -q '<' <<< "$1"; then
+               sed -e 's/[[:space:]]*<.*$//' <<< "$1"
+       fi
 }
 
 function dim_add_missing_cc
@@ -1977,11 +1979,7 @@ function dim_add_missing_cc
 
        git show | scripts/get_maintainer.pl --email --norolestats 
--pattern-depth 1 | while read cc; do
                email="$(email_get_address "$cc")"
-               name=''
-
-               if echo "$cc" | grep -q '<'; then
-                       name="$(email_get_name "$cc")";
-               fi
+               name="$(email_get_name "$cc")"
 
                # Don't add main mailing lists
                if [ "$email" = "dri-de...@lists.freedesktop.org" -o \
-- 
Cheers,
  Eric

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to