scullionw / dirstat-rs

(fastest?) disk usage cli, similar to windirstat.
MIT License
157 stars 11 forks source link

Fix bug: high word of size for compressed files on windows was ignored #4

Closed Mart-Bogdan closed 2 years ago

Mart-Bogdan commented 2 years ago

bugreport-ds

There was a null pointer passing in all the time. This signaled to function that we "don't want" high word.

In C (or in win API at least) it's a common pattern to accept pointers for optional arguments.

Notice, if you would work with such APIs in future.

In case when we need to check pointers for zero, like was in the original code: then the function would accept double pointer ( void**). Then we have a local variable defined as a regular pointer and an argument defined as a double-pointer. Then library could write something into our pointer.

P.S. I'm not sure if I should bump version instead of a maintainer, but made it just in case.

Mart-Bogdan commented 2 years ago

Hello @scullionw. I hope you would find time to review/merge My PR. Because currently functionality of compressed files is broken on Windows.

scullionw commented 2 years ago

Hi! sorry for the delay! I had indeed misunderstood the docs.

Thanks for the PR, it looks good to me!

Mart-Bogdan commented 2 years ago

Thanks. Perhaps I would be able to work on #5 next week.

Mart-Bogdan commented 2 years ago

it's sad that on Linux in btrfs you need CAP_SYSADMIN (which practically means being root) to be able to get compressed file size :-(