[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Incorrect use of extended RE in script
From: |
Jens Schweikhardt |
Subject: |
Incorrect use of extended RE in script |
Date: |
Sun, 21 Dec 2003 19:57:20 +0100 |
User-agent: |
Mutt/1.5.5.1i |
Tom et al,
I'm looking at # $Id: MKterminfo.sh,v 1.10 2002/06/29 20:04:28 tom Exp $
as found in ncurses 5.3.
There's a sed script apparently trying to use an Extended Regular
Expression, \+, but sed only accepts Basic Regular Expressions (as per
SUSv3, see
http://www.opengroup.org/onlinepubs/007904975/utilities/sed.html)
The script in question is (tabs and ^E not preserved):
sed -n <$caps "\
...
s/ [A-Z0-9_()\-]\+ [0-9\-]\+ [Y\-][B\-][C\-][G\-][EK\-]\** / T{^E/
...
Thus, the resulting terminfo.5 has horribly broken tables, e.g. on
FreeBSD, where it looks like
...
These are the boolean capabilities:
Variable Cap- TCap Description
Booleans name Code
auto_left_margin bw bw
T}
auto_right_margin am am
T}
back_color_erase bce ut
T}
can_change ccc
T}
ceol_standout_glitch xhp xs
T}
col_addr_glitch xhpa
T}
cpi_changes_res cpix
T}
cr_cancels_micro_mode crxm YB
I'm not sure what the \+ is supposed to do. If it's intended as
a quantifier for "one or more", I suggest
s/ [A-Z0-9_()\-][A-Z0-9_()\-]* [0-9\-][0-9\-]*
[Y\-][B\-][C\-][G\-][EK\-]\** / T{^E/
Regards,
Jens <schweikh at FreeBSD.org>
--
Jens Schweikhardt http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)
- Incorrect use of extended RE in script,
Jens Schweikhardt <=