tftp: allow -lc and -cl options

function                                             old     new   delta
tftp_main                                            394     396      +2

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2019-06-09 12:41:17 +02:00
parent 94ce1c0ebb
commit 894f0a3235

View File

@ -776,7 +776,15 @@ int tftp_main(int argc UNUSED_PARAM, char **argv)
*/ */
unsigned i = 1; unsigned i = 1;
while (argv[i]) { while (argv[i]) {
if (strcmp(argv[i], "-c") == 0) { /* Accept not only -c, but also
* -lc, -cl, -llcclcllcc etc:
* "-l Literal mode (do not recognize HOST:FILE)"
* since we do not recognize that syntax anyway,
* might as well allow the option.
*/
if (argv[i][0] == '-' && strchr(argv[i], 'c')
/*&& argv[i][1+strspn(argv[i]+1, "lc")] == '\0'*/
) {
if (!argv[++i]) if (!argv[++i])
break; break;
if (strcmp(argv[i], "get") == 0) { if (strcmp(argv[i], "get") == 0) {