dd: exit when bs/ibs/obs/cbs isn't positive#11630
dd: exit when bs/ibs/obs/cbs isn't positive#11630iburaky2 wants to merge 3 commits intouutils:mainfrom
Conversation
|
GNU testsuite comparison: |
|
Our |
This comment was marked as resolved.
This comment was marked as resolved.
6f89772 to
3fae276
Compare
|
mb I got the order wrong Negative numbers are handled here: |
|
GNU testsuite comparison: |
|
Thanks! Two things before this lands:
|
3fae276 to
ef02de9
Compare
|
GNU testsuite comparison: |
|
I've fixed points 2 and 3 and also added Regarding point 1, bs=-5 does match GNU's error message [see the passing test which now checks error message as proof :) ] because it's handled earlier in I'm not fully sure I fully understand what the point of is. I guess this would only trigger if we were on a 32 bit system (since the function returns usize) and num (u64) was too large? |
Match GNU coreutils behavior:
Currently:
bs/ibs/obs=0panics, see dd bs=0 panics (attempt to divide by zero) #11580.cbs=0seems to allow normal dd operation???bs/ibs/obs/cbs=-1errors correctly after reachingparse_bytes_with_opt_multiplierAnother option would be to check in
parse_bytes/parse_bytes_with_opt_multiplierbut I think it's better to exit earlier.