Skip to content

Commit

Permalink
Fix empty lines in hexdump with multiple comments in one line ##print
Browse files Browse the repository at this point in the history
  • Loading branch information
radare authored May 31, 2021
1 parent c6f09b9 commit 0aba7ad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 3 additions & 1 deletion libr/core/disasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,9 @@ static void ds_comment_(RDisasmState *ds, bool align, bool nl, const char *forma
if (!nl) {
break;
}
r_cons_newline ();
if (!ds->show_comment_right && nl) {
r_cons_newline ();
}
first = false;
p = nl + 1;
}
Expand Down
4 changes: 2 additions & 2 deletions libr/util/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ R_API void r_print_hexdump(RPrint *p, ut64 addr, const ut8 *buf, int len, int ba
const char *a = r_str_pad (' ', 8 + (p->cols * 4));
printfmt ("%s; %s", a, q);
}
p->cb_printf ("\n");
// p->cb_printf ("\n");

if (!nl) {
break;
Expand All @@ -1366,7 +1366,7 @@ R_API void r_print_hexdump(RPrint *p, ut64 addr, const ut8 *buf, int len, int ba
free (s);
} else {
printfmt ("%s ; %s", a, comment);
p->cb_printf ("\n");
// p->cb_printf ("\n");
}
free (comment);
}
Expand Down
2 changes: 0 additions & 2 deletions test/db/cmd/cmd_px
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ EXPECT=<<EOF
0x0000ffda .... .... .... .... .... .... .... ....                 
0x0000ffea .... .... .... .... .... .... .... ....                 
0x0000fffa .... .... .... 7f45 4c46 0100 0000 0000       .ELF...... ; segment.ehdr ; [01] -rw- segment size 45 named ehdr

0x0001000a 0000 0000 0100 0200 0300 2000 0100 2000 .......... ... .
0x0001001a 0100 0400 0000 b32a 31c0 40cd 8000 3400 .......*1.@...4. ; entry0
0x0001002a 2000 0100 0000 0000 0000 0000 0000 0000  ...............
Expand All @@ -148,7 +147,6 @@ EXPECT=<<EOF
0x0000ffda .... .... .... .... .... .... .... ....
0x0000ffea .... .... .... .... .... .... .... ....
0x0000fffa .... .... .... 7f45 4c46 0100 0000 0000 .ELF...... ; segment.ehdr ; [01] -rw- segment size 45 named ehdr

0x0001000a 0000 0000 0100 0200 0300 2000 0100 2000 .......... ... .
0x0001001a 0100 0400 0000 b32a 31c0 40cd 8000 3400 .......*1.@...4. ; entry0
0x0001002a 2000 0100 0000 0000 0000 0000 0000 0000 ...............
Expand Down

0 comments on commit 0aba7ad

Please sign in to comment.