Fix lsearch ret=full
authorJeremy Harris <jgh146exb@wizmail.org>
Sun, 2 Aug 2020 14:25:43 +0000 (15:25 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 2 Aug 2020 14:25:43 +0000 (15:25 +0100)
src/src/lookups/lsearch.c
test/scripts/0000-Basic/0002
test/stdout/0002

index 4da422e9eb51e1e17f945a45d2638a4108029855..10927dd8270f37e30ffd285475a4c2c39a6b4511 100644 (file)
@@ -154,7 +154,7 @@ for (BOOL this_is_eol, last_was_eol = TRUE;
     linekeylength = t - buffer;
     if (*s) s++;                       /* Past terminating " */
     if (ret_full)
     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 */
     }
 
   /* Otherwise it is terminated by a colon or white space */
index 4d170ec687570a6f14fcdfd8b3c2f8a2daf445e5..70b4e5f94ce85fcc89cde89fc3021379b2071d56 100644 (file)
@@ -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}}
 
 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}}
 
 abc:   ${lookup{abc}wildlsearch{DIR/aux-var/0002.wild}}
 a.b.c: ${lookup{a.b.c}wildlsearch{DIR/aux-var/0002.wild}}
index df659d2d41748c2b5405d24333a3f147dd784b94..02ba087bab6946d829877f93b388211ac24a09ef 100644 (file)
@@ -527,13 +527,13 @@ newline   tab\134backslash ~tilde\177DEL\200\201.
 > q6:  "white space"
 > q7:  "b\\s"
 > 
 > 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
 > 
 > abc:   abc
 > a.b.c: *.b.c