mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
f961b80a78
commit
ad2e34c670
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue