* vfs.c (_vfs_get_class): Reverted my last patch because
Leonard reported it to make mc crash.
Этот коммит содержится в:
родитель
11c6534e70
Коммит
7b6f1db773
@ -1,3 +1,8 @@
|
||||
2004-09-26 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* vfs.c (_vfs_get_class): Reverted my last patch because
|
||||
Leonard reported it to make mc crash.
|
||||
|
||||
2004-09-25 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* ftpfs.c (ftpfs_find_machine): Added const qualifier.
|
||||
|
20
vfs/vfs.c
20
vfs/vfs.c
@ -150,7 +150,7 @@ vfs_register_class (struct vfs_class *vfs)
|
||||
|
||||
/* Return VFS class for the given prefix */
|
||||
static struct vfs_class *
|
||||
vfs_prefix_to_class (const char *prefix, size_t prefix_len)
|
||||
vfs_prefix_to_class (char *prefix)
|
||||
{
|
||||
struct vfs_class *vfs;
|
||||
|
||||
@ -161,7 +161,7 @@ vfs_prefix_to_class (const char *prefix, size_t prefix_len)
|
||||
return vfs;
|
||||
}
|
||||
if (vfs->prefix
|
||||
&& !strncmp (prefix, vfs->prefix, prefix_len))
|
||||
&& !strncmp (prefix, vfs->prefix, strlen (vfs->prefix)))
|
||||
return vfs;
|
||||
}
|
||||
return NULL;
|
||||
@ -243,7 +243,7 @@ vfs_split (char *path, char **inpath, char **op)
|
||||
if (slash)
|
||||
*slash = 0;
|
||||
|
||||
if ((ret = vfs_prefix_to_class (semi+1, strlen (semi+1)))){
|
||||
if ((ret = vfs_prefix_to_class (semi+1))){
|
||||
if (op)
|
||||
*op = semi + 1;
|
||||
if (inpath)
|
||||
@ -262,8 +262,8 @@ vfs_split (char *path, char **inpath, char **op)
|
||||
static struct vfs_class *
|
||||
_vfs_get_class (const char *path)
|
||||
{
|
||||
const char *semi;
|
||||
const char *slash;
|
||||
char *semi;
|
||||
char *slash;
|
||||
struct vfs_class *ret;
|
||||
|
||||
g_return_val_if_fail(path, NULL);
|
||||
@ -273,14 +273,18 @@ _vfs_get_class (const char *path)
|
||||
return NULL;
|
||||
|
||||
slash = strchr (semi, PATH_SEP);
|
||||
if (slash == NULL)
|
||||
slash = semi + strlen (semi);
|
||||
*semi = 0;
|
||||
if (slash)
|
||||
*slash = 0;
|
||||
|
||||
ret = vfs_prefix_to_class (semi+1, slash - (semi + 1));
|
||||
ret = vfs_prefix_to_class (semi+1);
|
||||
|
||||
if (slash)
|
||||
*slash = PATH_SEP;
|
||||
if (!ret)
|
||||
ret = _vfs_get_class (path);
|
||||
|
||||
*semi = '#';
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user