Parse keywords from Debian control file in a non-greedy way
Previously this: Description: foo: bar had been parsed into "Description: foo" -> "bar" Now it properly parses into "Description" -> "foo: bar"
This commit is contained in:
parent
56f38bcdcf
commit
0ea7f96495
1 changed files with 2 additions and 2 deletions
|
|
@ -101,10 +101,10 @@ module DebImporter
|
|||
name=value=''
|
||||
data.each_line do |line|
|
||||
case line
|
||||
when /^(.+): (.+)/ # "Key: Value"
|
||||
when /^(.+?): (.+)/ # "Key: Value"
|
||||
fields[name.to_sym]=value unless value.empty?
|
||||
name,value=$1,$2
|
||||
when /^(.+):$/ # "Key:" (start of multi-line entry without value in line)
|
||||
when /^(.+?):$/ # "Key:" (start of multi-line entry without value in line)
|
||||
fields[name.to_sym]=value unless value.empty?
|
||||
name=$1
|
||||
value=''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue