Skip to content

Commit e0fe9a8

Browse files
committed
* regparse.c (onig_syntax_warn): do not use external strings as
printf format. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent e3a1701 commit e0fe9a8

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Mon May 31 19:25:58 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
2+
3+
* regparse.c (onig_syntax_warn): do not use external strings as
4+
printf format.
5+
16
Mon May 31 18:22:23 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
27

38
* misc/ruby-mode.el (ruby-mode-set-encoding): skip shebang line

regparse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2859,9 +2859,9 @@ onig_syntax_warn(ScanEnv *env, const char *fmt, ...)
28592859
(const UChar *)fmt, args);
28602860
va_end(args);
28612861
if (env->sourcefile == NULL)
2862-
rb_warn((char *)buf);
2862+
rb_warn("%s", (char *)buf);
28632863
else
2864-
rb_compile_warn(env->sourcefile, env->sourceline, (char *)buf);
2864+
rb_compile_warn(env->sourcefile, env->sourceline, "%s", (char *)buf);
28652865
}
28662866

28672867
static void

test/ruby/test_regexp.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,4 +823,8 @@ def test_dup_warn
823823
assert_in_out_err('-w', 'x=/[\u3042\u3042]/', [], /duplicated/)
824824
assert_in_out_err('-w', 'x=/[\u3042\u3041-\u3043]/', [], /duplicated/)
825825
end
826+
827+
def test_property_warn
828+
assert_in_out_err('-w', 'x=/\p%s/', [], %r"warning: invalid Unicode Property \\p: /\\p%s/")
829+
end
826830
end

0 commit comments

Comments
 (0)