www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/03/29/00:28:26

From: "Mark E." <snowball3 AT bigfoot DOT com>
To: djgpp-workers AT delorie DOT com
Subject: (fwd) Msdos choice.com in bash204 shell returns 0
Date: Thu, 29 Mar 2001 00:27:28 -0500
Organization: Snowball's Web
Message-ID: <vlh5ctcrtsts0rf90h4u5lp3sih1s265i0@4ax.com>
X-Mailer: Forte Agent 1.8/32.548
MIME-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id AAA32505
Reply-To: djgpp-workers AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019