Fix issue when xinetd.conf does not end in newline (#2040)

Add a newline symbol to the end of the parsed input.

Sample hexdump of a file deployed by xinetd cookbook:

$ hexdump -C /var/chef/cache/cookbooks/xinetd/templates/default/xinetd.conf.erb | tail -2
000000b0  72 20 2f 65 74 63 2f 78  69 6e 65 74 64 2e 64     |r /etc/xinetd.d|
000000bf

Signed-off-by: Simonas Kareiva <simonas@5grupe.lt>
This commit is contained in:
Simonas 2017-08-02 16:29:26 +03:00 committed by Christoph Hartmann
parent 4ae34928ca
commit da75f268bc

View file

@ -211,7 +211,7 @@ module XinetdParser
res = {}
cur_group = nil
simple_conf = []
rest = raw
rest = raw + "\n"
until rest.empty?
# extract content line
nl = rest.index("\n") || (rest.length-1)