aboutsummaryrefslogtreecommitdiffstats
path: root/dir.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-11-18 21:47:18 +0900
committerGitHub <noreply@github.com>2021-11-18 21:47:18 +0900
commit89b440bf724b5e670da0fa31c36a7945a7ddc80f (patch)
treedaa36283f6064ce209b62fb97422a8d41da6a63c /dir.c
parent68963244658ef7dacd48affcb2afca29419e847e (diff)
downloadruby-89b440bf724b5e670da0fa31c36a7945a7ddc80f.tar.gz
Expect bool as `sort:` option at glob [Feature #18287]
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index 4e552d772a..184dbf007e 100644
--- a/dir.c
+++ b/dir.c
@@ -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