Skip to content

Commit

Permalink
fix stdin
Browse files Browse the repository at this point in the history
  • Loading branch information
spali committed Jan 28, 2021
1 parent 5c5a591 commit 2d0fc52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xq.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func printUsage() {

func parseArguments(_file string, _f string, _xpath string, _x string, s os.File) (file string, xpath string, stdin bool, err error) {
stat, _ := s.Stat()
if stdin = stat.Size() > 0; !stdin {
if stdin = (stat.Mode() & os.ModeCharDevice) == 0; !stdin {
if _f != "" {
file = _f
}
Expand Down

0 comments on commit 2d0fc52

Please sign in to comment.