* cfs_opendir in Coffee now accepts any name.

* refer to the documentation of each whence parameter. Old documentation didn't   consider negative movements either.
This commit is contained in:
nvt-se 2009-02-28 13:40:25 +00:00
parent bc3d9d2e3c
commit 63b89a67fe
2 changed files with 9 additions and 11 deletions

View File

@ -1132,14 +1132,13 @@ cfs_write(int fd, const void *buf, unsigned size)
int
cfs_opendir(struct cfs_dir *dir, const char *name)
{
/* We have only a root directory. */
if((name[0] == '/' || name[0] == '.') && name[1] == '\0') {
/*
* Coffee is only guaranteed to support "/" and ".", but it does not
* currently enforce this.
*/
*(coffee_page_t *)dir->dummy_space = 0;
return 0;
}
return -1;
}
/*---------------------------------------------------------------------------*/
int
cfs_readdir(struct cfs_dir *dir, struct cfs_dirent *record)

View File

@ -54,7 +54,7 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: cfs.h,v 1.15 2009/02/28 11:39:02 oliverschmidt Exp $
* $Id: cfs.h,v 1.16 2009/02/28 13:40:25 nvt-se Exp $
*/
#ifndef __CFS_H__
#define __CFS_H__
@ -221,10 +221,9 @@ CCIF int cfs_write(int fd, const void *buf, unsigned int len);
* determined by the combination of the offset parameter
* and the whence parameter.
*
* If whence is CFS_SEEK_SET, the current position is set
* to the offset value. CFS_SEEK_CUR moves the position
* forward the number of bytes specified by offset. CFS_SEEK
* end moves the position offset bytes past the end of the file.
* \sa CFS_SEEK_CUR
* \sa CFS_SEEK_END
* \sa CFS_SEEK_SET
*/
#ifndef cfs_seek
CCIF cfs_offset_t cfs_seek(int fd, cfs_offset_t offset, int whence);