constification
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 6 Feb 2022 21:09:46 +0000 (21:09 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 6 Feb 2022 21:12:45 +0000 (21:12 +0000)
src/src/filter.c
src/src/functions.h
src/src/sieve.c
src/src/string.c

index bd9a3f15e47289672ff69b2357796673281015a2..887bc8bc15b455af95826776853bc556be0a0d7f 100644 (file)
@@ -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:
index 88e9431d145a161b739bf80e0f83fb3416ea31b4..9c222223b2f426942cf9a0474d5ee3be4b381a9f 100644 (file)
@@ -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);
index bd0c9b28eeb7e05a59d09e2aa677514c2d7c3479..b6b4ec6c47c241d63401b40b037ad8705c55450f 100644 (file)
@@ -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)
 {
index 0dcf552e750be306878ca3c0a920cdc0caf07f51..1e7922457cee09a2b6e0f6f175600bf2552d517b 100644 (file)
@@ -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