@frostschutz:
Turns out doing it with NTX's HWConfig thingy is less gnarly than I thought (plus, @pazos did most of the heavy lifting for the Cervantes port anyway
), so that's coming along nicely (as a fallback, because the distinction between some specific devices is harder to make... and of course, among those is one that's already crappy to handle right between the two versions, namely, the H2OČ -_-").
As for your line issue, yep, you have a couple of choices: the -L flag usurps the process exit code to set it to the number of lines printed, while the -l flag does the same the old-fashioned way, by outputting it to stdout (which means it enforces the extra-silent mode of operation).
Yes, I had weird constraints on Kindle where non-zero return codes where a big no-no, hence the crappy workaround
.
EDIT: See
this for one example of how I'm using that in shell.
It's of course much easier in C, because fbink_print just returns that number, plain and simple, you just have to check for errors, which are always negative
.