www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/04/28/18:04:27

Sender: rich AT delorie DOT com
Message-ID: <390A12B4.437341D9@bigfoot.com>
Date: Fri, 28 Apr 2000 23:37:40 +0100
From: Richard Dawe <richdawe AT bigfoot DOT com>
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.14 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: Some questions about porting fileutils 4.0
References: <39081435 DOT E2EDBC04 AT bigfoot DOT com> <39089981 DOT 16E7FAF7 AT bigfoot DOT com> <200004282213 DOT SAA26938 AT indy DOT delorie DOT com>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Eli Zaretskii wrote:
> 
> Richard Dawe wrote:
> > I've only applied a few of the diffs from fileutils 3.16 port - you
> > seem to have done much of the work for me already Eli. ;)
> 
> I'd suggest to scrutinize each change I did, and also look for things
> I didn't do, but which should be done now.

Yes, I haven't applied all your patches. I'm actually surprised how many
of the patches still seem relevant. The next stage is find other changes
that need doing.

None of the patches for dd could be applied, unfortunately, so that might
take some time to get right.

> For example, the code in dircolors.c which looks at the shell name
> should probably be made workable with DOS-style sh.exe and such, what
> with so many people who use Bash for interactive sessions.

The shell seems to default to Bourne syntax, when SHELL is not set to csh
or tcsh (the path is stripped off). Actually, I will need to strip off the
'.exe' extension (and '.com') from that check.

> > I have one question: in the patch from fileutils 3.16 port for
> > dircolors.c there is a line #ifdef'd on __DJGPP__ that _always_ sets
> > the 'term' variable to "console". In non-DJGPP cases the terminal is
> > obtained from the TERM environment variable. Is there any reason why
> > we shouldn't allow the TERM env var to override "console", e.g. for
> > output redirection?
> 
> Probably not.  But could you please explain more about what do you
> want to do here?  I'm not sure I understand the details of your plan.

OK, here's the section of code, to which I've applied the patch from
fileutils 3.16:

/* Get terminal type */
  term = getenv ("TERM");
#ifdef __DJGPP__
  /* DJGPP port can always colorize, but TERM is not usually defined
there. */
  term = "console";
#endif  
  if (term == NULL || *term == '\0')
    term = "none";

I was thinking that we might not want to override the setting of TERM if
input was redirected and TERM was set to e.g. vt100. If this is unlikely
to happen or we don't support output to different terminal types, then I
guess we don't lose anything by ignoring TERM.

Basically, I'm curious why the setting of TERM is just discarded in
fileutils 3.16's dircolors.

I found that 'ls c:' does not work in bash (in 3.16 and 4.0 ports). Even
'ls c\:' fails. Is this expected behaviour? 'ls c:' works OK from
command.com.

Thanks, bye,

-- 
Richard Dawe
richdawe AT bigfoot DOT com ICQ 47595498 http://www.bigfoot.com/~richdawe/

- Raw text -


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