forked from hercules-team/augeas
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* src/put.c (create_del): do not unescape the string before writing i…
…t out We already unescape the default for a del when we read the lens file. Doing it during put will cause two rounds of unescaping to happen, which is wrong. Fixes: hercules-team#507
- Loading branch information
Showing
3 changed files
with
18 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module Pass_Create_Del = | ||
|
||
(* del, on create, would do another round of unescaping the default value | ||
* which is wrong. See Issue #507 *) | ||
let sep = del /:([ \t]*\\\\\n[ \t]*:)?/ ":\\\n\t:" | ||
|
||
let lns = [ label "entry" . sep . store /[a-z]+/ ]* | ||
|
||
test lns get ":a:\\\n:b" = | ||
{ "entry" = "a" } | ||
{ "entry" = "b" } | ||
|
||
test lns put ":a" after | ||
set "/entry[last()+1]" "b" = ":a:\\\n\t:b" |