Mail Archives: djgpp-workers/2001/03/29/00:28:26
I can confirm the return code is 0 when LFN=Y and is as expected when LFN=N. I traced
the code path taken in dosexec.c when LFN=N and LFN=Y. When LFN=N, choice.com is
executed via direct_exec and when LFN=Y, choice.com is executed via go32_exec. And
when executed via go32_exec, it's changed to "%COMSPEC%/command.com /c choice.com".
And I assume the return value is eaten by command.com.
In gnu.bash.bug, "WayneK" <waykauf AT home DOT com> wrote:
>
>Bash204 not returning correct value when using msdos 'choice' command.
>
>choice[.com] /c:abcde
>
>
>In msdos bat file ERRORLEVEL set to a=1, b=2, c=3, d=4, e=5
>
>In bash1.14.7 return is set to a=1, b=2, c=3, d=4, e=5
>
>In bash203 return is set to a=0, b=0, c=0, d=0, e=0
>
>In bash2.04.7(1) return is set to a=0, b=0, c=0, d=0, e=0
>
>The Bash2.04.7(1) is from the bsh204b.zip file.
>(Same results from complied 'bash')
>
>
>Example shell:
>
>choice /c:yneabc "Continue "
>ret="$?"
>echo "ret= $ret"
>
>Thanks for your help
>Wayne K
>
>
--
Mark E.: snowball3 AT bigfoot DOT com
http://snowball.frogspace.net/
- Raw text -