From 8c2dc42d502348076744c89f7bee3fa38f210a8b Mon Sep 17 00:00:00 2001 From: Federico Kircheis Date: Sat, 29 Jun 2019 15:00:17 +0200 Subject: [PATCH] Replace `template` variable with `tmpl` `virtual` is a reserved keyword in c++ --- hcache/hcache.c | 2 +- mutt/regex.c | 14 +++++++------- mutt/regex3.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hcache/hcache.c b/hcache/hcache.c index 221c7e746..a9465ebaa 100644 --- a/hcache/hcache.c +++ b/hcache/hcache.c @@ -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 */ diff --git a/mutt/regex.c b/mutt/regex.c index 378324fc1..2c52305c5 100644 --- a/mutt/regex.c +++ b/mutt/regex.c @@ -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++; } diff --git a/mutt/regex3.h b/mutt/regex3.h index e6f5687f3..2ec72a15d 100644 --- a/mutt/regex3.h +++ b/mutt/regex3.h @@ -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); -- 2.40.0