Skip to content

ptx: Extra space is added before truncation marker #8783

@Misakait

Description

@Misakait

When text is truncated, uutils/ptx incorrectly adds a leading space before the truncation marker in both roff (-G) formats and tex formats, which is inconsistent with GNU ptx.

Steps to Reproduce

Run the following command with GNU ptx:

echo "Hello  World\nRust is funnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" | ptx -G -w 30

The output for the keyword "is" contains "is/".
Image

but run the same command with uutils/ptx:

echo "Hello  World\nRust is funnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn" |cargo run -- -G -w 30

The output for the keyword "is" contains "is /".
Image

of course,multiple spaces between words also trigger this bug.

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