4 changed files with 37 additions and 45 deletions
@ -0,0 +1,35 @@ |
|||||
|
Following compiler warning: |
||||
|
|
||||
|
/home/fornwall/termux/mc/src/lib/vfs/interface.c: In function 'mc_open': |
||||
|
/home/fornwall/termux/mc/src/lib/vfs/interface.c:203:28: warning: 'mode_t' is promoted to 'int' when passed through '...' |
||||
|
mode = va_arg (ap, mode_t); |
||||
|
^ |
||||
|
/home/fornwall/termux/mc/src/lib/vfs/interface.c:203:28: note: (so you should pass 'int' not 'mode_t' to 'va_arg') |
||||
|
/home/fornwall/termux/mc/src/lib/vfs/interface.c:203:28: note: if this code is reached, the program will abort |
||||
|
|
||||
|
which causes crash on arm devices due to mode_t being unsigned int. |
||||
|
|
||||
|
diff -u -r ../mc-4.8.16/lib/vfs/interface.c ./lib/vfs/interface.c
|
||||
|
--- ../mc-4.8.16/lib/vfs/interface.c 2016-03-12 10:45:47.000000000 -0500
|
||||
|
+++ ./lib/vfs/interface.c 2016-03-14 22:03:41.417524612 -0400
|
||||
|
@@ -200,7 +200,7 @@
|
||||
|
{ |
||||
|
va_list ap; |
||||
|
va_start (ap, flags); |
||||
|
- mode = va_arg (ap, mode_t);
|
||||
|
+ mode = (mode_t) va_arg (ap, unsigned int);
|
||||
|
va_end (ap); |
||||
|
} |
||||
|
|
||||
|
diff -u -r ../mc-4.8.16/src/editor/editcmd.c ./src/editor/editcmd.c
|
||||
|
--- ../mc-4.8.16/src/editor/editcmd.c 2016-03-12 10:45:47.000000000 -0500
|
||||
|
+++ ./src/editor/editcmd.c 2016-03-14 22:03:02.094128021 -0400
|
||||
|
@@ -301,7 +301,7 @@
|
||||
|
(void) mc_chown (savename_vpath, edit->stat1.st_uid, edit->stat1.st_gid); |
||||
|
(void) mc_chmod (savename_vpath, edit->stat1.st_mode); |
||||
|
|
||||
|
- fd = mc_open (savename_vpath, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, edit->stat1.st_mode);
|
||||
|
+ fd = mc_open (savename_vpath, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, (unsigned int) edit->stat1.st_mode);
|
||||
|
if (fd == -1) |
||||
|
goto error_save; |
||||
|
|
@ -1,31 +0,0 @@ |
|||||
diff -u -r ../mc-4.8.11/lib/strutil/strutil.c ./lib/strutil/strutil.c
|
|
||||
--- ../mc-4.8.11/lib/strutil/strutil.c 2013-11-29 19:27:07.000000000 +0100
|
|
||||
+++ ./lib/strutil/strutil.c 2014-02-07 01:55:53.000000000 +0100
|
|
||||
@@ -26,7 +26,9 @@
|
|
||||
#include <config.h> |
|
||||
|
|
||||
#include <stdlib.h> |
|
||||
+#ifndef __ANDROID__
|
|
||||
#include <langinfo.h> |
|
||||
+#endif
|
|
||||
#include <string.h> |
|
||||
#include <errno.h> |
|
||||
|
|
||||
@@ -306,6 +308,9 @@
|
|
||||
const char * |
|
||||
str_detect_termencoding (void) |
|
||||
{ |
|
||||
+#ifdef __ANDROID__
|
|
||||
+ return "utf-8";
|
|
||||
+#else
|
|
||||
if (term_encoding == NULL) |
|
||||
{ |
|
||||
/* On Linux, nl_langinfo (CODESET) returns upper case UTF-8 whether the LANG is set |
|
||||
@@ -316,6 +321,7 @@
|
|
||||
} |
|
||||
|
|
||||
return term_encoding; |
|
||||
+#endif
|
|
||||
} |
|
||||
|
|
||||
static int |
|
@ -1,13 +0,0 @@ |
|||||
diff -u -r ../mc-4.8.11/lib/strutil/strutilutf8.c ./lib/strutil/strutilutf8.c
|
|
||||
--- ../mc-4.8.11/lib/strutil/strutilutf8.c 2013-11-29 19:27:07.000000000 +0100
|
|
||||
+++ ./lib/strutil/strutilutf8.c 2014-02-07 01:56:32.000000000 +0100
|
|
||||
@@ -26,7 +26,9 @@
|
|
||||
#include <config.h> |
|
||||
|
|
||||
#include <stdlib.h> |
|
||||
+#ifndef __ANDROID__
|
|
||||
#include <langinfo.h> |
|
||||
+#endif
|
|
||||
#include <string.h> |
|
||||
|
|
||||
#include "lib/global.h" |
|
Loading…
Reference in new issue