Browse Source

nano: update patches

android-5
Leonid Plyushch 5 years ago
parent
commit
c2756163d8
No known key found for this signature in database GPG Key ID: 45F2964132545795
  1. 24
      packages/nano/fix-hardcoded-paths.patch
  2. 12
      packages/nano/src-files.c.patch
  3. 12
      packages/nano/src-text.c.patch

24
packages/nano/fix-hardcoded-paths.patch

@ -0,0 +1,24 @@
diff -uNr nano-4.6/src/files.c nano-4.6.mod/src/files.c
--- nano-4.6/src/files.c 2019-11-29 12:12:07.000000000 +0200
+++ nano-4.6.mod/src/files.c 2019-12-02 03:07:18.821336573 +0200
@@ -1359,7 +1359,7 @@
tempdir = check_writable_directory(P_tmpdir);
if (tempdir == NULL)
- tempdir = copy_of("/tmp/");
+ tempdir = copy_of("@TERMUX_PREFIX@/tmp/");
tempfile_name = charealloc(tempdir, strlen(tempdir) + 12);
strcat(tempfile_name, "nano.XXXXXX");
diff -uNr nano-4.6/src/text.c nano-4.6.mod/src/text.c
--- nano-4.6/src/text.c 2019-11-29 12:12:07.000000000 +0200
+++ nano-4.6.mod/src/text.c 2019-12-02 03:07:48.974809217 +0200
@@ -962,7 +962,7 @@
const char *theshell = getenv("SHELL");
if (theshell == NULL)
- theshell = (char *)"/bin/sh";
+ theshell = (char *)"@TERMUX_PREFIX@/bin/sh";
/* Child: close the unused read end of the output pipe. */
close(from_fd[0]);

12
packages/nano/src-files.c.patch

@ -1,12 +0,0 @@
diff -uNr nano-3.2/src/files.c nano-3.2.mod/src/files.c
--- nano-3.2/src/files.c 2018-11-05 21:04:46.000000000 +0200
+++ nano-3.2.mod/src/files.c 2019-03-01 22:09:30.233108029 +0200
@@ -1439,7 +1439,7 @@
/* if P_tmpdir is NULL, use /tmp. */
if (full_tempdir == NULL)
- full_tempdir = mallocstrcpy(NULL, "/tmp/");
+ full_tempdir = mallocstrcpy(NULL, "@TERMUX_PREFIX@/tmp/");
full_tempdir = charealloc(full_tempdir, strlen(full_tempdir) + 12);
strcat(full_tempdir, "nano.XXXXXX");

12
packages/nano/src-text.c.patch

@ -1,12 +0,0 @@
diff -u -r ../nano-4.3/src/text.c ./src/text.c
--- ../nano-4.3/src/text.c 2019-06-11 11:55:31.000000000 +0000
+++ ./src/text.c 2019-06-23 21:36:28.191047000 +0000
@@ -956,7 +956,7 @@
/* Check which shell to use. If none is specified, use /bin/sh. */
shellenv = getenv("SHELL");
if (shellenv == NULL)
- shellenv = (char *)"/bin/sh";
+ shellenv = (char *)"@TERMUX_PREFIX@/bin/sh";
/* Fork a child process to run the command in. */
if ((pid_of_command = fork()) == 0) {
Loading…
Cancel
Save