projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b2705e1
)
tftp: when we infer local name from remote (-r [/]path/path/file),
author
Denis Vlasenko
<vda.linux@googlemail.com>
Wed, 25 Mar 2009 03:55:53 +0000
(
03:55
-0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Wed, 25 Mar 2009 03:55:53 +0000
(
03:55
-0000)
strip path. This mimics wget and is generally more intuitive.
networking/tftp.c
patch
|
blob
|
history
diff --git
a/networking/tftp.c
b/networking/tftp.c
index fa0851615b6a7658ec2056c58534f6ca6d563207..9c78b6e14451f2da34449714585b1bc20ea3f3b2 100644
(file)
--- a/
networking/tftp.c
+++ b/
networking/tftp.c
@@
-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();