summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2023-08-08 08:06:40 +0900
committerNobuyoshi Nakada <[email protected]>2024-04-07 17:29:23 +0900
commit0d93fd0f69cf6b8f60d76948b2e7d1144c1cd843 ()
tree1769472e7c3cc995ec31e7e05cc1892251e77d6e /ruby.c
parent0620f006c2043c9842f2a431f14cf1d3f846fb07 (diff)
Merge `push_include_cygwin` into `push_include`
-rw-r--r--ruby.c45
1 files changed, 18 insertions, 27 deletions
@@ -444,34 +444,25 @@ push_include(const char *path, VALUE (*filter)(VALUE))
const char sep = PATH_SEP_CHAR;
const char *p, *s;
VALUE load_path = GET_VM()->load_path;
-
- p = path;
- while (*p) {
- while (*p == sep)
- p++;
- if (!*p) break;
- for (s = p; *s && *s != sep; s = CharNext(s));
- rb_ary_push(load_path, (*filter)(rubylib_path_new(p, s - p)));
- p = s;
- }
-}
-
#ifdef __CYGWIN__
-static void
-push_include_cygwin(const char *path, VALUE (*filter)(VALUE))
-{
- const char *p, *s;
char rubylib[FILENAME_MAX];
VALUE buf = 0;
p = path;
while (*p) {
- unsigned int len;
- while (*p == ';')
p++;
if (!*p) break;
- for (s = p; *s && *s != ';'; s = CharNext(s));
len = s - p;
if (*s) {
if (!buf) {
buf = rb_str_new(p, len);
@@ -488,18 +479,17 @@ push_include_cygwin(const char *path, VALUE (*filter)(VALUE))
#else
# error no cygwin_conv_path
#endif
- if (CONV_TO_POSIX_PATH(p, rubylib) == 0)
p = rubylib;
- push_include(p, filter);
- if (!*s) break;
- p = s + 1;
}
}
-#define push_include push_include_cygwin
-#endif
-
-void
ruby_push_include(const char *path, VALUE (*filter)(VALUE))
{
if (path == 0)
@@ -512,6 +502,7 @@ identical_path(VALUE path)
{
return path;
}
static VALUE
locale_path(VALUE path)
{