mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #3631 from nobu/bug/embeddoc-terminator-word
Fix embedded document with unterminated terminator
This commit is contained in:
@@ -19,3 +19,12 @@ assert('parsing function with void argument') do
|
||||
assert_equal "#{cmd('mrbc')}:#{a.path}:Syntax OK", result.chomp
|
||||
assert_equal 0, $?.exitstatus
|
||||
end
|
||||
|
||||
assert('embedded document with invalid terminator') do
|
||||
a, out = Tempfile.new('a.rb'), Tempfile.new('out.mrb')
|
||||
a.write("=begin\n=endx\n")
|
||||
a.flush
|
||||
result = `#{cmd('mrbc')} -c -o #{out.path} #{a.path} 2>&1`
|
||||
assert_equal "#{a.path}:3:0: embedded document meets end of file", result.chomp
|
||||
assert_equal 1, $?.exitstatus
|
||||
end
|
||||
|
||||
@@ -3580,7 +3580,7 @@ skips(parser_state *p, const char *s)
|
||||
/* skip until first char */
|
||||
for (;;) {
|
||||
c = nextc(p);
|
||||
if (c < 0) return c;
|
||||
if (c < 0) return FALSE;
|
||||
if (c == '\n') {
|
||||
p->lineno++;
|
||||
p->column = 0;
|
||||
|
||||
Reference in New Issue
Block a user