Skip to content

readline ARGV: don't try to open '|-' or '-|' and warn #21181

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

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

tonycoz
Copy link
Contributor

@tonycoz tonycoz commented Jun 28, 2023

This has no effect on in-place editing nor on the <<>> operator.

Fixes #21176

@tonycoz tonycoz added the defer-next-dev This PR should not be merged yet, but await the next development cycle label Jun 28, 2023
@aquanight
Copy link

Variants of |- and -| that include whitespace will still cause a forked popen but will escape the checks added here.

@jkeenan
Copy link
Contributor

jkeenan commented Jul 1, 2023

Variants of |- and -| that include whitespace will still cause a forked popen but will escape the checks added here.

Is there reason to believe that "Variants of |- and -| that include whitespace" should be valid Perl code?

@jkeenan
Copy link
Contributor

jkeenan commented Jul 1, 2023

@tonycoz could you convert this into a smokeme branch? Thanks.

@tonycoz tonycoz force-pushed the 21176-no-ARGV-fork branch 2 times, most recently from fab0319 to 139cae9 Compare July 3, 2023 00:57
@tonycoz
Copy link
Contributor Author

tonycoz commented Jul 3, 2023

Changed this to ignore whitespace around the name, and pushed to a smoke-me

@aquanight
Copy link

aquanight commented Jul 3, 2023

Variants of |- and -| that include whitespace will still cause a forked popen but will escape the checks added here.

Is there reason to believe that "Variants of |- and -| that include whitespace" should be valid Perl code?

I've checked that such variants are accepted by core open and therefore by <> as well. Whitespace is allowed before, after, and inside the |- or -| construct. E.g.: open my $fd, " | - "; is valid and is a forked open. As such, it would cause a forked open in <> as well.

@jkeenan
Copy link
Contributor

jkeenan commented Jul 9, 2023

Changed this to ignore whitespace around the name, and pushed to a smoke-me

The results on the smoke-me branch look good. I don't have a good grasp on the other issues raised in this ticket, so I don't know whether we're ready to merge or not.

@tonycoz
Copy link
Contributor Author

tonycoz commented Jul 9, 2023

No, I need to re-work it again.

@tonycoz tonycoz marked this pull request as draft July 9, 2023 23:24
@jkeenan jkeenan removed the defer-next-dev This PR should not be merged yet, but await the next development cycle label Jul 10, 2023
This has no effect on in-place editing nor on the <<>> operator.

Later modified to ignore leading/internal/trailing space when
checking the name.

Fixes Perl#21176
@tonycoz tonycoz force-pushed the 21176-no-ARGV-fork branch from 139cae9 to 4ac472e Compare July 12, 2023 04:51
@tonycoz tonycoz marked this pull request as ready for review July 13, 2023 03:04
@tonycoz tonycoz merged commit fb5c7ce into Perl:blead Aug 1, 2023
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.

<> gives strange warnings when '-|' is in @ARGV
4 participants