1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-11 05:29:28 -04:00
elinks/contrib/wipe-out-ssl.awk

23 lines
408 B
Awk
Raw Normal View History

#!/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--;
}
}