summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-12 04:35:53 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-12 04:35:53 +0000
commit37ce3f6e0d7cbd97a82078beef12f68438cbdc86 (patch)
treef105331ab5b2f0e8562062a667d9666e284d734c /file.c
parent33ede4d01ced3789d2c83bf82364389635c26a3c (diff)
* file.c (realpath_rec): trace symbolic link only when supporting
readline(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/file.c b/file.c
index 969c75eb16..bc5071ed8d 100644
--- a/file.c
+++ b/file.c
@@ -3133,6 +3133,7 @@ realpath_rec(long *prefixlenp, VALUE *resolvedp, char *unresolved, VALUE loopche
rb_sys_fail(RSTRING_PTR(testpath));
}
}
+#ifdef HAVE_READLINK
if (S_ISLNK(sbuf.st_mode)) {
volatile VALUE link;
char *link_prefix, *link_names;
@@ -3152,7 +3153,9 @@ realpath_rec(long *prefixlenp, VALUE *resolvedp, char *unresolved, VALUE loopche
}
rb_hash_aset(loopcheck, testpath, rb_str_dup_frozen(*resolvedp));
}
- else {
+ else
+#endif
+ {
VALUE s = rb_str_dup_frozen(testpath);
rb_hash_aset(loopcheck, s, s);
*resolvedp = testpath;