News for hackers. Stuff that matters.
Re:Curl doesn’t spew binary anymore by jrgv on Saturday June 17, 2017 @08:01AM (#14575507)
what if your output is more than 2000 bytes?

The announcement says that "curl will inspect the beginning of each download", and I think that comparison just turns off the check after at least 2000 bytes have already been output (see a few lines below the change you quoted, where outs->bytes is incremented by the amount of bytes that were output).

what if your output is binary but doesn’t contain a byte 0?

I guess curl will incorrectly recognize the binary as text.

what if your output is a normal UTF-8 string but contains a byte 0?

I guess curl will incorrectly recognize the text as binary, and you can use `-o -` to override that and output to the terminal anyway.

Re:Curl doesn’t spew binary anymore by baby on Saturday June 17, 2017 @08:06AM (#14575530)
> I guess curl will incorrectly recognize the binary as text.

This doesn't sound like a really good test.

Re:Curl doesn’t spew binary anymore by raimue on Saturday June 17, 2017 @08:17AM (#14575568)
Looking for a NUL byte is the standard test that is also widely used by other tools such as grep or diff.
Re:Curl doesn’t spew binary anymore by baby on Saturday June 17, 2017 @09:50AM (#14575882)
Interesting, I'm going to try to implement that in my file parser.