On Wed, Jul 24, 2024 at 02:47:43PM +0200, Vincent Lefevre wrote:
> Package: w3m
> Version: 0.5.3+git20230121-2+b3
> Severity: normal
> 
> With -dump and large -cols, w3m inserts line breaks to make lines
> no longer than 1024 characters.

This is due to an undocumented arbitrary upper limit to the value of
-cols. fm.h defines MAXIMUM_COLS as 1024 and when parsing the command
line parameters the argument to -cols is checked against this limit - if
the argument is greater then MAXIMUM_COLS that will be used instead.

I appended a patch to drop that feature.

Thanks for your report!

From: Rene Kita <m...@rkta.de>
Date: Wed Jul 24 17:15:06 CEST 2024
Subject: Drop upper limit on COLS
Patch: patches/Drop-upper-limit-on-COLS.patch

The parameter -cols has an undocumented arbitrary limit of 1024. If a
number greater than that is passed as an argument the value will be set
to 1024 instead.

I don't see a reason for this behavior. Drop that limit and let the user
decide.

This fixes Debian BTS #1076944 and GH issue #286.
---
 fm.h   |    1 -
 main.c |    3 ---
 2 files changed, 4 deletions(-)

--- a/fm.h
+++ b/fm.h
@@ -103,7 +103,6 @@ void bzero(void *, int);
 #define LINELEN        256             /* Initial line length */
 #define PAGER_MAX_LINE 10000   /* Maximum line kept as pager */
 
-#define MAXIMUM_COLS 1024
 #define DEFAULT_COLS 80
 
 #ifdef USE_IMAGE
--- a/main.c
+++ b/main.c
@@ -692,9 +692,6 @@ main(int argc, char **argv)
                if (++i >= argc)
                    usage();
                COLS = atoi(argv[i]);
-               if (COLS > MAXIMUM_COLS) {
-                   COLS = MAXIMUM_COLS;
-               }
            }
            else if (!strcmp("-ppc", argv[i])) {
                double ppc;

Reply via email to