Skip to content

ls: zero block size leads to "divide by zero" error #8917

@cakebaker

Description

@cakebaker

When providing --block-size=0 -l we panic with:

$ cargo run -q ls --block-size=0 -l

thread 'main' panicked at src/uu/ls/src/ls.rs:2691:34:
attempt to divide by zero

GNU ls, on the other hand, shows an error message:

$ ls --block-size=0 -l
ls: invalid --block-size argument '0'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions