Skip to content

Commit

Permalink
* re.c: parenthesize macro arguments.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
akr committed Dec 27, 2010
1 parent ea71589 commit 195992f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Mon Dec 27 18:27:13 2010 Tanaka Akira <[email protected]>

* re.c: parenthesize macro arguments.

Mon Dec 27 15:22:23 2010 NAKAMURA Usaku <[email protected]>

* win32/README.win32: note to need NT based OS to build ruby.
Expand Down
6 changes: 3 additions & 3 deletions re.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ VALUE rb_eRegexpError;
typedef char onig_errmsg_buffer[ONIG_MAX_ERROR_MESSAGE_LEN];
#define errcpy(err, msg) strlcpy((err), (msg), ONIG_MAX_ERROR_MESSAGE_LEN)

#define BEG(no) regs->beg[no]
#define END(no) regs->end[no]
#define BEG(no) (regs->beg[(no)])
#define END(no) (regs->end[(no)])

#if 'a' == 97 /* it's ascii */
static const char casetable[] = {
Expand Down Expand Up @@ -3282,7 +3282,7 @@ rb_reg_regsub(VALUE str, VALUE src, struct re_registers *regs, VALUE regexp)
rb_encoding *str_enc = rb_enc_get(str);
rb_encoding *src_enc = rb_enc_get(src);
int acompat = rb_enc_asciicompat(str_enc);
#define ASCGET(s,e,cl) (acompat ? (*cl=1,ISASCII(s[0])?s[0]:-1) : rb_enc_ascget(s, e, cl, str_enc))
#define ASCGET(s,e,cl) (acompat ? (*(cl)=1,ISASCII((s)[0])?(s)[0]:-1) : rb_enc_ascget((s), (e), (cl), str_enc))

p = s = RSTRING_PTR(str);
e = s + RSTRING_LEN(str);
Expand Down

0 comments on commit 195992f

Please sign in to comment.