diff -u -r -U5 --no-dereference vifm-0.8/ChangeLog vifm-0.8.aarch64/ChangeLog
--- vifm-0.8/ChangeLog 2015-07-09 12:00:42.000000000 -0400
+++ vifm-0.8.aarch64/ChangeLog 2015-07-20 19:14:11.292314611 -0400
@@ -94,10 +94,13 @@
Fixed crash/leak on processing of background jobs. Thanks to Christian
Fillion (a.k.a. cfillion).
Fixed several memory access errors and leaks.
+ Work around compilation on systems where MAX_ARG_STRLEN is defined, but
+ unusable. Thanks to Marcin Juszkiewicz (a.k.a. hrw).
+
0.7.8 to 0.8-beta
Removed per-view last search pattern. Don't worry, you probably won't
even notice it: this doesn't affect regular use case, rather more exotic
one, which is hard to notice.
diff -u -r -U5 --no-dereference vifm-0.8/config.h.in vifm-0.8.aarch64/config.h.in
--- vifm-0.8/config.h.in 2015-07-09 12:01:49.000000000 -0400
+++ vifm-0.8.aarch64/config.h.in 2015-07-20 19:13:41.539062375 -0400
@@ -41,10 +41,13 @@
#undef HAVE_LINUX_BINFMTS_H
/* malloc.h header is available. */
#undef HAVE_MALLOC_H
+/* MAX_ARG_STRLEN is available. */
+#undef HAVE_MAX_ARG_STRLEN
+
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <mntent.h> header file. */
#undef HAVE_MNTENT_H
diff -u -r -U5 --no-dereference vifm-0.8/configure vifm-0.8.aarch64/configure
--- vifm-0.8/configure 2015-07-09 12:01:49.000000000 -0400
+++ vifm-0.8.aarch64/configure 2015-07-20 19:13:41.541062392 -0400
@@ -6313,10 +6313,27 @@
fi
done
+if test "$ac_cv_header_sys_user_h" = yes -a "$ac_cv_header_linux_binfmts_h" = yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <linux/binfmts.h>
+ #include <sys/user.h>
+ int main() { (void)MAX_ARG_STRLEN; return 0; }
+
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_MAX_ARG_STRLEN 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default"
if test "x$ac_cv_type_uid_t" = xyes; then :
fi
diff -u -r -U5 --no-dereference vifm-0.8/configure.ac vifm-0.8.aarch64/configure.ac
--- vifm-0.8/configure.ac 2015-07-09 12:00:42.000000000 -0400
+++ vifm-0.8.aarch64/configure.ac 2015-07-20 19:13:41.542062401 -0400
@@ -72,10 +72,21 @@
AC_CHECK_HEADER([unistd.h], [], [AC_MSG_ERROR([unistd.h header not found.])])
AC_CHECK_HEADER([wchar.h], [], [AC_MSG_ERROR([wchar.h header not found.])])
AC_CHECK_HEADER([wctype.h], [], [AC_MSG_ERROR([wctype.h header not found.])])
dnl Headers required for breaking too long command-lines.
AC_CHECK_HEADERS([sys/user.h linux/binfmts.h])
+if test "$ac_cv_header_sys_user_h" = yes -a "$ac_cv_header_linux_binfmts_h" = yes; then
+ AC_COMPILE_IFELSE(
+ AC_LANG_SOURCE(
+ [[
+ #include <linux/binfmts.h>
+ #include <sys/user.h>
+ int main() { (void)MAX_ARG_STRLEN; return 0; }
+ ]]
+ ),
+ [AC_DEFINE([HAVE_MAX_ARG_STRLEN], [1], [MAX_ARG_STRLEN is available.])])
+fi
dnl Check for various system types.
AC_CHECK_TYPE([uid_t])
AC_CHECK_TYPE([gid_t])
AC_CHECK_TYPE([mode_t])
diff -u -r -U5 --no-dereference vifm-0.8/src/utils/utils_nix.c vifm-0.8.aarch64/src/utils/utils_nix.c
--- vifm-0.8/src/utils/utils_nix.c 2015-07-09 12:00:42.000000000 -0400
+++ vifm-0.8.aarch64/src/utils/utils_nix.c 2015-07-20 19:13:41.542062401 -0400
@@ -18,11 +18,12 @@
*/
#include "utils_nix.h"
#include "utils_int.h"
-#if defined (HAVE_LINUX_BINFMTS_H) && defined (HAVE_SYS_USER_H)
+#ifdef HAVE_MAX_ARG_STRLEN
+/* MAX_ARG_STRLEN is the only reason we need these headers. */
#include <linux/binfmts.h>
#include <sys/user.h>
#endif
#include <sys/select.h> /* select() FD_SET FD_ZERO */
@@ -258,11 +259,11 @@
}
char **
make_execv_array(char shell[], char cmd[])
{
-#ifdef MAX_ARG_STRLEN
+#ifdef HAVE_MAX_ARG_STRLEN
/* Don't use maximum length, leave some room or commands fail to run. */
const size_t safe_arg_len = MIN(MAX_ARG_STRLEN, MAX_ARG_STRLEN - 4096U);
const size_t npieces = DIV_ROUND_UP(strlen(cmd), safe_arg_len);
#else
/* Actual value doesn't matter in this case. */
diff -u -r -U5 --no-dereference vifm-0.8/THANKS vifm-0.8.aarch64/THANKS
--- vifm-0.8/THANKS 2015-07-09 12:00:42.000000000 -0400
+++ vifm-0.8.aarch64/THANKS 2015-07-20 19:13:41.539062375 -0400
@@ -51,10 +51,11 @@
Larry Hynes (larryhynes)
lcj
Lomov Vladimir (lomov_vl)
lyuts
MadMaverick9
+Marcin Juszkiewicz (hrw)
Martin Fischer
Marton Balazs (balmar)
Merovius
Michael Kopp
Michael Maddern (madders)