termux-packages/packages/radare2/fix-bin-sh-path.patch

31 lines
1.1 KiB
Diff
Raw Normal View History

2021-08-22 06:15:19 +02:00
diff -ruN radare2-5.4.0/libr/include/r_util/r_file.h radare2-5.4.0.mod/libr/include/r_util/r_file.h
--- radare2-5.4.0/libr/include/r_util/r_file.h 2021-08-20 09:25:10.617372300 -0300
+++ radare2-5.4.0.mod/libr/include/r_util/r_file.h 2021-08-20 10:48:00.361368745 -0300
@@ -8,7 +8,7 @@
#include <r_util/r_mem.h>
#ifndef SHELL_PATH
-#define SHELL_PATH "/bin/sh"
+#define SHELL_PATH "@TERMUX_PREFIX@/bin/sh"
2021-05-06 14:34:58 +02:00
#endif
#ifndef TERMUX_PREFIX
2021-08-22 06:15:19 +02:00
diff -ruN radare2-5.4.0/libr/socket/run.c radare2-5.4.0.mod/libr/socket/run.c
--- radare2-5.4.0/libr/socket/run.c 2021-08-20 09:25:10.705372300 -0300
+++ radare2-5.4.0.mod/libr/socket/run.c 2021-08-20 10:46:52.221368794 -0300
2021-08-22 06:15:19 +02:00
@@ -1205,12 +1205,8 @@ R_API int r_run_start(RRunProfile *p) {
2021-08-21 09:04:07 +02:00
#if __UNIX__
close (0);
close (1);
- char *shell_env = r_sys_getenv ("SHELL");
- char *bin_sh = (R_STR_ISNOTEMPTY (shell_env) && r_file_exists (shell_env))
- ? shell_env
- : r_file_path ("sh");
- // Honor $SHELL ?
- if (R_STR_ISNOTEMPTY (bin_sh)) {
2021-08-21 09:12:40 +02:00
+ char *bin_sh = r_file_binsh ();
2021-08-22 06:15:19 +02:00
+ if (bin_sh != NULL) {
exit (execl (bin_sh, bin_sh, "-c", p->_system, NULL));
} else {
exit (r_sys_cmd (p->_system));