-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix v=$(<file) for closed FD 0,1,2 (rhbz#1066589)
var=$(< file) now reads the file even if the standard inout, standard output and/or standard error file descriptors are closed. Original patch: https://src.fedoraproject.org/rpms/ksh/blob/642af4d6/f/ksh-20120801-filecomsubst.patch src/cmd/ksh93/sh/io.c: sh_redirect(): - When processing the '<' redirector as part of $(< ...), i.e. if flag==3, make sure the FD of the file to read is > 2 by calling sh_iomovefd(). Unlike the RedHat patch, this checks for flag==3 to avoid unnecessary sh_iomovefd() calls for normal redirections, as there was no bug with those. src/cmd/ksh93/tests/io.sh: - Add test.
- Loading branch information
Showing
3 changed files
with
6 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters