X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/e5a9dba621b4301bfbe2bc05576ddc5ec752b1b5..0d7eb84a5719dda876c4b7def944d721cd259e19:/src/src/expand.c diff --git a/src/src/expand.c b/src/src/expand.c index 8677ccb5b..b19e64f5e 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/expand.c,v 1.21 2005/05/10 10:19:11 ph10 Exp $ */ +/* $Cambridge: exim/src/src/expand.c,v 1.24 2005/06/07 15:20:56 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -466,6 +466,9 @@ static var_entry var_table[] = { { "sender_host_name", vtype_host_lookup, NULL }, { "sender_host_port", vtype_int, &sender_host_port }, { "sender_ident", vtype_stringptr, &sender_ident }, + { "sender_rate", vtype_stringptr, &sender_rate }, + { "sender_rate_limit", vtype_stringptr, &sender_rate_limit }, + { "sender_rate_period", vtype_stringptr, &sender_rate_period }, { "sender_rcvhost", vtype_stringptr, &sender_rcvhost }, { "sender_verify_failure",vtype_stringptr, &sender_verify_failure }, { "smtp_active_hostname", vtype_stringptr, &smtp_active_hostname }, @@ -1361,7 +1364,7 @@ while (last > first) if (*ss == NULL && deliver_datafile >= 0) /* Read body when needed */ { uschar *body; - int start_offset = SPOOL_DATA_START_OFFSET; + off_t start_offset = SPOOL_DATA_START_OFFSET; int len = message_body_visible; if (len > message_size) len = message_size; *ss = body = store_malloc(len+1); @@ -1593,8 +1596,8 @@ if (name[0] == 0) cond_type = chop_match(name, cond_table, sizeof(cond_table)/sizeof(uschar *)); switch(cond_type) { - /* def: tests for a non-zero or non-NULL variable, or for an existing - header */ + /* def: tests for a non-empty variable, or for the existence of a header. If + yield == NULL we are in a skipping state, and don't care about the answer. */ case ECOND_DEF: if (*s != ':') @@ -1619,8 +1622,8 @@ switch(cond_type) (find_header(name, TRUE, NULL, FALSE, NULL) != NULL) == testfor; } - /* Test for a variable's having a non-empty value. If yield == NULL we - are in a skipping state, and don't care about the answer. */ + /* Test for a variable's having a non-empty value. A non-existent variable + causes an expansion failure. */ else { @@ -1632,8 +1635,7 @@ switch(cond_type) string_sprintf("unknown variable \"%s\" after \"def:\"", name); return NULL; } - if (yield != NULL) - *yield = (value[0] != 0 && Ustrcmp(value, "0") != 0) == testfor; + if (yield != NULL) *yield = (value[0] != 0) == testfor; } return s; @@ -2318,11 +2320,15 @@ if (*s == '}') goto RETURN; } +/* The first following string must be braced. */ + +if (*s++ != '{') goto FAILED_CURLY; + /* Expand the first substring. Forced failures are noticed only if we actually want this string. Set skipping in the call in the fail case (this will always be the case if we were already skipping). */ -sub1 = expand_string_internal(s+1, TRUE, &s, !yes); +sub1 = expand_string_internal(s, TRUE, &s, !yes); if (sub1 == NULL && (yes || !expand_string_forcedfail)) goto FAILED; expand_string_forcedfail = FALSE; if (*s++ != '}') goto FAILED_CURLY; @@ -4534,10 +4540,10 @@ while (*s != 0) smode[10] = 0; s = string_sprintf("mode=%04lo smode=%s inode=%ld device=%ld links=%ld " - "uid=%ld gid=%ld size=%ld atime=%ld mtime=%ld ctime=%ld", + "uid=%ld gid=%ld size=%.30g atime=%ld mtime=%ld ctime=%ld", (long)(st.st_mode & 077777), smode, (long)st.st_ino, (long)st.st_dev, (long)st.st_nlink, (long)st.st_uid, - (long)st.st_gid, (long)st.st_size, (long)st.st_atime, + (long)st.st_gid, (double)st.st_size, (long)st.st_atime, (long)st.st_mtime, (long)st.st_ctime); yield = string_cat(yield, &size, &ptr, s, Ustrlen(s)); continue;