mirror of
https://github.com/rkd77/elinks.git
synced 2024-10-30 08:27:17 -04:00
23 lines
408 B
Awk
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--;
|
||
|
}
|
||
|
}
|