Attention is currently required from: Jack Rosenthal. Daniel Campello has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52383 )
Change subject: flashrom.c: allow - as filename for stdin/stdout ......................................................................
Patch Set 6:
(6 comments)
File cli_classic.c:
https://review.coreboot.org/c/flashrom/+/52383/comment/0af01bf2_389c669a PS6, Line 152: (argv[optind][0] != '-' || argv[optind][1] == '\0')
!strcmp(argv[optind], "-") would be slightly easier to read, IMO
This is meant to say "and arg[v] does not start with - or if it does it is only '-'" as if it is -something then it is another flag...
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/52383/comment/db1cc690_f572ae48 PS6, Line 1351: strncmp(filename, "-", sizeof("-")))
strncmp here is analagous to "starts with" […]
strncmp is considered safer but in this case I think strcmp is fine...
https://review.coreboot.org/c/flashrom/+/52383/comment/8b91dd90_eb0490f7 PS6, Line 1352: fdopen(STDIN_FILENO, "rb")
stdin
fileno(stdin)
https://review.coreboot.org/c/flashrom/+/52383/comment/af074596_492314a6 PS6, Line 1367: (strncmp(filename, "-", sizeof("-"))))
same comment as above
Done
https://review.coreboot.org/c/flashrom/+/52383/comment/b9542348_17bea525 PS6, Line 1444: trncmp(filename, "-", sizeof("-")))
ditto, I don't think we want all files that start with - to act this way
Ack
https://review.coreboot.org/c/flashrom/+/52383/comment/95bce580_6876143d PS6, Line 1445: fdopen(STDOUT_FILENO, "wb")
stdout
fileno(stdout)