summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--template.c10
2 files changed, 12 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 283ae834..575208f3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
---------------------------------------------------------------------------
Version 1.12.4 (RGer), 2006-??-??
+- added '$' as ToPos proptery replacer specifier - means "up to the
+ end of the string
---------------------------------------------------------------------------
Version 1.12.3 (RGer), 2006-10-04
- implemented some changes to support Solaris (but support is not
diff --git a/template.c b/template.c
index 0947018a..2cb6b8cc 100644
--- a/template.c
+++ b/template.c
@@ -389,6 +389,16 @@ static int do_Parameter(char **pp, struct template *pTpl)
p = regex_end + 5/*strlen("--end")*/;
free(regex_char);
}
+ } else if(*p == '$') {
+ /* shortcut for "end of message */
+ p++; /* eat '$' */
+ /* in this case, we do a quick, somewhat dirty but totally
+ * legitimate trick: we simply use a topos that is higher than
+ * potentially ever can happen. The code below checks that no copy
+ * will occur after the end of string, so this is perfectly legal.
+ * rgerhards, 2006-10-17
+ */
+ pTpe->data.field.iToPos = 9999999;
} else {
/* fallthrough to "regular" ToPos code */
#endif /* #ifdef FEATURE_REGEXP */