constification
[exim.git] / src / src / expand.c
index cff5e9c1ab795d2f66f70b6b51afef03f8a70a8a..900026f077958794691a010b8f537e303e37fc55 100644 (file)
@@ -750,17 +750,8 @@ static var_entry var_table[] = {
   { "spool_directory",     vtype_stringptr,   &spool_directory },
   { "spool_inodes",        vtype_pinodes,     (void *)TRUE },
   { "spool_space",         vtype_pspace,      (void *)TRUE },
-#ifdef EXPERIMENTAL_SRS_ALT
-  { "srs_db_address",      vtype_stringptr,   &srs_db_address },
-  { "srs_db_key",          vtype_stringptr,   &srs_db_key },
-  { "srs_orig_recipient",  vtype_stringptr,   &srs_orig_recipient },
-  { "srs_orig_sender",     vtype_stringptr,   &srs_orig_sender },
-#endif
-#if defined(EXPERIMENTAL_SRS_ALT) || defined(SUPPORT_SRS)
+#ifdef SUPPORT_SRS
   { "srs_recipient",       vtype_stringptr,   &srs_recipient },
-#endif
-#ifdef EXPERIMENTAL_SRS_ALT
-  { "srs_status",          vtype_stringptr,   &srs_status },
 #endif
   { "thisaddress",         vtype_stringptr,   &filter_thisaddress },
 
@@ -4733,7 +4724,7 @@ while (*s)
   skipping, but "break" otherwise so we get debug output for the item
   expansion. */
   {
-  int start = yield->ptr;
+  int start = gstring_length(yield);
   switch(item_type)
     {
     /* Call an ACL from an expansion.  We feed data in via $acl_arg1 - $acl_arg9.
@@ -5956,8 +5947,7 @@ while (*s)
 
         /* Copy the characters before the match, plus the expanded insertion. */
 
-       if (ovec[0] > moffset)
-         yield = string_catn(yield, subject + moffset, ovec[0] - moffset);
+       yield = string_catn(yield, subject + moffset, ovec[0] - moffset);
 
         if (!(insert = expand_string(sub[2])))
          goto EXPAND_FAILED;
@@ -7013,12 +7003,12 @@ while (*s)
     /*NOTREACHED*/
 
   DEBUG(D_expand)
-    if (start > 0 || *s)       /* only if not the sole expansion of the line */
+    if (yield && (start > 0 || *s))    /* only if not the sole expansion of the line */
       debug_expansion_interim(US"item-res",
                              yield->s + start, yield->ptr - start, skipping);
   continue;
 
-NOT_ITEM:
+NOT_ITEM: ;
   }
 
   /* Control reaches here if the name is not recognized as one of the more