[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[augeas-devel] augeas: master - Shellvars: allow arrays that span multiple lines



Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=bf0a31202fd8059d1f235681d74a0c95ba021e54
Commit:        bf0a31202fd8059d1f235681d74a0c95ba021e54
Parent:        a8d97e30ec4435e9af310a04aea6e51f2074bc9e
Author:        David Lutterkort <lutter redhat com>
AuthorDate:    Wed Dec 2 11:19:09 2009 -0800
Committer:     David Lutterkort <lutter redhat com>
CommitterDate: Wed Dec 9 10:29:32 2009 -0800

Shellvars: allow arrays that span multiple lines

---
 lenses/shellvars.aug            |    2 +-
 lenses/tests/test_shellvars.aug |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug
index ec8518c..b407bac 100644
--- a/lenses/shellvars.aug
+++ b/lenses/shellvars.aug
@@ -22,7 +22,7 @@ module Shellvars =
     let array_value = store (char+ | dquot) in
     del "(" "(" . counter "values" .
       [ seq "values" . array_value ] .
-      [ del /[ \t]+/ " " . seq "values" . array_value ] *
+      [ del /[ \t\n]+/ " " . seq "values" . array_value ] *
       . del ")" ")"
 
   (* Treat an empty list () as a value '()'; that's not quite correct *)
diff --git a/lenses/tests/test_shellvars.aug b/lenses/tests/test_shellvars.aug
index d161b4f..94fb747 100644
--- a/lenses/tests/test_shellvars.aug
+++ b/lenses/tests/test_shellvars.aug
@@ -100,6 +100,12 @@ unset ONBOOT
     set "var/3" "v3"
   = "var=(v1 v2 v3)\n"
 
+  test Shellvars.lns get "var=(v1 v2   \n    \t v3)\n" =
+  { "var"
+    { "1" = "v1" }
+    { "2" = "v2" }
+    { "3" = "v3" } }
+
 (* Local Variables: *)
 (* mode: caml       *)
 (* End:             *)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]