mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
* 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.
This commit is contained in:
parent
982a256ee0
commit
2be225d9e0
@ -1,5 +1,10 @@
|
||||
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().
|
||||
* direntry.c: Likewise.
|
||||
* fish.c: Likewise.
|
||||
|
@ -151,7 +151,6 @@ free_archive (vfs *me, vfs_s_super *super)
|
||||
SUP.sockw = SUP.sockr = -1;
|
||||
}
|
||||
g_free (SUP.host);
|
||||
g_free (SUP.home);
|
||||
g_free (SUP.user);
|
||||
g_free (SUP.cwdir);
|
||||
g_free (SUP.password);
|
||||
@ -274,8 +273,8 @@ open_archive_int (vfs *me, vfs_s_super *super)
|
||||
ERRNOR (E_PROTO, -1);
|
||||
|
||||
print_vfs_message( _("fish: Setting up current directory...") );
|
||||
SUP.home = fish_getcwd (me, super);
|
||||
print_vfs_message( _("fish: Connected, home %s."), SUP.home );
|
||||
SUP.cwdir = fish_getcwd (me, super);
|
||||
print_vfs_message( _("fish: Connected, home %s."), SUP.cwdir );
|
||||
#if 0
|
||||
super->name = g_strconcat ( "/#sh:", SUP.user, "@", SUP.host, "/", NULL );
|
||||
#endif
|
||||
@ -301,7 +300,7 @@ open_archive (vfs *me, vfs_s_super *super, char *archive_name, char *op)
|
||||
SUP.flags = flags;
|
||||
if (!strncmp( op, "rsh:", 4 ))
|
||||
SUP.flags |= FISH_FLAG_RSH;
|
||||
SUP.home = NULL;
|
||||
SUP.cwdir = NULL;
|
||||
if (password)
|
||||
SUP.password = password;
|
||||
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);
|
||||
me->verrno = E_REMOTE;
|
||||
if (decode_reply(buffer+4, 0) == COMPLETE) {
|
||||
g_free (SUP.cwdir);
|
||||
SUP.cwdir = g_strdup (remote_path);
|
||||
print_vfs_message (_("%s: done."), me->name);
|
||||
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);
|
||||
}
|
||||
g_free (SUP.host);
|
||||
g_free (SUP.home);
|
||||
g_free (SUP.user);
|
||||
g_free (SUP.cwdir);
|
||||
g_free (SUP.password);
|
||||
@ -812,9 +811,9 @@ open_archive_int (vfs *me, vfs_s_super *super)
|
||||
}
|
||||
} while (retry_seconds);
|
||||
|
||||
SUP.home = ftpfs_get_current_directory (me, super);
|
||||
if (!SUP.home)
|
||||
SUP.home = g_strdup (PATH_SEP_STR);
|
||||
SUP.cwdir = ftpfs_get_current_directory (me, super);
|
||||
if (!SUP.cwdir)
|
||||
SUP.cwdir = g_strdup (PATH_SEP_STR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -829,7 +828,7 @@ open_archive (vfs *me, vfs_s_super *super, char *archive_name, char *op)
|
||||
SUP.host = host;
|
||||
SUP.user = user;
|
||||
SUP.port = port;
|
||||
SUP.home = NULL;
|
||||
SUP.cwdir = NULL;
|
||||
SUP.proxy = 0;
|
||||
if (ftpfs_check_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;
|
||||
#endif
|
||||
char buffer[BUF_8K];
|
||||
int cd_first;
|
||||
|
||||
int cd_first = ftpfs_first_cd_then_ls || (strchr (remote_path, ' ') != NULL) || (SUP.strict == RFC_STRICT);
|
||||
cd_first = ftpfs_first_cd_then_ls || (strchr (remote_path, ' ') != NULL)
|
||||
|| (SUP.strict == RFC_STRICT);
|
||||
|
||||
again:
|
||||
print_vfs_message(_("ftpfs: Reading FTP directory %s... %s%s"), remote_path,
|
||||
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 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
|
||||
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) {
|
||||
my_errno = EIO;
|
||||
} else {
|
||||
if (SUP.cwdir)
|
||||
g_free(SUP.cwdir);
|
||||
g_free(SUP.cwdir);
|
||||
SUP.cwdir = g_strdup (remote_path);
|
||||
SUP.cwd_defered = 0;
|
||||
}
|
||||
|
@ -89,14 +89,14 @@ typedef struct vfs_s_super {
|
||||
} tar;
|
||||
struct {
|
||||
int sockr, sockw;
|
||||
char *home, *cwdir;
|
||||
char *cwdir;
|
||||
char *host, *user;
|
||||
char *password;
|
||||
int flags;
|
||||
} fish;
|
||||
struct {
|
||||
int sock;
|
||||
char *home, *cwdir;
|
||||
char *cwdir;
|
||||
char *host, *user;
|
||||
char *password;
|
||||
int port;
|
||||
|
Loading…
Reference in New Issue
Block a user