postfix/pointer_to_literals.patch

79 lines
3.3 KiB
Diff
Raw Normal View History

Nur in postfix-2.3.2/: FILE_TO_FIX.
Nur in postfix-2.3.2-orig/: postfix-2.3.0.
diff -r -u postfix-2.3.2-orig/src/cleanup/cleanup_message.c postfix-2.3.2/src/cleanup/cleanup_message.c
--- postfix-2.3.2-orig/src/cleanup/cleanup_message.c 2006-06-15 20:07:15.000000000 +0200
+++ postfix-2.3.2/src/cleanup/cleanup_message.c 2007-03-05 18:10:32.000000000 +0100
@@ -288,7 +288,7 @@
while (*optional_text && ISSPACE(*optional_text))
optional_text++;
-#define STREQUAL(x,y,l) (strncasecmp((x), (y), (l)) == 0 && (y)[l] == 0)
+inline int STREQUAL(const char *x, const char *y, size_t l) { return (strncasecmp((x), (y), (l)) == 0 && (y)[l] == 0); }
#define CLEANUP_ACT_DROP 0
/*
diff -r -u postfix-2.3.2-orig/src/local/local_expand.c postfix-2.3.2/src/local/local_expand.c
--- postfix-2.3.2-orig/src/local/local_expand.c 2005-05-31 15:44:14.000000000 +0200
+++ postfix-2.3.2/src/local/local_expand.c 2007-03-05 17:59:03.000000000 +0100
@@ -114,7 +114,7 @@
{
LOCAL_EXP *local = (LOCAL_EXP *) ptr;
-#define STREQ(x,y) (*(x) == *(y) && strcmp((x), (y)) == 0)
+inline int STREQ(const char *x, const char *y) { return (*(x) == *(y) && strcmp((x), (y)) == 0); }
if (STREQ(name, "user")) {
return (local->state->msg_attr.user);
diff -r -u postfix-2.3.2-orig/src/smtpd/smtpd_check.c postfix-2.3.2/src/smtpd/smtpd_check.c
--- postfix-2.3.2-orig/src/smtpd/smtpd_check.c 2006-07-07 22:32:43.000000000 +0200
+++ postfix-2.3.2/src/smtpd/smtpd_check.c 2007-03-07 13:36:48.000000000 +0100
@@ -353,6 +353,10 @@
#define CONST_STR(x) ((const char *) vstring_str(x))
#define UPDATE_STRING(ptr,val) { if (ptr) myfree(ptr); ptr = mystrdup(val); }
+inline int STREQ(const char *x, const char *y) { return (*(x) == *(y) && strcmp((x), (y)) == 0); }
+inline int STREQUAL(const char *x, const char *y, size_t l) { return (strncasecmp((x), (y), (l)) == 0 && (y)[l] == 0); }
+inline int STREQN(const char *x, const char *y, size_t n) { return (*(x) == *(y) && strncmp((x), (y), (n)) == 0); }
+
/*
* If some decision can't be made due to a temporary error, then change
* other decisions into deferrals.
@@ -1928,8 +1932,6 @@
if (msg_verbose)
msg_info("%s: %s %s %s", myname, table, value, datum);
-#define STREQUAL(x,y,l) (strncasecmp((x), (y), (l)) == 0 && (y)[l] == 0)
-
/*
* DUNNO means skip this table. Silently ignore optional text.
*/
@@ -2767,7 +2769,6 @@
/*
* "sender_name" or "recipient_name".
*/
-#define STREQ(x,y) (*(x) == *(y) && strcmp((x), (y)) == 0)
else if (STREQ(suffix, MAIL_ATTR_S_NAME)) {
if (*addr) {
@@ -2817,7 +2818,6 @@
if (msg_verbose > 1)
msg_info("smtpd_expand_lookup: ${%s}", name);
-#define STREQN(x,y,n) (*(x) == *(y) && strncmp((x), (y), (n)) == 0)
#define CONST_LEN(x) (sizeof(x) - 1)
/*
diff -r -u postfix-2.3.2-orig/src/util/dict_open.c postfix-2.3.2/src/util/dict_open.c
--- postfix-2.3.2-orig/src/util/dict_open.c 2007-03-05 17:09:12.000000000 +0100
+++ postfix-2.3.2/src/util/dict_open.c 2007-03-05 18:07:42.000000000 +0100
@@ -454,7 +454,7 @@
}
#ifndef NO_DYNAMIC_MAPS
-#define STREQ(x,y) (x == y || (x[0] == y[0] && strcmp(x,y) == 0))
+inline int STREQ(const char *x, const char *y) { return ( x == y || (*(x) == *(y) && strcmp((x), (y)) == 0)); }
void dict_open_dlinfo(const char *path)
{
Nur in postfix-2.3.2/: TOFIX.