On Tue, 7 Oct 2003, Gisle Vanem wrote:

> The latest patch at Tom's site had this patch in LYmain.c:
> 
> +    if (((cp = LYgetenv("SHELL")) != NULL)
> +      && (strstr(cp, "sh") != NULL))
> +       dj_is_bash = TRUE;
> 
> This should be more robust IMHO (in case of
> SHELL=c:\shared\stuff\4dos.com). How about:
> 
>   if (((cp = LYgetenv("SHELL")) != NULL)
>       && (strstr(cp, "/sh") != NULL || strstr(cp, "/bash") != NULL))
>        dj_is_bash = TRUE;
> 
> My bash (v 205b.0) sets SHELL itself to
> /dev/env/DJDIR/bin/bash.exe whether it's started as
> bash or sh. So maybe just check for "bash.exe"?

I don't know that you can count on this behavior. At this time I am
using bash 2.04.7 and the SHELL variable is set in my _blogin file, so
it isn't set when invoking either bash or sh except as a login shell. It
will be set however it is set up in the initialization file. I believe
it would be better to use the DJGPP function "basename" as follows:

    if (((cp = basename(LYgetenv("SHELL"))) != NULL)
      && (strstr(cp, "sh") != NULL))
       dj_is_bash = TRUE;

                     Doug
-- 
Doug Kaufman
Internet: [EMAIL PROTECTED]


; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to [EMAIL PROTECTED]

Reply via email to