From: Junio C Hamano Date: Thu, 23 May 2013 21:27:59 GMT Subject: Re: [PATCH] git-send-email: fix handling of special characters Message-ID: <7vtxltcrog.fsf@alter.siamese.dyndns.org> In-Reply-To: <20130523211954.GD31421@redhat.com> "Michael S. Tsirkin" writes: >> Is $author already sanitized at this point in the code? I see it >> was unwrapped with unquote_rfc2047 after it was read from the From: >> line; will it always be the same as sanitize_address($author) would >> return, and if not, would you rather compare between sanitized >> versions of sender and author, no? > > Yes. I'll have to look at the code more closely. > In my testing author here is "Michael S. Tsirkin" > so it matches the sanitized sender. > Of course that's because my name does not have non-ascii, > just a dot. So the conclusion is that the logic to see if the names are the same needs a bit more work than what was posted, I think? >> Also, isn't the $sender the same during the whole outer loop that >> iterates over @files? Do we need to apply sanitize_address() on it >> over and over for each and every logical line in the @header? >> >> This comment also applies to the other patch but they probably >> should become a single patch anyway, I guess? > > OK so now you are ok with this last bit, right? Sorry, but I am not sure what you are asking. Do I think the assignment to $sanitized_sender can and should be done just once, not once per file, if the code inspection tells us that $sender is a constant inside the foreach (@files) loop? Do I think these two are solving pretty much the same thing and is better to be done in a single patch? I didn't really think them through when I responded, but now after you made me think, I would say the answers to both of them are yes.