[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev djgpp bash test

From: Doug Kaufman
Subject: Re: lynx-dev djgpp bash test
Date: Sun, 19 Oct 2003 19:48:44 -0700 (PDT)

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\ 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 Kaufman
Internet: address@hidden

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]