Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mktemp: only replace last contiguous block of Xs #3586

Merged
merged 2 commits into from
Jun 6, 2022

Conversation

jfinkels
Copy link
Collaborator

@jfinkels jfinkels commented Jun 1, 2022

Fix a bug in which mktemp would replace everything in the template
argument from the first 'X' to the last 'X' with random bytes, instead
of just replacing the last contiguous block of 'X's.

Before this commit,

$ mktemp XXX_XXX
2meCpfM

After this commit,

$ mktemp XXX_XXX
XXX_Rp5

This fixes test cases suffix2f and suffix2d in
tests/misc/mktemp.pl in the GNU coreutils test suite.

jfinkels and others added 2 commits June 1, 2022 18:21
Fix a bug in which `mktemp` would replace everything in the template
argument from the first 'X' to the last 'X' with random bytes, instead
of just replacing the last contiguous block of 'X's.

Before this commit,

    $ mktemp XXX_XXX
    2meCpfM

After this commit,

    $ mktemp XXX_XXX
    XXX_Rp5

This fixes test cases `suffix2f` and `suffix2d` in
`tests/misc/mktemp.pl` in the GNU coreutils test suite.
@sylvestre sylvestre merged commit 3f203c7 into uutils:main Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants