1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-29 08:17:18 -04:00
elinks/contrib/wipe-out-ssl.awk
Petr Baudis 0f6d4310ad Initial commit of the HEAD branch of the ELinks CVS repository, as of
Thu Sep 15 15:57:07 CEST 2005. The previous history can be added to this
by grafting.
2005-09-15 15:58:31 +02:00

23 lines
408 B
Awk

#!/bin/awk -f
BEGIN {
iflevel = 0;
}
{
if (!iflevel) {
if ($1 == "#ifdef" && $2 == "HAVE_SSL") iflevel = 1;
else print $0;
} else {
if (iflevel == 1 && ($1 == "#else" || $1 == "#elif")) {
iflevel = 0;
if ($1 == "#else") print "#if 1";
else {
print "#if 0";
print $0;
}
}
if ($1 == "#if" || $1 == "#ifdef" || $1 == "#ifndef") iflevel++;
if ($1 == "#endif") iflevel--;
}
}