mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-09-27 14:35:27 +00:00
Implement -U filename as a shorthand for -U flash:w:filename:a.
This has once been suggested by Brian Dean. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@655 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
17
main.c
17
main.c
@@ -338,9 +338,20 @@ UPDATE * parse_op(char * s)
|
||||
buf[i++] = *p++;
|
||||
|
||||
if (*p != ':') {
|
||||
fprintf(stderr, "%s: invalid update specification\n", progname);
|
||||
free(upd);
|
||||
return NULL;
|
||||
upd->memtype = (char *)malloc(strlen("flash")+1);
|
||||
if (upd->memtype == NULL) {
|
||||
outofmem:
|
||||
fprintf(stderr, "%s: out of memory\n", progname);
|
||||
exit(1);
|
||||
}
|
||||
strcpy(upd->memtype, "flash");
|
||||
upd->op = DEVICE_WRITE;
|
||||
upd->filename = (char *)malloc(strlen(buf) + 1);
|
||||
if (upd->filename == NULL)
|
||||
goto outofmem;
|
||||
strcpy(upd->filename, buf);
|
||||
upd->format = FMT_AUTO;
|
||||
return upd;
|
||||
}
|
||||
|
||||
buf[i] = 0;
|
||||
|
Reference in New Issue
Block a user