2000-04-15 Timur Bakeyev <mc@bat.ru>
* ftpfs.c (netrc_next): "const char * keywords" is pretty nice. * ftpfs.c (dir_load): At last, found place, that broke handling directories with spaces in name. Problem was in prepending "/" to "." for current directory. Which was, obviously, wrong. Hacked to make just "LIST -la ." instead. * vfs.c: Changed to BUF_* constants in some places.
Этот коммит содержится в:
родитель
592e809966
Коммит
ec83d4571e
@ -1,3 +1,12 @@
|
|||||||
|
2000-04-15 Timur Bakeyev <mc@bat.ru>
|
||||||
|
|
||||||
|
* ftpfs.c (netrc_next): "const char * keywords" is pretty nice.
|
||||||
|
|
||||||
|
* ftpfs.c (dir_load): At last, found place, that broke handling
|
||||||
|
directories with spaces in name. Problem was in prepending "/"
|
||||||
|
to "." for current directory. Which was, obviously, wrong. Hacked
|
||||||
|
to make just "LIST -la ." instead.
|
||||||
|
|
||||||
2000-04-12 Pavel Machek <pavel@artax.karlin.mff.cuni.cz>
|
2000-04-12 Pavel Machek <pavel@artax.karlin.mff.cuni.cz>
|
||||||
|
|
||||||
* extfs/lslR.in: Patch by tnovak@ipex.cz: allow spaces in filenames
|
* extfs/lslR.in: Patch by tnovak@ipex.cz: allow spaces in filenames
|
||||||
|
20
vfs/ftpfs.c
20
vfs/ftpfs.c
@ -222,7 +222,7 @@ my_get_host_and_username (char *path, char **host, char **user, int *port, char
|
|||||||
static int
|
static int
|
||||||
get_reply (vfs *me, int sock, char *string_buf, int string_len)
|
get_reply (vfs *me, int sock, char *string_buf, int string_len)
|
||||||
{
|
{
|
||||||
char answer[1024];
|
char answer[BUF_1K];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@ -357,7 +357,7 @@ login_server (vfs *me, vfs_s_super *super, char *netrcpass)
|
|||||||
char *op;
|
char *op;
|
||||||
char *name; /* login user name */
|
char *name; /* login user name */
|
||||||
int anon = 0;
|
int anon = 0;
|
||||||
char reply_string[255];
|
char reply_string[BUF_MEDIUM];
|
||||||
|
|
||||||
SUP.isbinary = TYPE_UNKNOWN;
|
SUP.isbinary = TYPE_UNKNOWN;
|
||||||
if (netrcpass)
|
if (netrcpass)
|
||||||
@ -833,7 +833,7 @@ dir_uptodate(vfs *me, vfs_s_inode *ino)
|
|||||||
static char *
|
static char *
|
||||||
ftpfs_get_current_directory (vfs *me, vfs_s_super *super)
|
ftpfs_get_current_directory (vfs *me, vfs_s_super *super)
|
||||||
{
|
{
|
||||||
char buf[4096], *bufp, *bufq;
|
char buf[BUF_8K], *bufp, *bufq;
|
||||||
|
|
||||||
if (command (me, super, NONE, "PWD") == COMPLETE &&
|
if (command (me, super, NONE, "PWD") == COMPLETE &&
|
||||||
get_reply(me, SUP.sock, buf, sizeof(buf)) == COMPLETE) {
|
get_reply(me, SUP.sock, buf, sizeof(buf)) == COMPLETE) {
|
||||||
@ -1181,7 +1181,8 @@ dir_load(vfs *me, vfs_s_inode *dir, char *remote_path)
|
|||||||
vfs_s_entry *ent;
|
vfs_s_entry *ent;
|
||||||
vfs_s_super *super = dir->super;
|
vfs_s_super *super = dir->super;
|
||||||
int sock, has_symlinks = 0, num_entries = 0;
|
int sock, has_symlinks = 0, num_entries = 0;
|
||||||
char buffer[8192];
|
char buffer[BUF_8K];
|
||||||
|
|
||||||
int cd_first = (strchr (remote_path, ' ') != NULL) || ftpfs_first_cd_then_ls || (SUP.strict == RFC_STRICT);
|
int cd_first = (strchr (remote_path, ' ') != NULL) || ftpfs_first_cd_then_ls || (SUP.strict == RFC_STRICT);
|
||||||
|
|
||||||
print_vfs_message(_("ftpfs: Reading FTP directory %s... %s%s"), remote_path,
|
print_vfs_message(_("ftpfs: Reading FTP directory %s... %s%s"), remote_path,
|
||||||
@ -1190,8 +1191,9 @@ dir_load(vfs *me, vfs_s_inode *dir, char *remote_path)
|
|||||||
|
|
||||||
if (cd_first) {
|
if (cd_first) {
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
p = translate_path (me, super, remote_path);
|
p = translate_path (me, super, remote_path);
|
||||||
|
|
||||||
if (ftpfs_chdir_internal (me, super, p) != COMPLETE) {
|
if (ftpfs_chdir_internal (me, super, p) != COMPLETE) {
|
||||||
g_free (p);
|
g_free (p);
|
||||||
my_errno = ENOENT;
|
my_errno = ENOENT;
|
||||||
@ -1207,7 +1209,8 @@ dir_load(vfs *me, vfs_s_inode *dir, char *remote_path)
|
|||||||
if (SUP.strict == RFC_STRICT)
|
if (SUP.strict == RFC_STRICT)
|
||||||
sock = open_data_connection (me, super, "LIST", 0, TYPE_ASCII, 0);
|
sock = open_data_connection (me, super, "LIST", 0, TYPE_ASCII, 0);
|
||||||
else if (cd_first)
|
else if (cd_first)
|
||||||
sock = open_data_connection (me, super, "LIST -la", ".", TYPE_ASCII, 0);
|
/* Dirty hack to avoid autoprepending / to . */
|
||||||
|
sock = open_data_connection (me, super, "LIST -la .", 0, TYPE_ASCII, 0);
|
||||||
else {
|
else {
|
||||||
/* Trailing "/." is necessary if remote_path is a symlink
|
/* Trailing "/." is necessary if remote_path is a symlink
|
||||||
but don't generate "//." */
|
but don't generate "//." */
|
||||||
@ -1726,7 +1729,7 @@ static int netrc_next (void)
|
|||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
int i;
|
int i;
|
||||||
static const char const * keywords [] = { "default", "machine",
|
static const char * keywords [] = { "default", "machine",
|
||||||
"login", "password", "passwd", "account", "macdef" };
|
"login", "password", "passwd", "account", "macdef" };
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -1825,11 +1828,12 @@ int lookup_netrc (char *host, char **login, char **pass)
|
|||||||
while ((keyword = netrc_next ()) > 2) {
|
while ((keyword = netrc_next ()) > 2) {
|
||||||
switch (keyword) {
|
switch (keyword) {
|
||||||
case 3:
|
case 3:
|
||||||
if (netrc_next ())
|
if (netrc_next ()) {
|
||||||
if (*login == NULL)
|
if (*login == NULL)
|
||||||
*login = g_strdup (buffer);
|
*login = g_strdup (buffer);
|
||||||
else if (strcmp (*login, buffer))
|
else if (strcmp (*login, buffer))
|
||||||
keyword = 20;
|
keyword = 20;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
case 5:
|
case 5:
|
||||||
|
@ -1790,7 +1790,7 @@ error:
|
|||||||
|
|
||||||
if (++errorcount < 5) {
|
if (++errorcount < 5) {
|
||||||
message_1s (1, _("Could not parse:"), p_copy);
|
message_1s (1, _("Could not parse:"), p_copy);
|
||||||
} else if (errorcount == 5)
|
} else if (errorcount >= 5)
|
||||||
message_1s (1, _("More parsing errors will be ignored."), _("(sorry)"));
|
message_1s (1, _("More parsing errors will be ignored."), _("(sorry)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user