]> granicus.if.org Git - neomutt/commitdiff
Replace `template` variable with `tmpl`
authorFederico Kircheis <federico.kircheis@gmail.com>
Sat, 29 Jun 2019 13:00:17 +0000 (15:00 +0200)
committerRichard Russon <rich@flatcap.org>
Fri, 5 Jul 2019 01:03:47 +0000 (02:03 +0100)
`virtual` is a reserved keyword in c++

hcache/hcache.c
mutt/regex.c
mutt/regex3.h

index 221c7e7464fd698f753c64c984d2a27c3231220e..a9465ebaabe0019954f4c2895591cac6b44583cf 100644 (file)
@@ -281,7 +281,7 @@ header_cache_t *mutt_hcache_open(const char *path, const char *folder, hcache_na
     STAILQ_FOREACH(sp, &SpamList, entries)
     {
       mutt_md5_process(sp->regex->pattern, &md5ctx);
-      mutt_md5_process(sp->template, &md5ctx);
+      mutt_md5_process(sp->tmpl, &md5ctx);
     }
 
     /* Mix in user's nospam list */
index 378324fc121371916199ae69516ab0e5d2d95c74..2c52305c55dca7ca0e0a422d90f1918f4be21945 100644 (file)
@@ -285,7 +285,7 @@ int mutt_replacelist_add(struct ReplaceList *rl, const char *pat,
        * re-adds conceptually. So we probably want this to imply a
        * removal, then do an add. We can achieve the removal by freeing
        * the template, and leaving t pointed at the current item.  */
-      FREE(&np->template);
+      FREE(&np->tmpl);
       break;
     }
   }
@@ -305,7 +305,7 @@ int mutt_replacelist_add(struct ReplaceList *rl, const char *pat,
   }
 
   /* Now np is the ReplaceListNode that we want to modify. It is prepared. */
-  np->template = mutt_str_strdup(templ);
+  np->tmpl = mutt_str_strdup(templ);
 
   /* Find highest match number in template string */
   np->nmatch = 0;
@@ -392,9 +392,9 @@ char *mutt_replacelist_apply(struct ReplaceList *rl, char *buf, size_t buflen, c
       mutt_debug(5, "%s matches %s\n", src, np->regex->pattern);
 
       /* Copy into other twinbuf with substitutions */
-      if (np->template)
+      if (np->tmpl)
       {
-        for (p = np->template; *p && (tlen < 1023);)
+        for (p = np->tmpl; *p && (tlen < 1023);)
         {
           if (*p == '%')
           {
@@ -455,7 +455,7 @@ void mutt_replacelist_free(struct ReplaceList *rl)
   {
     STAILQ_REMOVE(rl, np, ReplaceListNode, entries);
     mutt_regex_free(&np->regex);
-    FREE(&np->template);
+    FREE(&np->tmpl);
     FREE(&np);
   }
 }
@@ -500,7 +500,7 @@ bool mutt_replacelist_match(struct ReplaceList *rl, char *buf, size_t buflen, co
       mutt_debug(5, "%d subs\n", (int) np->regex->regex->re_nsub);
 
       /* Copy template into buf, with substitutions. */
-      for (p = np->template; *p && tlen < buflen - 1;)
+      for (p = np->tmpl; *p && tlen < buflen - 1;)
       {
         /* backreference to pattern match substring, eg. %1, %2, etc) */
         if (*p == '%')
@@ -575,7 +575,7 @@ int mutt_replacelist_remove(struct ReplaceList *rl, const char *pat)
     {
       STAILQ_REMOVE(rl, np, ReplaceListNode, entries);
       mutt_regex_free(&np->regex);
-      FREE(&np->template);
+      FREE(&np->tmpl);
       FREE(&np);
       nremoved++;
     }
index e6f5687f3188cd0fb88c7b21377e50cfef39bfc9..2ec72a15d1a1ff8ff79ef9f3a055c6583846383b 100644 (file)
@@ -78,7 +78,7 @@ struct ReplaceListNode
 {
   struct Regex *regex;      /**< Regex containing a regular expression */
   size_t nmatch;            /**< Match the 'nth' occurrence (0 means the whole expression) */
-  char *template;           /**< Template to match */
+  char *tmpl;               /**< Template to match */
   STAILQ_ENTRY(ReplaceListNode) entries; /**< Next item in list */
 };
 STAILQ_HEAD(ReplaceList, ReplaceListNode);