Skip to content

Commit

Permalink
Sysconfig: permit empty comments after comment lines
Browse files Browse the repository at this point in the history
Fixes RHBZ#1043636
  • Loading branch information
Dominic Cleal committed Dec 16, 2013
1 parent 69eb611 commit 92274bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lenses/sysconfig.aug
Expand Up @@ -11,7 +11,8 @@ module Sysconfig =
let key_re = Shellvars.key_re
let eq = Util.del_str "="

let comment = Util.comment
let eol_for_comment = del /([ \t]*\n)([ \t]*(#[ \t]*)?\n)*/ "\n"
let comment = Util.comment_generic_seteol /[ \t]*#[ \t]*/ "# " eol_for_comment
let comment_or_eol = Shellvars.comment_or_eol

let empty = Util.empty
Expand Down
4 changes: 4 additions & 0 deletions lenses/tests/test_sysconfig.aug
Expand Up @@ -142,6 +142,10 @@ unset ONBOOT # We do not want this var
test lns put "var=v\n" after set "/var" "v\"w"=
"var='v\"w'\n"

(* RHBZ#1043636: empty comment lines after comments *)
test lns get "#MOUNTD_NFS_V3\n#\n" =
{ "#comment" = "MOUNTD_NFS_V3" }

(* Local Variables: *)
(* mode: caml *)
(* End: *)

0 comments on commit 92274bd

Please sign in to comment.