* direntry.c (vfs_s_find_entry_tree): Eliminate buffer of fixed

size.  Don't prepare path for vfs_s_resolve_symlink().
(vfs_s_resolve_symlink): Remove unused argument "path".
This commit is contained in:
Pavel Roskin 2003-10-27 02:54:59 +00:00
parent cc09ee51f1
commit ad670bade6
2 changed files with 6 additions and 12 deletions

View File

@ -1,5 +1,9 @@
2003-10-26 Pavel Roskin <proski@gnu.org>
* direntry.c (vfs_s_find_entry_tree): Eliminate buffer of fixed
size. Don't prepare path for vfs_s_resolve_symlink().
(vfs_s_resolve_symlink): Remove unused argument "path".
* direntry.c (vfs_s_add_dots): Remove. Fix all callers.
(vfs_s_free_inode): Remove support for "." and ".." entries.
* ftpfs.c (dir_load): Likewise.

View File

@ -194,7 +194,7 @@ vfs_s_automake (struct vfs_class *me, struct vfs_s_inode *dir, char *path, int f
/* If the entry is a symlink, find the entry for its target */
static struct vfs_s_entry *
vfs_s_resolve_symlink (struct vfs_class *me, struct vfs_s_entry *entry,
char *path, int follow)
int follow)
{
char *linkname;
char *fullname = NULL;
@ -238,16 +238,10 @@ vfs_s_find_entry_tree (struct vfs_class *me, struct vfs_s_inode *root,
{
unsigned int pseg;
struct vfs_s_entry *ent = NULL;
char p[MC_MAXPATHLEN] = "";
if (strlen(path) >= MC_MAXPATHLEN)
return NULL;
canonicalize_pathname (path);
while (root) {
int t;
while (*path == PATH_SEP) /* Strip leading '/' */
path++;
@ -256,10 +250,6 @@ vfs_s_find_entry_tree (struct vfs_class *me, struct vfs_s_inode *root,
for (pseg = 0; path[pseg] && path[pseg] != PATH_SEP; pseg++);
strcat (p, PATH_SEP_STR);
strncpy (p + (t = strlen (p)), path, pseg);
p[t + pseg] = '\0';
for (ent = root->subdir; ent != NULL; ent = ent->next)
if (strlen (ent->name) == pseg
&& (!strncmp (ent->name, path, pseg)))
@ -274,7 +264,7 @@ vfs_s_find_entry_tree (struct vfs_class *me, struct vfs_s_inode *root,
/* here we must follow leading directories always;
only the actual file is optional */
ent =
vfs_s_resolve_symlink (me, ent, p,
vfs_s_resolve_symlink (me, ent,
strchr (path,
PATH_SEP) ? LINK_FOLLOW :
follow);