/ is no longer a valid filename in ramfs.

This commit is contained in:
Jonas 'Sortie' Termansen 2011-11-20 22:47:39 +01:00
parent 06c0777193
commit c1849ed7d8
1 changed files with 4 additions and 1 deletions

View File

@ -183,7 +183,10 @@ namespace Sortix
DevBuffer* DevRAMFS::OpenFile(const char* path, int flags, mode_t mode)
{
if ( *path++ != '/' ) { return NULL; }
if ( *path++ != '/' ) { Error::Set(Error::ENOENT); return NULL; }
// Hack to prevent / from being a filename.
if ( path++ == 0 ) { Error::Set(Error::ENOENT); return NULL; }
if ( files )
{