-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add interactive mode to r2r #16466
Add interactive mode to r2r #16466
Conversation
@@ -387,6 +397,19 @@ int main(int argc, char **argv) { | |||
} | |||
r_pvector_clear (&workers); | |||
|
|||
ut64 seconds = (r_sys_now () - time_start) / 1000000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the constants!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you wrote that code in the first place :-P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should do that change in another pr, where we move some stuff to r_util.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yay
binr/r2r/r2r.c
Outdated
if (!test->cmds.value) { | ||
return; | ||
} | ||
char *name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe worth = NULL; in theory when returning -1 name will not be initialized, so the free below it will crash
binr/r2r/r2r.c
Outdated
eprintf ("Failed to open tmp file\n"); | ||
return; | ||
} | ||
write (fd, test->cmds.value, strlen (test->cmds.value)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(void) the return on purpose or check the return value and report proper error in case it cant write
binr/r2r/r2r.c
Outdated
} | ||
size_t len = strlen (trimmed); | ||
// strip all trailing newlines | ||
while (len && trimmed[len - 1] == '\n') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that wont work on CRLF files, also we have r_str apis for that
binr/r2r/r2r.c
Outdated
// if it's multiline we want exactly one trailing newline | ||
if (strchr (trimmed, '\n')) { | ||
char *tmp = newcmds; | ||
newcmds = r_str_newf ("%s\n", trimmed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newcmds can be null and then strchr will crash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
manpage not updated, neither the oneline help message
there are cornflakes in r2r.c now pls fix too |
Cornflakes are eaten and comets are addressed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now lgtm
The final nail in r2r.js' coffin.
Fixes #15662