diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-20 18:58:48 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-20 19:05:14 -0800 |
commit | 73aecaafd3e4b80c57a2549e399b7f0b769bcf5e (patch) | |
tree | 1d514f24afc9ab5014d6a3a0d3d66ed08eea6ef9 | |
parent | 204e4512a11cac5e906a0c8f422ef7e51fa559af (diff) |
configure: Use AC_SYS_LARGEFILE to enable large file support
While xman can't handle files more than 2gb in size, due to libXt
API limits, it can handle files with large inodes. (Not that any
man page should ever be more than even 1mb in size in reality.)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | ScrollByL.c | 8 | ||||
-rw-r--r-- | configure.ac | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/ScrollByL.c b/ScrollByL.c index 383acde..b2dc4f8 100644 --- a/ScrollByL.c +++ b/ScrollByL.c @@ -32,6 +32,7 @@ from the X Consortium. #include <ctype.h> #include <X11/Xos.h> #include <stdlib.h> +#include <limits.h> #include <X11/IntrinsicP.h> #include <sys/stat.h> /* depends on IntrinsicP.h */ @@ -801,6 +802,13 @@ LoadFile(Widget w) "SBLW LoadFile: Failure in fstat."); /* + * The XtMalloc below is limited to a size of int by the libXt API. + */ + if (fileinfo.st_size >= INT_MAX) + XtAppError(XtWidgetToApplicationContext(w), + "SBLW LoadFile: File too large."); + +/* * Allocate a space for a list of pointer to the beginning of each line. */ diff --git a/configure.ac b/configure.ac index 4023c73..510be65 100644 --- a/configure.ac +++ b/configure.ac @@ -49,6 +49,10 @@ if test x"$MANDB" = xyes; then AC_DEFINE([HAVE_MANDB], 1, [Define if the man implementation is man-db]) fi +# Checks for typedefs, structures, and compiler characteristics. +AC_SYS_LARGEFILE + +# Checks for library functions. AC_CHECK_FUNCS([mkstemp]) AC_ARG_WITH(helpdir, |