Fix warning in rb_file_s_basename

file.c:5053:16: warning: `f` may be used uninitialized [-Wmaybe-uninitialized]
    5053 |             if (!(f = rmext(p, f, n, fp, RSTRING_LEN(fext), enc))) {
         |                ^
This commit is contained in:
Peter Zhu 2026-01-24 20:50:21 -05:00
parent a00cc983dd
commit 8f9aade9be
Notes: git 2026-01-25 02:31:37 +00:00

2
file.c
View File

@ -5019,7 +5019,7 @@ rb_file_s_basename(int argc, VALUE *argv, VALUE _)
{
VALUE fname, fext;
const char *name, *p;
long f, n;
long f = 0, n;
rb_encoding *enc;
fext = Qnil;