Various file operations fail when the filename is the empty string.
|Reported by:||mjw||Owned by:||axeld|
|Has a Patch:||no||Platform:||All|
Various file operations fail when the filename is the empty string. For example, stat( "", &statbuf ) should return -1 with errno set to ENOENT, however on Haiku it returns 0. I assume statbuf will be filled with random stuff.
Other things I have tried, access( "", F_OK ) returns 0, whereas I would expect it to return -1 with errno set to ENOENT.
Things such as stat( NULL, &statbuf ) work correctly.
fopen( "", "r" ) returns a valid open FILE *, but the file can not be read from.
I assume there are other operations (like open()) that exhibit the same symptoms. I traced the code down to vnode_path_to_vnode in haiku/src/system/kernel/fs/vfs.cpp, but decided that a fix should come from somebody who knows what they are doing.
I have a noddy test case to attach to the bug.