1 diff -u -r ../isync-1.3.0.orig/src/compat/config.c ./src/compat/config.c
2 --- ../isync-1.3.0.orig/src/compat/config.c 2017-10-01 17:42:35.000000000 +0900
3 +++ ./src/compat/config.c 2018-02-06 08:41:15.750006264 +0900
6 box->local_store_path = my_strndup( path, pl );
7 /* derive a suitable name */
8 - if (!strcmp( box->local_store_path, "/var/mail/" ) || !strcmp( box->local_store_path, "/var/spool/mail/" )) {
9 + if (!strcmp( box->local_store_path, "@TERMUX_PREFIX@/var/mail/" ) || !strcmp( box->local_store_path, "@TERMUX_PREFIX@/var/spool/mail/" )) {
10 local_store = nfstrdup( "spool" );
11 } else if (!strcmp( box->local_store_path, "~/" )) {
12 local_store = nfstrdup( "home" );
13 diff -u -r ../isync-1.3.0.orig/src/compat/main.c ./src/compat/main.c
14 --- ../isync-1.3.0.orig/src/compat/main.c 2017-10-01 17:42:35.000000000 +0900
15 +++ ./src/compat/main.c 2018-02-06 08:41:15.750006264 +0900
20 - strcpy( path2, "/tmp/mbsyncrcXXXXXX" );
21 + strcpy( path2, "@TERMUX_PREFIX@/tmp/mbsyncrcXXXXXX" );
22 if ((fd = mkstemp( path2 )) < 0) {
23 sys_error( "Error: cannot create temporary config file" );
25 diff -u -r ../isync-1.3.0.orig/src/drv_imap.c ./src/drv_imap.c
26 --- ../isync-1.3.0.orig/src/drv_imap.c 2017-10-01 17:42:35.000000000 +0900
27 +++ ./src/drv_imap.c 2018-02-06 08:41:15.750006264 +0900
33 +#include <readline/readline.h>
36 # include <sasl/sasl.h>
37 # include <sasl/saslutil.h>
43 +static char* getpass(const char *prompt) {
44 + struct termios term_old, term_new;
47 + /* Turn echoing off and fail if we can't. */
48 + if (tcgetattr (0, &term_old) != 0) {
52 + term_new = term_old;
53 + term_new.c_lflag &= ~ECHO;
55 + if (tcsetattr (0, TCSAFLUSH, &term_new) != 0) {
59 + /* Read the password. */
60 + char *password = readline(prompt);
62 + /* Restore terminal. */
63 + (void) tcsetattr (0, TCSAFLUSH, &term_old);
70 new_imap_cmd( int size )
72 diff -u -r ../isync-1.3.0.orig/src/socket.c ./src/socket.c
73 --- ../isync-1.3.0.orig/src/socket.c 2017-10-01 17:42:35.000000000 +0900
74 +++ ./src/socket.c 2018-02-06 08:41:15.750006264 +0900
79 - execl( "/bin/sh", "sh", "-c", conf->tunnel, (char *)0 );
80 + execl( "@TERMUX_PREFIX@/bin/sh", "sh", "-c", conf->tunnel, (char *)0 );