mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-10 18:23:28 +00:00
Avoid double substitutions on 'preset on reply'
SVN revision: 2270
This commit is contained in:
parent
4c065a6271
commit
7f7c9e1bb4
35
src/elogd.c
35
src/elogd.c
@ -9319,20 +9319,31 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
|
|||||||
|
|
||||||
if (!breedit || (breedit && i == 2)) { /* subst on reedit only if preset is under condition */
|
if (!breedit || (breedit && i == 2)) { /* subst on reedit only if preset is under condition */
|
||||||
|
|
||||||
/* do not format date for date attributes */
|
/* check for multiple substitution */
|
||||||
i = build_subst_list(lbs, slist, svalue, attrib, (attr_flags[index] & (AF_DATE | AF_DATETIME))
|
strlcpy(str, preset, sizeof(str));
|
||||||
== 0);
|
if (strchr(str, '$'))
|
||||||
strsubst_list(preset, sizeof(preset), slist, svalue, i);
|
*strchr(str, '$') = 0;
|
||||||
|
if (strchr(str, '%'))
|
||||||
|
*strchr(str, '%') = 0;
|
||||||
|
if (strchr(str, '#'))
|
||||||
|
*strchr(str, '#') = 0;
|
||||||
|
if (strncmp(str, attrib[index], strlen(str)) != 0) {
|
||||||
|
|
||||||
/* check for index substitution */
|
/* do not format date for date attributes */
|
||||||
if (!bedit && (strchr(preset, '%') || strchr(preset, '#'))) {
|
i = build_subst_list(lbs, slist, svalue, attrib, (attr_flags[index] & (AF_DATE | AF_DATETIME))
|
||||||
/* get index */
|
== 0);
|
||||||
get_auto_index(lbs, index, preset, str, sizeof(str));
|
strsubst_list(preset, sizeof(preset), slist, svalue, i);
|
||||||
strcpy(preset, str);
|
|
||||||
|
/* check for index substitution */
|
||||||
|
if (!bedit && (strchr(preset, '%') || strchr(preset, '#'))) {
|
||||||
|
/* get index */
|
||||||
|
get_auto_index(lbs, index, preset, str, sizeof(str));
|
||||||
|
strcpy(preset, str);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!strchr(preset, '%'))
|
||||||
|
strcpy(attrib[index], preset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strchr(preset, '%'))
|
|
||||||
strcpy(attrib[index], preset);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user