Fill the ring-buffer with the fallback value
Fill with the pointer to the root position, instead of zero and comparing later. Also suppress a false warning by Visual C++. ``` file.c(4759): warning C4090: 'function': different 'const' qualifiers ```
This commit is contained in:
parent
79af8ce6d7
commit
43e0677c6d
Notes:
git
2021-04-02 14:17:54 +09:00
3
file.c
3
file.c
@ -4756,7 +4756,7 @@ rb_file_dirname_n(VALUE fname, int n)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
seps = ALLOCV_N(const char *, sepsv, n);
|
seps = ALLOCV_N(const char *, sepsv, n);
|
||||||
MEMZERO(seps, const char *, n);
|
for (i = 0; i < n; ++i) seps[i] = root;
|
||||||
i = 0;
|
i = 0;
|
||||||
for (p = root; p < end; ) {
|
for (p = root; p < end; ) {
|
||||||
if (isdirsep(*p)) {
|
if (isdirsep(*p)) {
|
||||||
@ -4772,7 +4772,6 @@ rb_file_dirname_n(VALUE fname, int n)
|
|||||||
}
|
}
|
||||||
p = seps[i];
|
p = seps[i];
|
||||||
ALLOCV_END(sepsv);
|
ALLOCV_END(sepsv);
|
||||||
if (!p) p = root;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user