Mail Archives: djgpp-workers/1999/07/25/11:29:36
> by Novell redirectors. So I suggest simply to lose `isalpha' in
> fragments like the above.
Lost. Thanks.
>
> 2.bind.c:
>
> + #if defined (HAVE_SETMODE) && defined(O_TEXT)
> + setmode (file, O_TEXT);
> + #endif
>
> Is it safe to read .inputrc in text mode? Can we be sure that no
> strange unprintable characters will ever be there, in particular in
> the key-binding part?
In this case, yes. All commands are in text form and CR & LF are
handled with printf-style escapes.
>
> 3. terminal.c:
>
> I'm probably missing something here--how is it supposed to work, after
> you remove all this? The usual code uses termcap functions like
> tgetnum etc., which we don't have.
You're right. Turns out Bash comes with GNU Termcap, but the
standalone Readline package doesn't. But we could use GNU
Termcap with Readline, since they're both under the same license.
> 4. histfile.c:
>
> + #if defined (HAVE_SETMODE) && defined (O_TEXT)
> + setmode (file, O_TEXT);
> + #endif
>
> Same comment as for .inputrc: are we sure that everything that goes to
> the history file is printable text with no strange characters? If
> not, using binary mode and manually stripping the CRs is safer.
As a test, I typed in 'test' then ctrl-a at the Bash command line. I found
the ctrl-a unescaped in the history file. If we want to able to store a CR
not with a LF, then the stripping will need to be done as you suggest.
---
Mark Elbrecht, snowball3 AT bigfoot DOT com
http://snowball.frogspace.net/
- Raw text -