I think this code is consistent with other filesystems code. We do not 
check if the name parameter is null, we only check that the name string is 
not empty. I think the null check is done in higher layers but doing extra 
check here might not hurt.

On Monday, March 23, 2020 at 1:10:13 PM UTC-4, Fotis Xenakis wrote:
>
> I was reading through the filesystem code and noticed this check which 
> seemed wrong (given the type of name). If it was right, please ignore this 
> patch.
>
> Τη Δευτέρα, 23 Μαρτίου 2020 - 7:01:48 μ.μ. UTC+2, ο χρήστης Fotis Xenakis 
> έγραψε:
>>
>> Signed-off-by: Fotis Xenakis <[email protected] <javascript:>> 
>> --- 
>>  fs/pseudofs/pseudofs.cc | 2 +- 
>>  1 file changed, 1 insertion(+), 1 deletion(-) 
>>
>> diff --git a/fs/pseudofs/pseudofs.cc b/fs/pseudofs/pseudofs.cc 
>> index 4d37dc66..b721d950 100644 
>> --- a/fs/pseudofs/pseudofs.cc 
>> +++ b/fs/pseudofs/pseudofs.cc 
>> @@ -97,7 +97,7 @@ int lookup(vnode *dvp, char *name, vnode **vpp) { 
>>   
>>      *vpp = nullptr; 
>>   
>> -    if (!*name || !parent) { 
>> +    if (!name || !parent) { 
>>          return ENOENT; 
>>      } 
>>      auto node = parent->lookup(name); 
>> -- 
>> 2.25.2 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/1ecded4e-0230-4531-9bfa-80762f686b8a%40googlegroups.com.

Reply via email to