aboutsummaryrefslogtreecommitdiffstats
path: root/dir.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-26 05:51:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-12-26 05:51:36 +0000
commit859f3d14eda5ecd59ed7a7172dc63cdfa2acba92 (patch)
tree696e310045987ee69419787515593fdb506a542f /dir.c
parentea9ff28f80165ec054106702ee38f5995bc4a491 (diff)
downloadruby-859f3d14eda5ecd59ed7a7172dc63cdfa2acba92.tar.gz
never-NULL pointer check
* dir.c (ruby_glob0): no need to check never-NULL pointer. reported by Denis Denisov <denji0k AT gmail.com>. * win32/file.c (rb_file_expand_path_internal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index 5386ff03f2..5190ea4e9e 100644
--- a/dir.c
+++ b/dir.c
@@ -1690,7 +1690,7 @@ ruby_glob0(const char *path, int flags, ruby_glob_func *func, VALUE arg, rb_enco
root = rb_enc_path_skip_prefix(root, root + strlen(root), enc);
#endif
- if (root && *root == '/') root++;
+ if (*root == '/') root++;
n = root - start;
buf = GLOB_ALLOC_N(char, n + 1);