From 44796eebc88e058a67bbc7d225f6ad448042b396 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Thu, 26 Jan 2012 15:11:40 +0000 Subject: [PATCH] Fixed date substitution SVN revision: 2428 --- src/elogd.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index 44cc269c..3a8eecbd 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -22472,18 +22472,23 @@ void submit_elog(LOGBOOK * lbs) /* substitute attributes */ if (!bedit && !isparam("reply_to")) { - for (i = 0; i < n_attr; i++) { - sprintf(str, "Subst %s", attr_list[i]); + for (index = 0; index < n_attr; index++) { + sprintf(str, "Subst %s", attr_list[index]); if (getcfg(lbs->name, str, subst_str, sizeof(subst_str))) { - strsubst_list(subst_str, sizeof(subst_str), slist, svalue, n); + + /* do not format date for date attributes */ + i = build_subst_list(lbs, slist, svalue, attrib, (attr_flags[index] & (AF_DATE | AF_DATETIME)) + == 0); + + strsubst_list(subst_str, sizeof(subst_str), slist, svalue, i); /* check for index substitution if not in edit mode */ if (!bedit && strchr(subst_str, '#')) { /* get index */ - get_auto_index(lbs, i, subst_str, str, sizeof(str)); + get_auto_index(lbs, index, subst_str, str, sizeof(str)); strcpy(subst_str, str); } - strcpy(attrib[i], subst_str); + strcpy(attrib[index], subst_str); } } }