qfile-agent: Handle filenames with trailing slash properly.
This commit is contained in:
parent
cdc5756f79
commit
337d479e39
@ -142,10 +142,13 @@ void parse_entry(char *data, int datasize)
|
||||
notify_progress(0, 1);
|
||||
send_vmname(vmname);
|
||||
while ((entry = get_item(data, ¤t, datasize))) {
|
||||
do {
|
||||
sep = rindex(entry, '/');
|
||||
if (!sep)
|
||||
gui_fatal("Internal error: nonabsolute filenames not allowed");
|
||||
gui_fatal
|
||||
("Internal error: nonabsolute filenames not allowed");
|
||||
*sep = 0;
|
||||
} while (sep[1] == 0);
|
||||
if (entry[0] == 0)
|
||||
chdir("/");
|
||||
else if (chdir(entry))
|
||||
|
Loading…
Reference in New Issue
Block a user