[PATCH] dim: Handle wrapped Message-Id lines

Steven Price steven.price at arm.com
Thu Sep 10 13:37:52 UTC 2020


If a Message-Id is wrapped (by the email server or client) then white
space can creep in at the beginning. This causes the generated 'Link:'
tag to be broken. Fix it by stripping spaces as well as '<>'.

Signed-off-by: Steven Price <steven.price at arm.com>
---
This has already affected several commits e.g. 925896486522 ("video:
fbdev: tgafb: Avoid comma separated statements").
---
 dim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dim b/dim
index e4f4d2e..ab89352 100755
--- a/dim
+++ b/dim
@@ -432,7 +432,7 @@ from email.parser import Parser
 headers = Parser().parse(open('$1', 'r'))
 message_id = headers['message-id']
 if message_id is not None:
-    print(message_id.strip('<>'))
+    print(message_id.strip('<> '))
 EOF
 }
 
-- 
2.20.1



More information about the dim-tools mailing list