* 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".
Этот коммит содержится в:
родитель
cc09ee51f1
Коммит
ad670bade6
@ -1,5 +1,9 @@
|
|||||||
2003-10-26 Pavel Roskin <proski@gnu.org>
|
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.
|
* direntry.c (vfs_s_add_dots): Remove. Fix all callers.
|
||||||
(vfs_s_free_inode): Remove support for "." and ".." entries.
|
(vfs_s_free_inode): Remove support for "." and ".." entries.
|
||||||
* ftpfs.c (dir_load): Likewise.
|
* ftpfs.c (dir_load): Likewise.
|
||||||
|
@ -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 */
|
/* If the entry is a symlink, find the entry for its target */
|
||||||
static struct vfs_s_entry *
|
static struct vfs_s_entry *
|
||||||
vfs_s_resolve_symlink (struct vfs_class *me, struct vfs_s_entry *entry,
|
vfs_s_resolve_symlink (struct vfs_class *me, struct vfs_s_entry *entry,
|
||||||
char *path, int follow)
|
int follow)
|
||||||
{
|
{
|
||||||
char *linkname;
|
char *linkname;
|
||||||
char *fullname = NULL;
|
char *fullname = NULL;
|
||||||
@ -238,16 +238,10 @@ vfs_s_find_entry_tree (struct vfs_class *me, struct vfs_s_inode *root,
|
|||||||
{
|
{
|
||||||
unsigned int pseg;
|
unsigned int pseg;
|
||||||
struct vfs_s_entry *ent = NULL;
|
struct vfs_s_entry *ent = NULL;
|
||||||
char p[MC_MAXPATHLEN] = "";
|
|
||||||
|
|
||||||
if (strlen(path) >= MC_MAXPATHLEN)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
canonicalize_pathname (path);
|
canonicalize_pathname (path);
|
||||||
|
|
||||||
while (root) {
|
while (root) {
|
||||||
int t;
|
|
||||||
|
|
||||||
while (*path == PATH_SEP) /* Strip leading '/' */
|
while (*path == PATH_SEP) /* Strip leading '/' */
|
||||||
path++;
|
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++);
|
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)
|
for (ent = root->subdir; ent != NULL; ent = ent->next)
|
||||||
if (strlen (ent->name) == pseg
|
if (strlen (ent->name) == pseg
|
||||||
&& (!strncmp (ent->name, path, 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;
|
/* here we must follow leading directories always;
|
||||||
only the actual file is optional */
|
only the actual file is optional */
|
||||||
ent =
|
ent =
|
||||||
vfs_s_resolve_symlink (me, ent, p,
|
vfs_s_resolve_symlink (me, ent,
|
||||||
strchr (path,
|
strchr (path,
|
||||||
PATH_SEP) ? LINK_FOLLOW :
|
PATH_SEP) ? LINK_FOLLOW :
|
||||||
follow);
|
follow);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user