mirror of
https://github.com/radareorg/radare2.git
synced 2025-03-05 04:50:43 +00:00
psx escapes newlines (#10089)
This commit is contained in:
parent
a5477b2de0
commit
bae0f69aab
@ -4540,7 +4540,7 @@ static int cmd_print(void *data, const char *input) {
|
||||
break;
|
||||
case 'x': // "psx"
|
||||
if (l > 0) {
|
||||
r_print_string (core->print, core->offset, block, len, 0);
|
||||
r_print_string (core->print, core->offset, block, len, R_PRINT_STRING_ESC_NL);
|
||||
}
|
||||
break;
|
||||
case 'b': // "psb"
|
||||
|
@ -158,6 +158,7 @@ R_API void r_print_offset_sg(RPrint *p, ut64 off, int invert, int offseg, int se
|
||||
#define R_PRINT_STRING_URLENCODE 4
|
||||
#define R_PRINT_STRING_WRAP 8
|
||||
#define R_PRINT_STRING_WIDE32 16
|
||||
#define R_PRINT_STRING_ESC_NL 32
|
||||
R_API int r_print_string(RPrint *p, ut64 seek, const ut8 *str, int len, int options);
|
||||
R_API int r_print_date_dos(RPrint *p, const ut8 *buf, int len);
|
||||
R_API int r_print_date_hfs(RPrint *p, const ut8 *buf, int len);
|
||||
|
@ -571,6 +571,7 @@ R_API int r_print_string(RPrint *p, ut64 seek, const ut8 *buf, int len, int opti
|
||||
bool zeroend = (options & R_PRINT_STRING_ZEROEND);
|
||||
bool wrap = (options & R_PRINT_STRING_WRAP);
|
||||
bool urlencode = (options & R_PRINT_STRING_URLENCODE);
|
||||
bool esc_nl = (options & R_PRINT_STRING_ESC_NL);
|
||||
p->interrupt = 0;
|
||||
int col = 0;
|
||||
i = 0;
|
||||
@ -600,7 +601,7 @@ R_API int r_print_string(RPrint *p, ut64 seek, const ut8 *buf, int len, int opti
|
||||
// TODO: some ascii can be bypassed here
|
||||
p->cb_printf ("%%%02x", b);
|
||||
} else {
|
||||
if (b == '\n' || IS_PRINTABLE (b)) {
|
||||
if ((b == '\n' && !esc_nl) || IS_PRINTABLE (b)) {
|
||||
p->cb_printf ("%c", b);
|
||||
} else {
|
||||
p->cb_printf ("\\x%02x", b);
|
||||
|
Loading…
x
Reference in New Issue
Block a user