Commit Graph

1333 Commits

Author SHA1 Message Date
pancake
d520902ce8 Add RCons.isWindows() and update mini graph test 2021-09-17 09:24:27 +02:00
pancake
b80c77e931
Fix arrow keys regression on windows prompt ##cons 2021-09-13 17:09:09 +02:00
pancake
f86bee1852 Fix null deref in RCons.grep 2021-09-13 10:52:49 +02:00
pancake
2f5d8c9cfb
Remove globals on input.c for w32 (#19074) 2021-09-13 10:44:21 +02:00
pancake
6fc305c5e6
Fix #19065 - Fix prompt input when using scr.color=0 ##cons (#19067) 2021-09-09 20:31:11 +02:00
pancake
bdef1223da
Fix recently regressed tests 2021-08-29 21:00:28 +02:00
pancake
8ba42d98da
Do not serialize the config everytime, expose and use utf8 and fix R2COLOR env ##shell 2021-08-29 19:01:34 +02:00
pancake
9912c3ee0b
Check if user interrupted the shell command in nested macros ##shell (#19015) 2021-08-25 16:20:50 +02:00
pancake
dd344717c9 'e cfg.editor=' == 'e cfg.editor=-' 2021-08-19 18:39:54 +02:00
pancake
50d84c4c02 Fix assert when using the internal line editor with no file 2021-08-19 18:17:39 +02:00
pancake
89173f99dc
Dont check out of bounds last chars ##cons 2021-08-18 13:35:23 +02:00
pancake
bd888a2edf Fix more vs warnings 2021-08-17 00:35:52 +00:00
pancake
0acb19b68a
Fix some warnings spotted by visual studio (#18985)
Co-authored-by: pancake <pancake@nopcode.org>
2021-08-16 20:45:17 +02:00
pancake
09033f4406
Honor faster ^D on interactive execution path ##cons (#18983) 2021-08-14 21:06:52 +02:00
László Vaskó
8ef090c017
r_cons_printf_list: fix potential busy loop (#18970)
In case the string to be written by `vsnprintf` including `\0`
termination equals to the length of the buffer, the code enters in a
busy loop. The original code seems to assume, that `vsnprintf` won't
terminate the string with `\0` character which it does.

The [documentation of `vsnprintf`
states](https://en.cppreference.com/w/c/io/vfprintf):

> `int vsnprintf( char *restrict buffer, size_t bufsz, const
> char *restrict format, va_list vlist );`
>
> Writes the results to a character string buffer. At most bufsz - 1
> characters are written. The resulting character string will be
> terminated with a null character, unless bufsz is zero. If bufsz is
> zero, nothing is written and buffer may be a null pointer, [...]

This means that the `size` variable should be set to the total
available length of the buffer, not `length - 1`. Furthermore on the
return value the manual writes:

> however the return value (number of bytes that would be written not
> including the null terminator) is still calculated and returned.

This means that the `written` size returned doesn't count the
terminating `\0` in the length, so the value of `written` can be at
most `size - 1` before truncating the output. In other words a string
having`size = written + 1` would fit exactly in the buffer.

Also as `vsnprintf` will write the terminating `\0` there is no need
to explicitly do that.
2021-08-10 00:31:20 +02:00
pancake
305145d37f Fix #18963 - Fix regression when pressing SUPR key in the prompt 2021-08-03 12:44:36 +02:00
pancake
39993b39d7 Fix arrow handling after fixing mouse clicking glitches ##cons 2021-07-27 11:25:47 +02:00
pancake
67d43c4865 Fix memleaks in RCons.grep 2021-07-26 12:40:25 +02:00
pancake
324a0ff77d Fix glitches when clicking in the hud ##visual 2021-07-26 11:14:09 +02:00
pancake
857b1bfce1
Add scr.hist.filter to toggle the filtered history up/down search ##shell (#18913)
* Introduced in f6f7728cf4
2021-07-18 19:15:54 +02:00
pancake
ddb7842228
Improved reverse-search in command history ##shell 2021-07-18 18:37:23 +02:00
pancake
5f4c27f7f8
Initial implementation of ~.... for hudline prompt ##visual (#18861)
* Add new RCons.hud.line(_string) APIs
2021-06-28 00:13:15 +02:00
pancake
7c14bac05b
Add initial support for building r2 on WASI ##build 2021-06-20 17:14:43 +02:00
Sergi Àlvarez i Capilla
d20b1ac8de Fix memleak when allocation fails in RCons.input 2021-06-10 22:40:03 +02:00
pancake
f49ba3a948
Reduce stackframe usage in exchange for the heap for portability (#18824) 2021-06-10 16:13:38 +02:00
pancake
02b6d5d4f0 Fix RCons grep regression 2021-05-30 21:28:50 +02:00
Murphy
70d533b488
Fix grep cmd with neg (#18763) ##cons 2021-05-30 10:29:33 +02:00
pancake
d90510f951 Fix more recently introduced memleaks 2021-05-21 11:17:32 +02:00
pancake
3fd5ef358c
Add scr.optimize with experimental optimization ansi routine ##visual 2021-05-20 02:47:34 +02:00
pancake
374037a4d2 Fix warnings 2021-05-18 19:34:23 +02:00
pancake
df95c1e6c8 Rename defragger test to bobcrawl 2021-05-11 13:22:29 +02:00
pancake
57a9926b1f
Remove globals in cons/grep and random cleanup (#18671) 2021-05-10 11:56:08 +02:00
pancake
7ac5e17440
Fix double-prompt bug (#18650)
Co-authored-by: pancake <pancake@nopcode.org>
2021-05-03 09:46:03 +02:00
pancake
a2e28857b3 Handle aliased files in wff and wtf commands ##shell 2021-04-27 15:15:40 +02:00
pancake
69f18eecef Add guard check for r_cons_write 2021-04-27 15:15:40 +02:00
gogo2464
c093e68c48
Support null bytes in r_print_raw ##print 2021-04-27 13:27:29 +02:00
pancake
c217db6b8d Fix oob crash in 'pri' command ##print 2021-04-25 01:44:35 +02:00
Anthoine Bourgeois
a846d314dc Fix type "intgerp" -> "intgrep"
Signed-off-by: Anthoine Bourgeois <anthoine.bourgeois@gmail.com>
2021-04-24 21:58:09 +02:00
pancake
d1cd05a82d Fix oob read crash in dietline 2021-04-21 13:07:04 +02:00
pancake
b5e262a6b9 Linux debugger improvements 2021-04-19 17:28:42 -07:00
pancake
5f98cb2ff8
Add new theme named 'bluy' (#18588) ##cons
Co-authored-by: pancake <pancake@nopcode.org>
2021-04-16 19:29:22 +02:00
valdaarhun
b3941078a4 Fix Ctrl-J issue and remove redundant code in 'Ctrl-J' block ##cons 2021-04-10 23:46:33 +02:00
pancake
0a268e67a5 Implement pFX command exemplifying the use of r_sys_unxz() ##print
* Add support for xz decompression, that will be the base for future
  api handling internal implementations and system tools to decompress
  buffers in memory.
2021-04-10 23:13:27 +02:00
pancake
3862fb7e82
Rename r_cons_memcat to r_cons_write ##api (#18559) 2021-04-10 22:21:35 +02:00
pancake
3f70b40af0 Minor white theme fix 2021-04-09 17:34:42 +02:00
pancake
530c737d5d
Fix incorrect use of non-const strings and fiz zousans of warnings (#18544)
Co-authored-by: pancake <pancake@nopcode.org>
2021-04-06 12:45:19 +02:00
pancake
bd0b0be77b
Two coverity findings less 2021-03-30 00:56:04 +02:00
pancake
e3dfe63657 Fix a couple of warnings 2021-03-29 11:40:33 +02:00
pancake
8dc2894613 Add agfb for braile graphs ##visual
* Can be used from shell, panels or visual
* Added graph.zoom and graph.mini config variables
* Add r_str_size() api like r_cons_size()
* Add r_cons_pixel_flush()
2021-03-29 11:34:57 +02:00
pancake
625aca16e6 Implement RConsPixel and RBraile APIs ##cons 2021-03-29 11:34:57 +02:00