diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-09-05 05:29:44 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-09-05 05:29:44 +0000 |
commit | ad2e34c6709a69dc748f8d33e4f541bee8c29f75 (patch) | |
tree | b045d182b20a2be3f32e3308a5e5b1ec591dbdc0 /win32 | |
parent | f961b80a787611c4235f617ebc2b3f5718ac1f02 (diff) | |
download | ruby-ad2e34c6709a69dc748f8d33e4f541bee8c29f75.tar.gz |
win32/file.c: simplify
* win32/file.c (rb_file_expand_path_internal): simplify a condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/win32/file.c b/win32/file.c index 378def715c..e3b50b450f 100644 --- a/win32/file.c +++ b/win32/file.c @@ -354,8 +354,8 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na /* determine if we need the user's home directory */ /* expand '~' only if NOT rb_file_absolute_path() where `abs_mode` is 1 */ - if (abs_mode == 0 && ((wpath_len == 1 && wpath_pos[0] == L'~') || - (wpath_len >= 2 && wpath_pos[0] == L'~' && IS_DIR_SEPARATOR_P(wpath_pos[1])))) { + if (abs_mode == 0 && wpath_len > 0 && wpath_pos[0] == L'~' && + (wpath_len == 1 || IS_DIR_SEPARATOR_P(wpath_pos[1]))) { /* tainted if expanding '~' */ tainted = 1; |