diff options
author | Tony Wang <wwwjfy@gmail.com> | 2013-08-25 09:10:19 +0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-08-25 15:54:06 -0700 |
commit | 5559962f6f584e3bce45e29676ef2d0c44e36124 (patch) | |
tree | bcae678513787e292143a17d0d79ea161b2b2edb /builtin_test.cpp | |
parent | 1d67d8ff23669814ed92d5d328a65174bfc72efd (diff) |
use wstat in test command to follow symbolic link
Diffstat (limited to 'builtin_test.cpp')
-rw-r--r-- | builtin_test.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin_test.cpp b/builtin_test.cpp index 2fd3f916..0d16823a 100644 --- a/builtin_test.cpp +++ b/builtin_test.cpp @@ -829,7 +829,7 @@ static bool unary_primary_evaluate(test_expressions::token_t token, const wcstri return !wstat(arg, &buf) && S_ISREG(buf.st_mode); case test_filetype_G: // "-G", for check effective group id - return !lwstat(arg, &buf) && getegid() == buf.st_gid; + return !wstat(arg, &buf) && getegid() == buf.st_gid; case test_filetype_g: // "-g", for set-group-id return !wstat(arg, &buf) && (S_ISGID & buf.st_mode); @@ -839,7 +839,7 @@ static bool unary_primary_evaluate(test_expressions::token_t token, const wcstri return !lwstat(arg, &buf) && S_ISLNK(buf.st_mode); case test_filetype_O: // "-O", for check effective user id - return !lwstat(arg, &buf) && geteuid() == buf.st_uid; + return !wstat(arg, &buf) && geteuid() == buf.st_uid; case test_filetype_p: // "-p", for FIFO return !wstat(arg, &buf) && S_ISFIFO(buf.st_mode); |