#19720: ncurses fails to compile with gcc 5.1
-------------------------+------------------------
Reporter: siflfran@… | Owner: developers
Type: defect | Status: new
Priority: normal | Milestone:
Component: packages | Version: Trunk
Resolution: | Keywords:
-------------------------+------------------------
Comment (by anonymous):
in that patch:
sed -e 's/bool/P_NCURSES_BOOL/g' $TMP > $ED2
the major problem with this approach us that the regexp will replace ANY
occurrence of the string "bool" even if it occurs as a substring of
another word. I suggest adding some trimming context to it:
[^a-zA-Z0-9].bool[^a-zA-Z0-9].
so that it only matches, for example " bool ", "(bool)", "_bool " and so
on, but not "boole" nor "hboolh" nor "blahblahboolblah" nor "9bool5" and
so on
thus the sed command should become
{{{
sed -r -e 's/([^a-zA-Z0-9].)bool([^a-zA-Z0-9].)/\1P_NCURSES_BOOL\2/g' $TMP
> $ED2
}}}
notes:
- the -r parameter is needed to enable extended regular expressions
- parentheses in the first part define groups that can be reused in the
the second part
- \1, \2, etc. in the second part are references to the groups defined in
the first part, starting with group number 1
--
Ticket URL: <https://dev.openwrt.org/ticket/19720#comment:1>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets