[exim-cvs] Fix lsearch ret=full

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Exim Git Commits Mailing List
Datum:  
To: exim-cvs
Betreff: [exim-cvs] Fix lsearch ret=full
Gitweb: https://git.exim.org/exim.git/commitdiff/b690a53ed619f5adfa532bf8cc9ab13c1c806b3c
Commit:     b690a53ed619f5adfa532bf8cc9ab13c1c806b3c
Parent:     1b9ab35f323121aabf029f0496c7227818efad14
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sun Aug 2 15:25:43 2020 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sun Aug 2 15:25:43 2020 +0100


    Fix lsearch ret=full
---
 src/src/lookups/lsearch.c    |  2 +-
 test/scripts/0000-Basic/0002 | 14 +++++++-------
 test/stdout/0002             | 14 +++++++-------
 3 files changed, 15 insertions(+), 15 deletions(-)


diff --git a/src/src/lookups/lsearch.c b/src/src/lookups/lsearch.c
index 4da422e..10927dd 100644
--- a/src/src/lookups/lsearch.c
+++ b/src/src/lookups/lsearch.c
@@ -154,7 +154,7 @@ for (BOOL this_is_eol, last_was_eol = TRUE;
     linekeylength = t - buffer;
     if (*s) s++;            /* Past terminating " */
     if (ret_full)
-      Ustrcpy(t, s);            /* copy the rest of line does also */
+      memmove(t, s, Ustrlen(s)+1);    /* copy the rest of line also */
     }


   /* Otherwise it is terminated by a colon or white space */
diff --git a/test/scripts/0000-Basic/0002 b/test/scripts/0000-Basic/0002
index 4d170ec..70b4e5f 100644
--- a/test/scripts/0000-Basic/0002
+++ b/test/scripts/0000-Basic/0002
@@ -563,13 +563,13 @@ q5:  ${lookup{"quoted"}   lsearch{DIR/aux-fixed/0002.quoted}}
 q6:  ${lookup{white space}lsearch{DIR/aux-fixed/0002.quoted}}
 q7:  ${lookup{b\\s}       lsearch{DIR/aux-fixed/0002.quoted}}


-q1:  ${lookup{abc}        lsearch,ret=full{DIR/aux-fixed/0002.quoted}}
-q2:  ${lookup{xyz}        lsearch,ret=full{DIR/aux-fixed/0002.quoted}}
-q3:  ${lookup{pqr}        lsearch,ret=full{DIR/aux-fixed/0002.quoted}}
-q4:  ${lookup{a:b}        lsearch,ret=full{DIR/aux-fixed/0002.quoted}}
-q5:  ${lookup{"quoted"}   lsearch,ret=full{DIR/aux-fixed/0002.quoted}}
-q6:  ${lookup{white space}lsearch,ret=full{DIR/aux-fixed/0002.quoted}}
-q7:  ${lookup{b\\s}       lsearch,ret=full{DIR/aux-fixed/0002.quoted}}
+q1f: ${lookup{abc}        lsearch,ret=full{DIR/aux-fixed/0002.quoted}}
+q2f: ${lookup{xyz}        lsearch,ret=full{DIR/aux-fixed/0002.quoted}}
+q3f: ${lookup{pqr}        lsearch,ret=full{DIR/aux-fixed/0002.quoted}}
+q4f: ${lookup{a:b}        lsearch,ret=full{DIR/aux-fixed/0002.quoted}}
+q5f: ${lookup{"quoted"}   lsearch,ret=full{DIR/aux-fixed/0002.quoted}}
+q6f: ${lookup{white space}lsearch,ret=full{DIR/aux-fixed/0002.quoted}}
+q7f: ${lookup{b\\s}       lsearch,ret=full{DIR/aux-fixed/0002.quoted}}


 abc:   ${lookup{abc}wildlsearch{DIR/aux-var/0002.wild}}
 a.b.c: ${lookup{a.b.c}wildlsearch{DIR/aux-var/0002.wild}}
diff --git a/test/stdout/0002 b/test/stdout/0002
index df659d2..02ba087 100644
--- a/test/stdout/0002
+++ b/test/stdout/0002
@@ -527,13 +527,13 @@ newline    tab\134backslash ~tilde\177DEL\200\201.

> q6: "white space"
> q7: "b\\s"
>

-> q1:  abc           "abc"
-> q2:  xyz:          "xyz":
-> q3:  pqr  :        "pqr"  :
-> q4:  a:b           "a:b" abc continued data (make sure not key)
-> q5:  "quoted"    "\"quoted\""
-> q6:  white space   "white space"
-> q7:  b\s          "b\\s"
+> q1f: abc           "abc"
+> q2f: xyz:          "xyz":
+> q3f: pqr  :        "pqr"  :
+> q4f: a:b           "a:b" abc continued data (make sure not key)
+> q5f: "quoted"    "\"quoted\""
+> q6f: white space   "white space"
+> q7f: b\s          "b\\s"

>
> abc: abc
> a.b.c: *.b.c