[evolution] Correct e_mail_formatter_canon_header_name()



commit 24cdb49dd62d73e5ca1246007028f4f050cc1723
Author: Milan Crha <mcrha redhat com>
Date:   Mon Mar 19 10:59:27 2018 +0100

    Correct e_mail_formatter_canon_header_name()
    
    The function is supposed to make ASCII header names canonized
    in a form that the first letter it capital and then also each after
    the dash letter, but there was a bug when the header name was already
    in this canonized form, then the capital letter after the dash
    had been made lower case.
    
    This had been reported downstream at:
    https://bugzilla.redhat.com/show_bug.cgi?id=1557329

 src/em-format/e-mail-formatter-utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/em-format/e-mail-formatter-utils.c b/src/em-format/e-mail-formatter-utils.c
index cd1c99b..352f880 100644
--- a/src/em-format/e-mail-formatter-utils.c
+++ b/src/em-format/e-mail-formatter-utils.c
@@ -249,7 +249,7 @@ e_mail_formatter_canon_header_name (gchar *name)
        while (*inptr) {
                if (inptr[-1] == '-' && *inptr >= 'a' && *inptr <= 'z')
                        *inptr -= 0x20;
-               else if (*inptr >= 'A' && *inptr <= 'Z')
+               else if (inptr[-1] != '-' && *inptr >= 'A' && *inptr <= 'Z')
                        *inptr += 0x20;
 
                inptr++;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]