aboutsummaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2019-02-25 09:25:41 +0200
committerArnold D. Robbins <arnold@skeeve.com>2019-02-25 09:25:41 +0200
commitc0e9f73728d1c38ebce5fdd45df508fff26e26c4 (patch)
tree06539ef93852af2efa547675985c7a4e35e44957 /profile.c
parent44611db36ba329fab248179e0350d44fcff5e3c2 (diff)
downloadegawk-c0e9f73728d1c38ebce5fdd45df508fff26e26c4.tar.gz
egawk-c0e9f73728d1c38ebce5fdd45df508fff26e26c4.tar.bz2
egawk-c0e9f73728d1c38ebce5fdd45df508fff26e26c4.zip
Small profiling improvements.
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/profile.c b/profile.c
index 6e92f601..910a821d 100644
--- a/profile.c
+++ b/profile.c
@@ -807,7 +807,11 @@ cleanup:
if (is_binary(t1->type))
pp_parenthesize(t1);
if (pc->source_line > 0) { /* don't print implicit 'return' at end of function */
- fprintf(prof_fp, "%s %s", op2str(pc->opcode), t1->pp_str);
+ // avoid final trailing space to keep whiny users happy
+ if (t1->pp_str[0] != '\0')
+ fprintf(prof_fp, "%s %s", op2str(pc->opcode), t1->pp_str);
+ else
+ fprintf(prof_fp, "%s", op2str(pc->opcode));
pc = end_line(pc);
}
pp_free(t1);