summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/file.c b/file.c
index 49032957d0..57d596027a 100644
--- a/file.c
+++ b/file.c
@@ -3640,9 +3640,9 @@ rb_file_s_basename(int argc, VALUE *argv)
rb_encoding *enc;
if (rb_scan_args(argc, argv, "11", &fname, &fext) == 2) {
- rb_encoding *enc;
StringValue(fext);
- if (!rb_enc_asciicompat(enc = rb_enc_get(fext))) {
+ enc = rb_enc_get(fext);
+ if (!rb_enc_asciicompat(enc)) {
rb_raise(rb_eEncCompatError, "ascii incompatible character encodings: %s",
rb_enc_name(enc));
}