diff --git a/ChangeLog b/ChangeLog index 06f0ca495d..ab5031f616 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -Fri Dec 26 14:48:10 2014 Nobuyoshi Nakada +Fri Dec 26 14:51:34 2014 Nobuyoshi Nakada + + * dir.c (ruby_glob0): no need to check never-NULL pointer. + reported by Denis Denisov . + + * win32/file.c (rb_file_expand_path_internal): ditto. * win32/file.c (code_page_i): handle realloc failure. reported by Denis Denisov . 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); diff --git a/win32/file.c b/win32/file.c index e2b7f93aa4..f51a778fbc 100644 --- a/win32/file.c +++ b/win32/file.c @@ -626,7 +626,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na if (whome) xfree(whome); - if (wfullpath && wfullpath != wfullpath_buffer) + if (wfullpath != wfullpath_buffer) xfree(wfullpath); if (fullpath)