-
Notifications
You must be signed in to change notification settings - Fork 32
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
Fix process substitution combined with redirection #40
Conversation
3e0d97c
to
829cd42
Compare
Very nice work, thanks for that! So, this will be the first ksh93 version with that whopper of a bug fixed. There are a few things with the regression tests, though. Here's a patch. Summary:
|
829cd42
to
a8e6034
Compare
The pull request has been updated with your patch. Thanks for pointing out the |
Almost done. Current version removes an empty line in edit: which was caused by my own patch, sorry about that. |
The code for handling process substitution with redirection was never being run because IORAW is usually set when IOPROCSUB is set. This commit fixes the problem by moving the required code out of the !IORAW if statement. The following command now prints 'good' instead of writing 'ok' to a bizzare file: $ ksh -c 'echo ok > >(sed s/ok/good/); wait' good This commit also fixes a bug that caused the process ID of the asynchronous process to print when the shell was in interactive mode. The following command no longer prints a process ID, behaving like in Bash and zsh: $ echo >(/bin/true) /dev/fd/5 src/cmd/ksh93/sh/args.c: - Temporarily turn off the interactive state while in a process substitution to prevent the shell from printing the PID of the asynchronous process. src/cmd/ksh93/sh/io.c: - Move the code for process substitution with redirection into a separate if statement. src/cmd/ksh93/tests/io.sh: - Add two tests for both process substitution bugs fixed by this commit. src/cmd/ksh93/tests/shtests: - Update shtests with a patch from Martijn Dekker to use pretty-printing for the output from the times builtin (if it is available). Fixes ksh93#2
a8e6034
to
0f6ec4c
Compare
The pull request no longer changes |
The code for handling process substitution with redirection was never being run because
IORAW
is usually set whenIOPROCSUB
is set. This pull request fixes the problem by moving the required code out of the!IORAW
if statement. The following command now prints 'good' instead of writing 'ok' to a bizarre file:$ ksh -c 'echo ok > >(sed s/ok/good/); wait' good
This pull request also fixes a bug that caused the process ID of the asynchronous process to print when the shell was in interactive mode. The fix is to temporarily turn off the shell's interactive state while in a process substitution. The following command no longer prints a process ID, behaving like in Bash and zsh: