From ad2e34c6709a69dc748f8d33e4f541bee8c29f75 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 5 Sep 2012 05:29:44 +0000 Subject: 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 --- win32/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'win32/file.c') 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; -- cgit v1.2.3