uutils / uutils/coreutils

seq allows unicode whitespace in number string

Open
#7,516 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

U - seq
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

Expected result

$ seq "$(printf "\u2029 1")" 2
seq: invalid floating point argument: ‘\342\200\251 1’
Try 'seq --help' for more information.

Actual Result

$ cargo run seq "$(printf "\u2029 1")" 5
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.14s
     Running `target/debug/coreutils seq '
 1' 5`
1
2

Cause

seq has it's own number parsing implementation which makes use of trim_start here. This can be fixed by using the same number parsing as printf, or trim_ascii_start could be used instead of trim_start.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/uu/seq/src/numberparse.rs at the trim_start call, then compare seq's number parsing with printf's parsing. Reproduce the issue with the provided cargo run seq command and check the behavior for the U+2029 whitespace prefix. Done means seq rejects the input with an invalid floating point argument error rather than producing numbers.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.