Opened 17 years ago
Closed 17 years ago
#1516 closed bug (fixed)
Various file operations fail when the filename is the empty string.
Reported by: | mjw | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | - General | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
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.
Attachments (2)
Change History (3)
by , 17 years ago
Attachment: | stat_test.c added |
---|
by , 17 years ago
Attachment: | vfs.cpp.patch added |
---|
Possible patch for haiku/src/system/kernel/fs/vfs.cpp