diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-11-18 21:47:18 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-18 21:47:18 +0900 |
commit | 89b440bf724b5e670da0fa31c36a7945a7ddc80f (patch) | |
tree | daa36283f6064ce209b62fb97422a8d41da6a63c /dir.c | |
parent | 68963244658ef7dacd48affcb2afca29419e847e (diff) |
Expect bool as `sort:` option at glob [Feature #18287]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5084
Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -112,6 +112,7 @@ char *strchr(char*,char); #include "internal/file.h" #include "internal/gc.h" #include "internal/io.h" +#include "internal/object.h" #include "internal/vm.h" #include "ruby/encoding.h" #include "ruby/ruby.h" @@ -2937,7 +2938,7 @@ dir_glob_option_base(VALUE base) static int dir_glob_option_sort(VALUE sort) { - return (sort ? 0 : FNM_GLOB_NOSORT); + return (rb_bool_expected(sort, "sort") ? 0 : FNM_GLOB_NOSORT); } static VALUE |