* Changed the recursion into an iteration so that we don't use awk functions
and it properly works with the Solaris implementation. git-svn-id: svn://svn.zoy.org/elk/trunk@207 55e467fa-43c5-0310-a8a2-de718669efc6
This commit is contained in:
parent
25c92f739b
commit
aefd5ebc52
|
@ -29,16 +29,15 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
need_nl = 0;
|
need_nl = 0;
|
||||||
do_line($0);
|
line = $0;
|
||||||
printf "\n";
|
|
||||||
}
|
while(line != "") {
|
||||||
|
|
||||||
function do_line(line) {
|
|
||||||
nxt = index(line, "@[")
|
nxt = index(line, "@[")
|
||||||
|
|
||||||
if(nxt == 0) {
|
if(nxt == 0) {
|
||||||
printf "%s", line;
|
printf "%s", line;
|
||||||
return;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(nxt > 1) {
|
if(nxt > 1) {
|
||||||
|
@ -47,8 +46,8 @@ function do_line(line) {
|
||||||
}
|
}
|
||||||
need_nl = 1;
|
need_nl = 1;
|
||||||
printf "%s", substr(line, 1, nxt - 1);
|
printf "%s", substr(line, 1, nxt - 1);
|
||||||
do_line(substr(line, nxt));
|
line = substr(line, nxt);
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = substr(line, 1, 3);
|
tmp = substr(line, 1, 3);
|
||||||
|
@ -101,7 +100,8 @@ function do_line(line) {
|
||||||
printf "\"%s\"\n%s", arg, inx;
|
printf "\"%s\"\n%s", arg, inx;
|
||||||
need_nl = 1;
|
need_nl = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
do_line(line);
|
printf "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue