[augeas-devel] [Augeas] #173: [PATCH] Parse failure in resolv lense
Augeas
trac at fedorahosted.org
Wed Jan 5 23:30:48 UTC 2011
#173: [PATCH] Parse failure in resolv lense
--------------------+-------------------------------------------------------
Reporter: erinn | Owner: lutter
Type: defect | Status: new
Priority: minor | Milestone: next
Component: Augeas | Version: 0.7.4
Keywords: |
--------------------+-------------------------------------------------------
The lens didn't take into account the semicolon comment type, only hash
marks.
Patch for lens and test case included:
diff --git a/lenses/resolv.aug b/lenses/resolv.aug
index 37b93cc..9403165 100644
--- a/lenses/resolv.aug
+++ b/lenses/resolv.aug
@@ -24,7 +24,7 @@ autoload xfm
*************************************************************************)
(* View: comment *)
-let comment = Util.comment
+let comment = Util.comment_generic /[ \t]*[;#][ \t]*/ "# "
(* View: empty *)
let empty = Util.empty
diff --git a/lenses/tests/test_resolv.aug b/lenses/tests/test_resolv.aug
index 5e2da3b..cc3f63b 100644
--- a/lenses/tests/test_resolv.aug
+++ b/lenses/tests/test_resolv.aug
@@ -1,6 +1,7 @@
module Test_resolv =
let conf = "# Sample resolv.conf
+; With multiple comment styles
nameserver 192.168.0.3
nameserver ff02::1
domain mynet.com
@@ -15,6 +16,7 @@ options no-ip6-dotint
test Resolv.lns get conf =
{ "#comment" = "Sample resolv.conf" }
+ { "#comment" = "With multiple comment styles" }
{ "nameserver" = "192.168.0.3" }
{ "nameserver" = "ff02::1" }
{ "domain" = "mynet.com" }
--
Ticket URL: <https://fedorahosted.org/augeas/ticket/173>
Augeas <http://augeas.net/>
a configuration API
More information about the augeas-devel
mailing list