]> git.donarmstrong.com Git - deb_pkgs/spamass-milter.git/blob - debian/patches/fix_header_char_cast
* No longer create home directory for spamass-milter; remove on purge if
[deb_pkgs/spamass-milter.git] / debian / patches / fix_header_char_cast
1 Index: spamass-milter/spamass-milter.cpp
2 ===================================================================
3 --- spamass-milter.orig/spamass-milter.cpp      2012-06-21 13:02:08.000000000 -0700
4 +++ spamass-milter/spamass-milter.cpp   2012-06-21 13:02:15.000000000 -0700
5 @@ -363,7 +363,7 @@
6  // }}}
7  
8  /* Update a header if SA changes it, or add it if it is new. */
9 -void update_or_insert(SpamAssassin* assassin, SMFICTX* ctx, string oldstring, t_setter setter, char *header )
10 +void update_or_insert(SpamAssassin* assassin, SMFICTX* ctx, string oldstring, t_setter setter, const char *header )
11  {
12         string::size_type eoh1 = assassin->d().find("\n\n");
13         string::size_type eoh2 = assassin->d().find("\n\r\n");
14 @@ -386,15 +386,16 @@
15                 {
16                         /* change if old one was present, append if non-null */
17                         char* cstr = const_cast<char*>(newstring.c_str());
18 +                       char* hstr = const_cast<char*>(header);
19                         if (oldsize > 0)
20                         {
21                                 debug(D_UORI, "u_or_i: changing");
22 -                               smfi_chgheader(ctx, header, 1, newstring.size() > 0 ? 
23 +                               smfi_chgheader(ctx, hstr, 1, newstring.size() > 0 ? 
24                                         cstr : NULL );
25                         } else if (newstring.size() > 0)
26                         {
27                                 debug(D_UORI, "u_or_i: inserting");
28 -                               smfi_addheader(ctx, header, cstr);
29 +                               smfi_addheader(ctx, hstr, cstr);
30                         }
31                 } else
32                 {