|
|
c537d4 |
From 92274bd3ff47d3cc4511d934dae06f16b59db7ad Mon Sep 17 00:00:00 2001
|
|
|
c537d4 |
From: Dominic Cleal <dcleal@redhat.com>
|
|
|
c537d4 |
Date: Mon, 16 Dec 2013 20:45:36 +0000
|
|
|
c537d4 |
Subject: [PATCH] Sysconfig: permit empty comments after comment lines
|
|
|
c537d4 |
|
|
|
c537d4 |
Fixes RHBZ#1043636
|
|
|
c537d4 |
---
|
|
|
c537d4 |
lenses/sysconfig.aug | 3 ++-
|
|
|
c537d4 |
lenses/tests/test_sysconfig.aug | 4 ++++
|
|
|
c537d4 |
2 files changed, 6 insertions(+), 1 deletion(-)
|
|
|
c537d4 |
|
|
|
c537d4 |
diff --git a/lenses/sysconfig.aug b/lenses/sysconfig.aug
|
|
|
c537d4 |
index a39d7f3..ee83af1 100644
|
|
|
c537d4 |
--- a/lenses/sysconfig.aug
|
|
|
c537d4 |
+++ b/lenses/sysconfig.aug
|
|
|
c537d4 |
@@ -11,7 +11,8 @@ module Sysconfig =
|
|
|
c537d4 |
let key_re = Shellvars.key_re
|
|
|
c537d4 |
let eq = Util.del_str "="
|
|
|
c537d4 |
|
|
|
c537d4 |
- let comment = Util.comment
|
|
|
c537d4 |
+ let eol_for_comment = del /([ \t]*\n)([ \t]*(#[ \t]*)?\n)*/ "\n"
|
|
|
c537d4 |
+ let comment = Util.comment_generic_seteol /[ \t]*#[ \t]*/ "# " eol_for_comment
|
|
|
c537d4 |
let comment_or_eol = Shellvars.comment_or_eol
|
|
|
c537d4 |
|
|
|
c537d4 |
let empty = Util.empty
|
|
|
c537d4 |
diff --git a/lenses/tests/test_sysconfig.aug b/lenses/tests/test_sysconfig.aug
|
|
|
c537d4 |
index 3e9356d..539ad99 100644
|
|
|
c537d4 |
--- a/lenses/tests/test_sysconfig.aug
|
|
|
c537d4 |
+++ b/lenses/tests/test_sysconfig.aug
|
|
|
c537d4 |
@@ -142,6 +142,10 @@ unset ONBOOT # We do not want this var
|
|
|
c537d4 |
test lns put "var=v\n" after set "/var" "v\"w"=
|
|
|
c537d4 |
"var='v\"w'\n"
|
|
|
c537d4 |
|
|
|
c537d4 |
+ (* RHBZ#1043636: empty comment lines after comments *)
|
|
|
c537d4 |
+ test lns get "#MOUNTD_NFS_V3\n#\n" =
|
|
|
c537d4 |
+ { "#comment" = "MOUNTD_NFS_V3" }
|
|
|
c537d4 |
+
|
|
|
c537d4 |
(* Local Variables: *)
|
|
|
c537d4 |
(* mode: caml *)
|
|
|
c537d4 |
(* End: *)
|
|
|
c537d4 |
--
|
|
|
c537d4 |
1.8.4.2
|
|
|
c537d4 |
|