+
+ static void substvar(buffer_t *buf, const segment seg) {
+ const char *res;
+ char tmp[STRING];
+ char var[STRING];
+
+ if (m_strncpy(var, sizeof(var), seg.s, seg.len) <= 0)
+ return;
+
+ if ((res = getenv(var))) {
+ buffer_addstr(buf, res);
+ return;
+ }
+ if (mutt_option_value(var, tmp, sizeof(tmp))) {
+ buffer_addstr(buf, tmp);
+ }
+ }