mirror of
https://github.com/wiiu-env/ftpiiu_plugin.git
synced 2024-11-17 18:29:19 +01:00
fix build_path
This commit is contained in:
parent
c808a1cd27
commit
b4113806e8
12
source/ftp.c
12
source/ftp.c
@ -1334,8 +1334,6 @@ static void
|
|||||||
build_path(ftp_session_t *session,
|
build_path(ftp_session_t *session,
|
||||||
const char *args)
|
const char *args)
|
||||||
{
|
{
|
||||||
char *p;
|
|
||||||
|
|
||||||
memset(session->buffer, 0, sizeof(session->buffer));
|
memset(session->buffer, 0, sizeof(session->buffer));
|
||||||
|
|
||||||
if(args[0] == '/')
|
if(args[0] == '/')
|
||||||
@ -1344,14 +1342,12 @@ build_path(ftp_session_t *session,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p = session->cwd + strlen(session->cwd);
|
if(strcmp(session->cwd, "/") == 0)
|
||||||
while(*--p == '/')
|
snprintf(session->buffer, sizeof(session->buffer), "/%s",
|
||||||
*p = 0;
|
args);
|
||||||
|
else
|
||||||
snprintf(session->buffer, sizeof(session->buffer), "%s/%s",
|
snprintf(session->buffer, sizeof(session->buffer), "%s/%s",
|
||||||
session->cwd, args);
|
session->cwd, args);
|
||||||
p = session->buffer + strlen(session->buffer);
|
|
||||||
while(*--p == '/')
|
|
||||||
*p = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user