mirror of
https://github.com/sheumann/hush.git
synced 2024-12-27 01:32:08 +00:00
tftp: when we infer local name from remote (-r [/]path/path/file),
strip path. This mimics wget and is generally more intuitive.
This commit is contained in:
parent
b2705e1652
commit
f9beb61a81
@ -589,10 +589,15 @@ int tftp_main(int argc UNUSED_PARAM, char **argv)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!local_file)
|
||||
local_file = remote_file;
|
||||
if (!remote_file)
|
||||
if (remote_file) {
|
||||
if (!local_file) {
|
||||
const char *slash = strrchr(remote_file, '/');
|
||||
local_file = slash ? slash + 1 : remote_file;
|
||||
}
|
||||
} else {
|
||||
remote_file = local_file;
|
||||
}
|
||||
|
||||
/* Error if filename or host is not known */
|
||||
if (!remote_file || !argv[0])
|
||||
bb_show_usage();
|
||||
|
Loading…
Reference in New Issue
Block a user