Skip to content

Commit 859f3d1

Browse files
committed
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
1 parent ea9ff28 commit 859f3d1

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

ChangeLog

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
Fri Dec 26 14:48:10 2014 Nobuyoshi Nakada <[email protected]>
1+
Fri Dec 26 14:51:34 2014 Nobuyoshi Nakada <[email protected]>
2+
3+
* dir.c (ruby_glob0): no need to check never-NULL pointer.
4+
reported by Denis Denisov <denji0k AT gmail.com>.
5+
6+
* win32/file.c (rb_file_expand_path_internal): ditto.
27

38
* win32/file.c (code_page_i): handle realloc failure.
49
reported by Denis Denisov <denji0k AT gmail.com>.

dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,7 @@ ruby_glob0(const char *path, int flags, ruby_glob_func *func, VALUE arg, rb_enco
16901690
root = rb_enc_path_skip_prefix(root, root + strlen(root), enc);
16911691
#endif
16921692

1693-
if (root && *root == '/') root++;
1693+
if (*root == '/') root++;
16941694

16951695
n = root - start;
16961696
buf = GLOB_ALLOC_N(char, n + 1);

win32/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na
626626
if (whome)
627627
xfree(whome);
628628

629-
if (wfullpath && wfullpath != wfullpath_buffer)
629+
if (wfullpath != wfullpath_buffer)
630630
xfree(wfullpath);
631631

632632
if (fullpath)

0 commit comments

Comments
 (0)