cholcombe973 / block-utils

Rust utilities for working with block devices
MIT License
22 stars 17 forks source link

Fix get_mount_device function for root path #34

Closed VladasZ closed 2 years ago

VladasZ commented 2 years ago

If we pass / path toget_mount_device function it will return incorrect device. This happens because we check if entire line from MTAB_PATH contains given path. This work fine for long paths but fails if paths is / because any path contains / and this function will always return first line from MTAB_PATH. Fixed by splitting line before check.

cholcombe973 commented 2 years ago

Good catch!

VladasZ commented 2 years ago

@cholcombe973 could you please release it?

cholcombe973 commented 2 years ago

Sure! I just published it