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: error on path separator in template prefix #3512

Merged
merged 1 commit into from
May 12, 2022

Conversation

jfinkels
Copy link
Collaborator

Correct the error that arises from a path separator in the prefix
portion of a template argument provided to mktemp. Before this
commit, the error message was incorrect:

$ mktemp -t a/bXXX
mktemp: failed to create file via template 'a/bXXX': No such file or directory (os error 2) at path "/tmp/a/bege"

After this commit, the error message is correct:

$ mktemp -t a/bXXX
mktemp: invalid template, 'a/bXXX', contains directory separator

The code was failing to check for a path separator in the prefix
portion of the template.

@jfinkels jfinkels force-pushed the mktemp-invalid-template-path-sep branch from 2bddea3 to 04f20c3 Compare May 10, 2022 02:06
Correct the error that arises from a path separator in the prefix
portion of a template argument provided to `mktemp`. Before this
commit, the error message was incorrect:

    $ mktemp -t a/bXXX
    mktemp: failed to create file via template 'a/bXXX': No such file or directory (os error 2) at path "/tmp/a/bege"

After this commit, the error message is correct:

    $ mktemp -t a/bXXX
    mktemp: invalid template, 'a/bXXX', contains directory separator

The code was failing to check for a path separator in the prefix
portion of the template.
@sylvestre sylvestre force-pushed the mktemp-invalid-template-path-sep branch from 04f20c3 to 2874f18 Compare May 11, 2022 10:59
@sylvestre sylvestre merged commit 1ca4cf5 into uutils:main May 12, 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