Permalink
Browse files

Fix handling negative indexes in @indent.

  • Loading branch information...
1 parent ab3071b commit 99576e153a8d252d9f483b90b3a9743264ab75d5 @bacek bacek committed Jan 30, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/YAML/Tiny.pm
View
@@ -280,7 +280,7 @@ method _read_array(@array, @indent, @lines) {
pir::die("YAML::Tiny failed to classify line '{ @lines[0] }'");
}
}
- elsif pir::defined(@indent[-2]) && @indent[-1] == @indent[-2] {
+ elsif (@indent > 1) && (@indent[-1] == @indent[-2]) {
# This is probably a structure like the following...
# ---
# foo:

0 comments on commit 99576e1

Please sign in to comment.