aboutsummaryrefslogtreecommitdiffhomepage
path: root/wutil.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-05-07 17:31:24 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-05-07 17:31:24 -0700
commit0c79bb6e7c679552faba6cb333592eb1da26db35 (patch)
tree6eb08236422a8f31862f1d898d8fddcf08eb0b3c /wutil.cpp
parent1a264ab7c20cbd0e20eef3e3d83fedb7b69c163d (diff)
Factor is_potential_path to properly handle CDPATH
This will let us color cd commands better
Diffstat (limited to 'wutil.cpp')
-rw-r--r--wutil.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/wutil.cpp b/wutil.cpp
index da664916..2e4d47cf 100644
--- a/wutil.cpp
+++ b/wutil.cpp
@@ -73,10 +73,11 @@ bool wreaddir_resolving(DIR *dir, const std::wstring &dir_path, std::wstring &ou
out_name = str2wcstring(d->d_name);
if (out_is_dir) {
+ /* The caller cares if this is a directory, so check */
bool is_dir;
if (d->d_type == DT_DIR) {
is_dir = true;
- } else if (d->d_type == DT_LNK) {
+ } else if (d->d_type == DT_LNK || d->d_type == DT_UNKNOWN) {
/* We want to treat symlinks to directories as directories. Use stat to resolve it. */
cstring fullpath = wcs2string(dir_path);
fullpath.push_back('/');