Skip to content

Commit

Permalink
Fix issue where $1 seems to be set to nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Hieta committed Apr 25, 2012
1 parent 71c43ca commit 42470a2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/camper_van/command_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ def parse(line)
args = []
until line.empty? do
line =~ /^(\S+)(\s|$)/
if $1
if $1.start_with?(":")
group = $1
if group
if group.start_with?(":")
args << line[1..-1]
break
else
args << $1
line = line[$1.size..-1]
args << group
line = line[group.size..-1]
line = line.sub(/^\s+/,"")
end
else
Expand Down

0 comments on commit 42470a2

Please sign in to comment.