projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e097fdf
)
Disallow the empty string as a file name.
author
Ben Pfaff
<blp@cs.stanford.edu>
Mon, 25 Oct 2004 22:56:10 +0000
(22:56 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Mon, 25 Oct 2004 22:56:10 +0000
(22:56 +0000)
src/filesys/directory.c
patch
|
blob
|
history
diff --git
a/src/filesys/directory.c
b/src/filesys/directory.c
index ec6ecd98715d30ba99acff1449e15b0d440c92ea..b08e7eeba3f65947e0ffe51b097e0d7aa166d24c 100644
(file)
--- a/
src/filesys/directory.c
+++ b/
src/filesys/directory.c
@@
-140,7
+140,7
@@
dir_add (struct dir *d, const char *name, disk_sector_t inode_sector)
ASSERT (name != NULL);
ASSERT (lookup (d, name) == NULL);
- if (strlen (name) > NAME_MAX)
+ if (
*name == '\0' ||
strlen (name) > NAME_MAX)
return false;
for (i = 0; i < d->entry_cnt; i++)