mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
Compiling incomplete redir is now safe.
This commit is contained in:
parent
d4e8659853
commit
70f362667a
|
@ -282,7 +282,8 @@ func (rn *Redir) parse(ps *parser, dest *Compound) {
|
|||
if parseSep(rn, ps, '&') {
|
||||
rn.SourceIsFd = true
|
||||
}
|
||||
if !startsCompound(ps.peek()) {
|
||||
rn.setSource(parseCompound(ps))
|
||||
if len(rn.Source.Indexings) == 0 {
|
||||
if rn.SourceIsFd {
|
||||
ps.error(shouldBeFd)
|
||||
} else {
|
||||
|
@ -290,7 +291,6 @@ func (rn *Redir) parse(ps *parser, dest *Compound) {
|
|||
}
|
||||
return
|
||||
}
|
||||
rn.setSource(parseCompound(ps))
|
||||
}
|
||||
|
||||
func isRedirSign(r rune) bool {
|
||||
|
|
Loading…
Reference in New Issue
Block a user