* ftpfs.c: Don't use SUP.home, use SUP.cwdir.
* fish.c: Likewise. (dir_load): Update SUP.cwdir. * xdirentry.h: Remove "home" field for fish and ftpfs.
Этот коммит содержится в:
родитель
982a256ee0
Коммит
2be225d9e0
@ -1,5 +1,10 @@
|
|||||||
2002-07-19 Pavel Roskin <proski@gnu.org>
|
2002-07-19 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* ftpfs.c: Don't use SUP.home, use SUP.cwdir.
|
||||||
|
* fish.c: Likewise.
|
||||||
|
(dir_load): Update SUP.cwdir.
|
||||||
|
* xdirentry.h: Remove "home" field for fish and ftpfs.
|
||||||
|
|
||||||
* xdirentry.h: Get rid of ifree(), it's equivalent to g_free().
|
* xdirentry.h: Get rid of ifree(), it's equivalent to g_free().
|
||||||
* direntry.c: Likewise.
|
* direntry.c: Likewise.
|
||||||
* fish.c: Likewise.
|
* fish.c: Likewise.
|
||||||
|
@ -151,7 +151,6 @@ free_archive (vfs *me, vfs_s_super *super)
|
|||||||
SUP.sockw = SUP.sockr = -1;
|
SUP.sockw = SUP.sockr = -1;
|
||||||
}
|
}
|
||||||
g_free (SUP.host);
|
g_free (SUP.host);
|
||||||
g_free (SUP.home);
|
|
||||||
g_free (SUP.user);
|
g_free (SUP.user);
|
||||||
g_free (SUP.cwdir);
|
g_free (SUP.cwdir);
|
||||||
g_free (SUP.password);
|
g_free (SUP.password);
|
||||||
@ -274,8 +273,8 @@ open_archive_int (vfs *me, vfs_s_super *super)
|
|||||||
ERRNOR (E_PROTO, -1);
|
ERRNOR (E_PROTO, -1);
|
||||||
|
|
||||||
print_vfs_message( _("fish: Setting up current directory...") );
|
print_vfs_message( _("fish: Setting up current directory...") );
|
||||||
SUP.home = fish_getcwd (me, super);
|
SUP.cwdir = fish_getcwd (me, super);
|
||||||
print_vfs_message( _("fish: Connected, home %s."), SUP.home );
|
print_vfs_message( _("fish: Connected, home %s."), SUP.cwdir );
|
||||||
#if 0
|
#if 0
|
||||||
super->name = g_strconcat ( "/#sh:", SUP.user, "@", SUP.host, "/", NULL );
|
super->name = g_strconcat ( "/#sh:", SUP.user, "@", SUP.host, "/", NULL );
|
||||||
#endif
|
#endif
|
||||||
@ -301,7 +300,7 @@ open_archive (vfs *me, vfs_s_super *super, char *archive_name, char *op)
|
|||||||
SUP.flags = flags;
|
SUP.flags = flags;
|
||||||
if (!strncmp( op, "rsh:", 4 ))
|
if (!strncmp( op, "rsh:", 4 ))
|
||||||
SUP.flags |= FISH_FLAG_RSH;
|
SUP.flags |= FISH_FLAG_RSH;
|
||||||
SUP.home = NULL;
|
SUP.cwdir = NULL;
|
||||||
if (password)
|
if (password)
|
||||||
SUP.password = password;
|
SUP.password = password;
|
||||||
return open_archive_int (me, super);
|
return open_archive_int (me, super);
|
||||||
@ -465,6 +464,8 @@ dir_load(vfs *me, vfs_s_inode *dir, char *remote_path)
|
|||||||
vfs_s_free_entry (me, ent);
|
vfs_s_free_entry (me, ent);
|
||||||
me->verrno = E_REMOTE;
|
me->verrno = E_REMOTE;
|
||||||
if (decode_reply(buffer+4, 0) == COMPLETE) {
|
if (decode_reply(buffer+4, 0) == COMPLETE) {
|
||||||
|
g_free (SUP.cwdir);
|
||||||
|
SUP.cwdir = g_strdup (remote_path);
|
||||||
print_vfs_message (_("%s: done."), me->name);
|
print_vfs_message (_("%s: done."), me->name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
19
vfs/ftpfs.c
19
vfs/ftpfs.c
@ -383,7 +383,6 @@ free_archive (vfs *me, vfs_s_super *super)
|
|||||||
close(SUP.sock);
|
close(SUP.sock);
|
||||||
}
|
}
|
||||||
g_free (SUP.host);
|
g_free (SUP.host);
|
||||||
g_free (SUP.home);
|
|
||||||
g_free (SUP.user);
|
g_free (SUP.user);
|
||||||
g_free (SUP.cwdir);
|
g_free (SUP.cwdir);
|
||||||
g_free (SUP.password);
|
g_free (SUP.password);
|
||||||
@ -812,9 +811,9 @@ open_archive_int (vfs *me, vfs_s_super *super)
|
|||||||
}
|
}
|
||||||
} while (retry_seconds);
|
} while (retry_seconds);
|
||||||
|
|
||||||
SUP.home = ftpfs_get_current_directory (me, super);
|
SUP.cwdir = ftpfs_get_current_directory (me, super);
|
||||||
if (!SUP.home)
|
if (!SUP.cwdir)
|
||||||
SUP.home = g_strdup (PATH_SEP_STR);
|
SUP.cwdir = g_strdup (PATH_SEP_STR);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -829,7 +828,7 @@ open_archive (vfs *me, vfs_s_super *super, char *archive_name, char *op)
|
|||||||
SUP.host = host;
|
SUP.host = host;
|
||||||
SUP.user = user;
|
SUP.user = user;
|
||||||
SUP.port = port;
|
SUP.port = port;
|
||||||
SUP.home = NULL;
|
SUP.cwdir = NULL;
|
||||||
SUP.proxy = 0;
|
SUP.proxy = 0;
|
||||||
if (ftpfs_check_proxy (host))
|
if (ftpfs_check_proxy (host))
|
||||||
SUP.proxy = ftpfs_proxy_host;
|
SUP.proxy = ftpfs_proxy_host;
|
||||||
@ -1238,8 +1237,11 @@ dir_load(vfs *me, vfs_s_inode *dir, char *remote_path)
|
|||||||
int has_symlinks = 0;
|
int has_symlinks = 0;
|
||||||
#endif
|
#endif
|
||||||
char buffer[BUF_8K];
|
char buffer[BUF_8K];
|
||||||
|
int cd_first;
|
||||||
|
|
||||||
|
cd_first = ftpfs_first_cd_then_ls || (strchr (remote_path, ' ') != NULL)
|
||||||
|
|| (SUP.strict == RFC_STRICT);
|
||||||
|
|
||||||
int cd_first = ftpfs_first_cd_then_ls || (strchr (remote_path, ' ') != NULL) || (SUP.strict == RFC_STRICT);
|
|
||||||
again:
|
again:
|
||||||
print_vfs_message(_("ftpfs: Reading FTP directory %s... %s%s"), remote_path,
|
print_vfs_message(_("ftpfs: Reading FTP directory %s... %s%s"), remote_path,
|
||||||
SUP.strict == RFC_STRICT ? _("(strict rfc959)") : "",
|
SUP.strict == RFC_STRICT ? _("(strict rfc959)") : "",
|
||||||
@ -1605,7 +1607,7 @@ static int ftpfs_unlink (vfs *me, char *path)
|
|||||||
return send_ftp_command(me, path, "DELE /%s", OPT_FLUSH);
|
return send_ftp_command(me, path, "DELE /%s", OPT_FLUSH);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return true if path is the same directoy as the one we are on now */
|
/* Return 1 if path is the same directory as the one we are in now */
|
||||||
static int
|
static int
|
||||||
is_same_dir (vfs *me, vfs_s_super *super, const char *path)
|
is_same_dir (vfs *me, vfs_s_super *super, const char *path)
|
||||||
{
|
{
|
||||||
@ -1632,8 +1634,7 @@ ftpfs_chdir_internal (vfs *me, vfs_s_super *super, char *remote_path)
|
|||||||
if (r != COMPLETE) {
|
if (r != COMPLETE) {
|
||||||
my_errno = EIO;
|
my_errno = EIO;
|
||||||
} else {
|
} else {
|
||||||
if (SUP.cwdir)
|
g_free(SUP.cwdir);
|
||||||
g_free(SUP.cwdir);
|
|
||||||
SUP.cwdir = g_strdup (remote_path);
|
SUP.cwdir = g_strdup (remote_path);
|
||||||
SUP.cwd_defered = 0;
|
SUP.cwd_defered = 0;
|
||||||
}
|
}
|
||||||
|
@ -89,14 +89,14 @@ typedef struct vfs_s_super {
|
|||||||
} tar;
|
} tar;
|
||||||
struct {
|
struct {
|
||||||
int sockr, sockw;
|
int sockr, sockw;
|
||||||
char *home, *cwdir;
|
char *cwdir;
|
||||||
char *host, *user;
|
char *host, *user;
|
||||||
char *password;
|
char *password;
|
||||||
int flags;
|
int flags;
|
||||||
} fish;
|
} fish;
|
||||||
struct {
|
struct {
|
||||||
int sock;
|
int sock;
|
||||||
char *home, *cwdir;
|
char *cwdir;
|
||||||
char *host, *user;
|
char *host, *user;
|
||||||
char *password;
|
char *password;
|
||||||
int port;
|
int port;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user