Re: [Linux-NTFS-Dev] ntfsmount.c cleanup
Development moved to https://sourceforge.net/projects/ntfs-3g/
Brought to you by:
antona,
cha0smaster
From: Szakacsits S. <sz...@si...> - 2006-09-26 21:51:08
|
Hello Hil, On Tue, 19 Sep 2006, Hil wrote: > I changed 2 lines for getting a path's basename from using strrchr(...) > to basename(...) > > strrchr(path, '/') could cause problems if the given path does not have > '/' but basename(...) will just return the same string. I suspect that > if the path in the function is something like 'something.log', not > 'some/thing.log', the function could misbehave. The FUSE high-level API is path based and the existence of at least one '/' is guaranteed in the changed places (and no trailing '/'). Taken this into account, the only difference I'm seeing is the case of "/" ("/" vs NULL). In the given cases, FUSE itself already reports EINVAL but provided it doesn't do then the current code would still handle it correctly. But unfortunately not with the cleanup patch, so the current code is safer. Thanks, Szaka |