Some changes related to "-f -"
This commit is contained in:
parent
78ae82e5a3
commit
41cc1b6885
2 changed files with 9 additions and 3 deletions
6
nmrp.c
6
nmrp.c
|
@ -431,7 +431,11 @@ int nmrp_do(struct nmrpd_args *args)
|
|||
}
|
||||
|
||||
if (!err && args->filename) {
|
||||
printf("Uploading %s ... ", args->filename);
|
||||
if (!strcmp(args->filename, "-")) {
|
||||
printf("Uploading from stdin ... ");
|
||||
} else {
|
||||
printf("Uploading %s ... ", args->filename);
|
||||
}
|
||||
fflush(stdout);
|
||||
err = tftp_put(args);
|
||||
}
|
||||
|
|
6
tftp.c
6
tftp.c
|
@ -87,8 +87,10 @@ static void pkt_mkwrq(char *pkt, const char *filename)
|
|||
|
||||
filename = leafname(filename);
|
||||
if (!is_netascii(filename) || strlen(filename) > 500) {
|
||||
fprintf(stderr, "Overlong/illegal filename; using 'firmware.bin'.\n");
|
||||
filename = "firmware.bin";
|
||||
fprintf(stderr, "Overlong/illegal filename; using 'firmware'.\n");
|
||||
filename = "firmware";
|
||||
} else if (!strcmp(filename, "-")) {
|
||||
filename = "firmware";
|
||||
}
|
||||
|
||||
pkt_mknum(pkt, WRQ);
|
||||
|
|
Loading…
Add table
Reference in a new issue