[exim-cvs] Fix ${ipv6norm:}

Inizio della pagina
Delete this message
Reply to this message
Autore: Exim Git Commits Mailing List
Data:  
To: exim-cvs
Oggetto: [exim-cvs] Fix ${ipv6norm:}
Gitweb: https://git.exim.org/exim.git/commitdiff/8b4b6ac90766b11fa74fa3001778b49456adbe42
Commit:     8b4b6ac90766b11fa74fa3001778b49456adbe42
Parent:     18207bb52923bcd958c6bd2bcd363fa331a17362
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Tue May 4 13:06:31 2021 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Tue May 4 13:06:31 2021 +0100


    Fix ${ipv6norm:}
---
 doc/doc-txt/ChangeLog        | 4 ++++
 src/src/host.c               | 4 ++--
 test/scripts/0000-Basic/0002 | 2 +-
 test/stdout/0002             | 2 +-
 4 files changed, 8 insertions(+), 4 deletions(-)


diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index 68cec85..c3fc013 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -245,6 +245,10 @@ JH/51 Taint-check ACL line.  Previously, only filenames (for out-of-line ACL
       content) were specifically tested for.  Now, also cover epxansions
       rerulting in acl names and inline ACL content.


+JH/52 Fix ${ip6norm:} operator.  Previously, any trailing line text was dropped,
+      making it unusable in complex expressions.
+    
+



Exim version 4.94
diff --git a/src/src/host.c b/src/src/host.c
index 18f1b54..5e66517 100644
--- a/src/src/host.c
+++ b/src/src/host.c
@@ -1201,9 +1201,9 @@ for (c = buffer, k = -1, i = 0; i < 8; i++)
c++;
}

-c[-1] = '\0';    /* drop trailing colon */
+*--c = '\0';    /* drop trailing colon */


-/* debug_printf("%s: D k %d <%s> <%s>\n", __FUNCTION__, k, d, d + 2*(k+1)); */
+/* debug_printf("%s: D k %d <%s> <%s>\n", __FUNCTION__, k, buffer, buffer + 2*(k+1)); */
 if (k >= 0)
   {            /* collapse */
   c = d + 2*(k+1);
diff --git a/test/scripts/0000-Basic/0002 b/test/scripts/0000-Basic/0002
index 5101be4..d3b4984 100644
--- a/test/scripts/0000-Basic/0002
+++ b/test/scripts/0000-Basic/0002
@@ -258,7 +258,7 @@ ipv6norm:   ${ipv6norm:2a00::1}
 ipv6norm:   ${ipv6norm:2a00:eadf:0000:0000:0000:0000:0001:0000}
 ipv6norm:   ${ipv6norm:2a00:eadf:0000:0001:0000:0000:0000:0000}
 ipv6norm:   ${ipv6norm:2a00:0:0:0::}
-ipv6norm:   ${ipv6norm:2a00:2:3:4:5:6:7:8}
+ipv6norm:   ${ipv6norm:2a00:2:3:4:5:6:7:8}trailing_text
 nhash:  ${nhash_24:monty} ${nhash_8_63:monty python}
 lc/uc:  ${lc:The Quick} ${uc: Brown Fox}
 length: ${length_10:The quick brown fox} ${l_10:abc}
diff --git a/test/stdout/0002 b/test/stdout/0002
index b55571c..845b6b4 100644
--- a/test/stdout/0002
+++ b/test/stdout/0002
@@ -240,7 +240,7 @@ newline    tab\134backslash ~tilde\177DEL\200\201.

> ipv6norm: 2a00:eadf::1:0
> ipv6norm: 2a00:eadf:0:1::
> ipv6norm: 2a00::

-> ipv6norm: 2a00:2:3:4:5:6:7:8
+> ipv6norm: 2a00:2:3:4:5:6:7:8trailing_text
> nhash: 19 0/61
> lc/uc: the quick BROWN FOX
> length: The quick abc