aboutsummaryrefslogtreecommitdiffstats
path: root/ext/pathname
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-04 01:51:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-04 01:51:18 +0000
commit3d91322ba4b46fe3fc488c22e38e0095c6d054f2 (patch)
tree0b7bde4c9addee456352b2576041f4291cdf290b /ext/pathname
parent1d07b97a2f64289638831b4925faeb00a3402295 (diff)
downloadruby-3d91322ba4b46fe3fc488c22e38e0095c6d054f2.tar.gz
pathname.c: unnormalized Fixnum value
* ext/pathname/pathname.c (path_hash): fix unnormalized Fixnum value bug on mingw/mswin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/pathname')
-rw-r--r--ext/pathname/pathname.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/pathname/pathname.c b/ext/pathname/pathname.c
index 4fe8859353..5987ccf462 100644
--- a/ext/pathname/pathname.c
+++ b/ext/pathname/pathname.c
@@ -155,11 +155,15 @@ path_cmp(VALUE self, VALUE other)
return INT2FIX(0);
}
+#ifndef ST2FIX
+#define ST2FIX(h) LONG2FIX((long)(h))
+#endif
+
/* :nodoc: */
static VALUE
path_hash(VALUE self)
{
- return INT2FIX(rb_str_hash(get_strpath(self)));
+ return ST2FIX(rb_str_hash(get_strpath(self)));
}
/*