diff --git a/ase/awk/rex.c b/ase/awk/rex.c index 72d6ec66..bcd49200 100644 --- a/ase/awk/rex.c +++ b/ase/awk/rex.c @@ -1,5 +1,5 @@ /* - * $Id: rex.c,v 1.52 2006-12-13 14:16:12 bacon Exp $ + * $Id: rex.c,v 1.53 2006-12-23 06:33:47 bacon Exp $ */ #include @@ -410,7 +410,7 @@ static int __build_pattern (__builder_t* builder) if (builder->depth.max > 0 && builder->depth.cur >= builder->depth.max) { - builder->errnum = ASE_AWK_ERECURSION; + builder->errnum = ASE_AWK_ERECUR; return -1; } @@ -1076,7 +1076,7 @@ static const ase_byte_t* __match_branch_body ( if (matcher->depth.max > 0 && matcher->depth.cur >= matcher->depth.max) { - matcher->errnum = ASE_AWK_ERECURSION; + matcher->errnum = ASE_AWK_ERECUR; return ASE_NULL; } diff --git a/ase/awk/run.c b/ase/awk/run.c index f74fed85..73379b75 100644 --- a/ase/awk/run.c +++ b/ase/awk/run.c @@ -1,5 +1,5 @@ /* - * $Id: run.c,v 1.305 2006-12-19 14:20:30 bacon Exp $ + * $Id: run.c,v 1.306 2006-12-23 06:33:47 bacon Exp $ */ #include @@ -1660,7 +1660,7 @@ static int __run_block (ase_awk_run_t* run, ase_awk_nde_blk_t* nde) if (run->depth.max.block > 0 && run->depth.cur.block >= run->depth.max.block) { - run->errnum = ASE_AWK_ERECURSION; + run->errnum = ASE_AWK_ERECUR; return -1;; } diff --git a/ase/test/awk/awk.c b/ase/test/awk/awk.c index 7cafa872..55ca103d 100644 --- a/ase/test/awk/awk.c +++ b/ase/test/awk/awk.c @@ -1,5 +1,5 @@ /* - * $Id: awk.c,v 1.145 2006-12-19 14:49:24 bacon Exp $ + * $Id: awk.c,v 1.146 2006-12-23 06:33:47 bacon Exp $ */ #include @@ -186,6 +186,7 @@ static FILE* awk_popen (const ase_char_t* cmd, const ase_char_t* mode) n = wcstombs (mode_mb, mode, ASE_COUNTOF(mode_mb)); if (n == -1) return NULL; if (n == ASE_COUNTOF(mode_mb)) cmd_mb[ASE_COUNTOF(mode_mb)-1] = '\0'; + return popen (cmd_mb, mode_mb); #endif } @@ -289,6 +290,7 @@ static ase_ssize_t process_extio_pipe ( case ASE_AWK_IO_CLOSE: { + fflush ((FILE*)epa->handle); awk_dprintf (ASE_T("closing %s of type (pipe) %d\n"), epa->name, epa->type); fclose ((FILE*)epa->handle); epa->handle = NULL; diff --git a/ase/test/awk/emp-003.out b/ase/test/awk/emp-003.out index 1762f1f8..8c37c7e9 100644 --- a/ase/test/awk/emp-003.out +++ b/ase/test/awk/emp-003.out @@ -1,5 +1,5 @@ { - print __global9,$1,$__global9; + print NF,$1,$NF; } 3 Beth 0 diff --git a/ase/test/awk/emp-004.out b/ase/test/awk/emp-004.out index 51598ab9..5bb7e8af 100644 --- a/ase/test/awk/emp-004.out +++ b/ase/test/awk/emp-004.out @@ -1,5 +1,5 @@ { - print __global10,$0; + print NR,$0; } 1 Beth 4.00 0 diff --git a/ase/test/awk/emp-015.out b/ase/test/awk/emp-015.out index 3ce88d2b..3c696f7e 100644 --- a/ase/test/awk/emp-015.out +++ b/ase/test/awk/emp-015.out @@ -1,4 +1,4 @@ -(__global9 != 3) { +(NF != 3) { print $0,"number of fields is not equal to 3"; } diff --git a/ase/test/awk/emp-018.out b/ase/test/awk/emp-018.out index 909843f2..fd8fa49f 100644 --- a/ase/test/awk/emp-018.out +++ b/ase/test/awk/emp-018.out @@ -1,4 +1,4 @@ END { - print __global10,"employees"; + print NR,"employees"; } 6 employees diff --git a/ase/test/awk/emp-019.out b/ase/test/awk/emp-019.out index f7512eb1..3126ff30 100644 --- a/ase/test/awk/emp-019.out +++ b/ase/test/awk/emp-019.out @@ -3,9 +3,9 @@ } END { - print __global10,"employees"; + print NR,"employees"; print "total pay is",pay; - print "average pay is",(pay / __global10); + print "average pay is",(pay / NR); } 6 employees total pay is 337.5 diff --git a/ase/test/awk/emp-024.out b/ase/test/awk/emp-024.out index 27f914bc..a1af1cfb 100644 --- a/ase/test/awk/emp-024.out +++ b/ase/test/awk/emp-024.out @@ -1,9 +1,9 @@ { nc = ((nc + length ($0)) + 1); - nw = (nw + __global9); + nw = (nw + NF); } END { - print __global10,"lines,",nw,"words,",nc,"characters"; + print NR,"lines,",nw,"words,",nc,"characters"; } 6 lines, 18 words, 77 characters diff --git a/ase/test/awk/emp-026.out b/ase/test/awk/emp-026.out index f3bcb78e..2ac7bf5a 100644 --- a/ase/test/awk/emp-026.out +++ b/ase/test/awk/emp-026.out @@ -1,9 +1,9 @@ { - line[__global10] = $0; + line[NR] = $0; } END { - i = __global10; + i = NR; while ((i > 0)) { print line[i]; diff --git a/ase/test/awk/emp-027.out b/ase/test/awk/emp-027.out index 85acdc22..a1601e46 100644 --- a/ase/test/awk/emp-027.out +++ b/ase/test/awk/emp-027.out @@ -1,10 +1,10 @@ { - line[__global10] = $0; + line[NR] = $0; } END { - i = __global10; - for (i = __global10; (i > 0); i = (i - 1)) + i = NR; + for (i = NR; (i > 0); i = (i - 1)) print line[i]; } Susie 4.25 18 diff --git a/ase/test/awk/regress.sh b/ase/test/awk/regress.sh index 8c563b7e..39aa2bb4 100755 --- a/ase/test/awk/regress.sh +++ b/ase/test/awk/regress.sh @@ -31,8 +31,8 @@ run_script_for_test() echo ">> RUNNING $script" ./awk "$script" "$data" > "$output.$pid" - #diff -y "$output" "$output.$pid" - diff "$output" "$output.$pid" + diff -y "$output" "$output.$pid" + #diff "$output" "$output.$pid" if [ $? -ne 0 ] then rm -f "$output.$pid" @@ -55,7 +55,7 @@ run_test() echo "###################################" echo "PROBLEM(S) DETECTED IN $script.". echo "###################################" - break + return 1 fi done @@ -67,9 +67,11 @@ run_test() echo "###################################" echo "PROBLEM(S) DETECTED IN $script.". echo "###################################" - break + return 1 fi done + + return 0 } #--------#