summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2022-02-06 21:09:46 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2022-02-06 21:12:45 +0000
commitdbab2d6f08acd5ccf71d5e8a6cdc1224ab857d7a (patch)
tree88db8b630d861ab5190442ae574514441c7397a2
parent8d6cb5fdac4b2bab0922fe431e12d8f7cc02d723 (diff)
constification
-rw-r--r--src/src/filter.c2
-rw-r--r--src/src/functions.h5
-rw-r--r--src/src/sieve.c4
-rw-r--r--src/src/string.c11
4 files changed, 14 insertions, 8 deletions
diff --git a/src/src/filter.c b/src/src/filter.c
index bd9a3f15e..887bc8bc1 100644
--- a/src/src/filter.c
+++ b/src/src/filter.c
@@ -1553,7 +1553,7 @@ switch (c->type)
break;
case cond_contains:
- yield = strstric(exp[0], exp[1], FALSE) != NULL;
+ yield = strstric_c(exp[0], exp[1], FALSE) != NULL;
break;
case cond_CONTAINS:
diff --git a/src/src/functions.h b/src/src/functions.h
index 88e9431d1..9c222223b 100644
--- a/src/src/functions.h
+++ b/src/src/functions.h
@@ -478,7 +478,7 @@ extern void set_process_info(const char *, ...) PRINTF_FUNCTION(1,2);
extern void sha1_end(hctx *, const uschar *, int, uschar *);
extern void sha1_mid(hctx *, const uschar *);
extern void sha1_start(hctx *);
-extern int sieve_interpret(uschar *, int, uschar *, uschar *, uschar *,
+extern int sieve_interpret(const uschar *, int, uschar *, uschar *, uschar *,
uschar *, address_item **, uschar **);
extern void sigalrm_handler(int);
extern void smtp_closedown(uschar *);
@@ -588,7 +588,8 @@ extern uschar *string_nextinlist_trc(const uschar **listptr, int *separator, usc
extern int strcmpic(const uschar *, const uschar *);
extern int strncmpic(const uschar *, const uschar *, int);
-extern uschar *strstric(const uschar *, const uschar *, BOOL);
+extern uschar *strstric(uschar *, uschar *, BOOL);
+extern const uschar *strstric_c(const uschar *, const uschar *, BOOL);
extern int test_harness_fudged_queue_time(int);
extern void tcp_init(void);
diff --git a/src/src/sieve.c b/src/src/sieve.c
index bd0c9b28e..b6b4ec6c4 100644
--- a/src/src/sieve.c
+++ b/src/src/sieve.c
@@ -54,7 +54,7 @@
struct Sieve
{
- uschar *filter;
+ const uschar *filter;
const uschar *pc;
int line;
const uschar *errmsg;
@@ -3554,7 +3554,7 @@ Returns: FF_DELIVERED success, a significant action was taken
*/
int
-sieve_interpret(uschar *filter, int options, uschar *vacation_directory,
+sieve_interpret(const uschar *filter, int options, uschar *vacation_directory,
uschar *enotify_mailto_owner, uschar *useraddress, uschar *subaddress,
address_item **generated, uschar **error)
{
diff --git a/src/src/string.c b/src/src/string.c
index 0dcf552e7..1e7922457 100644
--- a/src/src/string.c
+++ b/src/src/string.c
@@ -770,11 +770,11 @@ Arguments:
Returns: pointer to substring in string, or NULL if not found
*/
-uschar *
-strstric(const uschar * s, const uschar * t, BOOL space_follows)
+const uschar *
+strstric_c(const uschar * s, const uschar * t, BOOL space_follows)
{
const uschar * p = t;
-uschar * yield = NULL;
+const uschar * yield = NULL;
int cl = tolower(*p);
int cu = toupper(*p);
@@ -805,6 +805,11 @@ while (*s)
return NULL;
}
+uschar *
+strstric(uschar * s, uschar * t, BOOL space_follows)
+{
+return US strstric_c(s, t, space_follows);
+}
#ifdef COMPILE_UTILITY