diff mbox

[maintainer-tools,2/7] dim: fix end-of-line in regex

Message ID 20170809111101.11315-2-eric.engestrom@imgtec.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Engestrom Aug. 9, 2017, 11:10 a.m. UTC
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
---
 dim | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jani Nikula Aug. 9, 2017, 12:57 p.m. UTC | #1
On Wed, 09 Aug 2017, Eric Engestrom <eric.engestrom@imgtec.com> wrote:
> Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
> ---
>  dim | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/dim b/dim
> index af1baa11c7b2..eaabcec43c8f 100755
> --- a/dim
> +++ b/dim
> @@ -1970,7 +1970,7 @@ function dim_add_missing_cc
>  		name=''
>  
>  		if echo "$cc" | grep -q '<'; then
> -			name="$(echo ${cc/<*/} | sed -e 's/[[:space:]]*\$//')";
> +			name="$(echo ${cc/<*/} | sed -e 's/[[:space:]]*$//')";

What's the failure mode? It never nukes trailing space after all? Please
say so in the commit message.

BR,
Jani.

>  		fi
>  
>  		# Don't add main mailing lists
> @@ -1988,7 +1988,7 @@ function dim_add_missing_cc
>  				if [ "$testemail" != "$email" ]; then
>  					if [ -z "$name" ]; then continue; fi
>  
> -					testname="$(echo ${testcc/<*/} | sed -e 's/[[:space:]]*\$//' -e 's/^[[:space:]]*//')"
> +					testname="$(echo ${testcc/<*/} | sed -e 's/[[:space:]]*$//' -e 's/^[[:space:]]*//')"
>  
>  					if [ "$testname" != "$name" ]; then continue; fi
>  				fi
diff mbox

Patch

diff --git a/dim b/dim
index af1baa11c7b2..eaabcec43c8f 100755
--- a/dim
+++ b/dim
@@ -1970,7 +1970,7 @@  function dim_add_missing_cc
 		name=''
 
 		if echo "$cc" | grep -q '<'; then
-			name="$(echo ${cc/<*/} | sed -e 's/[[:space:]]*\$//')";
+			name="$(echo ${cc/<*/} | sed -e 's/[[:space:]]*$//')";
 		fi
 
 		# Don't add main mailing lists
@@ -1988,7 +1988,7 @@  function dim_add_missing_cc
 				if [ "$testemail" != "$email" ]; then
 					if [ -z "$name" ]; then continue; fi
 
-					testname="$(echo ${testcc/<*/} | sed -e 's/[[:space:]]*\$//' -e 's/^[[:space:]]*//')"
+					testname="$(echo ${testcc/<*/} | sed -e 's/[[:space:]]*$//' -e 's/^[[:space:]]*//')"
 
 					if [ "$testname" != "$name" ]; then continue; fi
 				fi