]> git.draconx.ca Git - dxcommon.git/commit
exported.sh: Work around DJGPP shell redirection bug.
authorNick Bowler <nbowler@draconx.ca>
Thu, 21 Apr 2022 05:29:22 +0000 (01:29 -0400)
committerNick Bowler <nbowler@draconx.ca>
Thu, 21 Apr 2022 05:50:08 +0000 (01:50 -0400)
commitb7a7076354b0837c6da080270bd0d6da2dfce75b
tree2f6da915c8a762b7b4ef06562e95575ac0060280
parent7c5df228a04f7a655486bffee6f169f52b5edb35
exported.sh: Work around DJGPP shell redirection bug.

In DJGPP's bash port, it seems that redirections of the form

  /absolute/path/to/program 3>&-

result in the file descriptor being closed for the whole shell,
rather than just for the one command as expected.  Since some of
the configure substitutions into exported.sh can be absolute paths,
this causes failures.

Using a different command syntax avoids this problem.  For example,

  { /absolute/path/to/program; } 3>&-

appears to work as expected.  Adjust the exported.sh.in snippet to
do just that.  There is still one redirection error message printed
to stderr by DJGPP bash but it appears spurious at first glance.
All the redirections now appear to be working properly and the
script output looks good.
snippet/exported.sh.in