Skip to content
Browse files

Shellvars: handle bash's implicit concatenation of quoted strings

  • Loading branch information...
1 parent 49bfdb1 commit 4886fba19d1e673f894255f4d6dc8a94133f0df2 Michal Filka committed with
Showing with 5 additions and 1 deletion.
  1. +1 −0 AUTHORS
  2. +1 −1 lenses/shellvars.aug
  3. +3 −0 lenses/tests/test_shellvars.aug
View
1 AUTHORS
@@ -27,6 +27,7 @@ Contributions by:
Dominique Dumont <dominique.dumont@hp.com>
Craig Dunn <craig@craigdunn.org>
Free Ekanayaka <free@64studio.com>
+ Michal Filka <michal.filka@suse.cz>
Marc Fournier <marc.fournier@camptocamp.com>
Travis Groth <tgroth@gmail.com>
Adam Helms <helms.adam@gmail.com>
View
2 lenses/shellvars.aug
@@ -50,7 +50,7 @@ module Shellvars =
(* but fairly close. *)
let simple_value =
let empty_array = /\([ \t]*\)/ in
- store (char* | dquot | squot | bquot | dollar_assign | empty_array)
+ store (char* | (dquot | squot)+ | bquot | dollar_assign | empty_array)
let export = [ key "export" . Util.del_ws_spc ]
let kv = [ Util.indent . export? . key key_re
View
3 lenses/tests/test_shellvars.aug
@@ -81,6 +81,9 @@ unset ONBOOT # We do not want this var
test Shellvars.lns get "var=\"ab#c\"\n" =
{ "var" = "\"ab#c\"" }
+ test Shellvars.lns get "ESSID='Joe'\"'\"'s net'\n" =
+ { "ESSID" = "'Joe'\"'\"'s net'" }
+
(* For some reason, `` conflicts with comment_eol *)
test Shellvars.lns get "var=`ab#c`\n" =
{ "var" = "`ab"

0 comments on commit 4886fba

Please sign in to comment.
Something went wrong with that request. Please try again.