From cf8ae36637b6f15db3dbc884156cb6273d85c3a5 Mon Sep 17 00:00:00 2001 From: Slava Zanko Date: Tue, 1 Dec 2009 16:17:32 +0200 Subject: [PATCH] Ticket #1605: Incorrect parsing FTP-string ENTRY "example.net" URL "/#ftp:examplenet:5wDJP1B/y@example.net" When I try connect to it I saw: "ftpfs: making connection to examplenet" off course this is failed by timeout. Fix issue: Now search for '@' sign. If present - search for slash at found position If not present - search at start of string. Also fixed parce '@' sign into password area of URI. Signed-off-by: Slava Zanko --- vfs/vfs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/vfs/vfs.c b/vfs/vfs.c index 830f65e63..57ff3d7c3 100644 --- a/vfs/vfs.c +++ b/vfs/vfs.c @@ -279,7 +279,7 @@ struct vfs_class * vfs_split (char *path, char **inpath, char **op) { char *semi; - char *slash; + char *slash, *at_chr; struct vfs_class *ret; if (!path) @@ -289,7 +289,12 @@ vfs_split (char *path, char **inpath, char **op) if (!semi || !path_magic(path)) return NULL; - slash = strchr (semi, PATH_SEP); + at_chr = strrchr (semi, '@'); + if (at_chr) + slash = strchr (at_chr, PATH_SEP); + else + slash = strchr (semi, PATH_SEP); + *semi = 0; if (op) -- 2.11.4.GIT