From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adolf Belka To: development@lists.ipfire.org Subject: Re: [PATCH] Remove space after every 80 characters in WebGUI "Logs/System Logs". Date: Mon, 05 Aug 2024 10:01:39 +0200 Message-ID: <8c2b7c07-d2ec-4b43-a852-b606759d34bc@ipfire.org> In-Reply-To: <20240803223627.123287-1-stephen@firemypi.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0315694558696363966==" List-Id: --===============0315694558696363966== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Reviewed-by: Adolf Belka Hi Stephen, Welcome to the list and thanks for the patch. On 04/08/2024 00:36, Stephen Cuka wrote: > Signed-off-by: Stephen Cuka > --- > > This patch addresses an issue with the IPFire WebGUI adding a space > after every 80 characters in the display of long log entries on the > "Logs/System Logs" page. (Bug 13735) > > The patch removes the "very basic breaking of lines..." code and replaces it > with a direct copy of the log entry $data to the display output variable $d. > > html/cgi-bin/logs.cgi/log.dat | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/html/cgi-bin/logs.cgi/log.dat b/html/cgi-bin/logs.cgi/log.dat > index 01c382a0d..ce7de0178 100644 > --- a/html/cgi-bin/logs.cgi/log.dat > +++ b/html/cgi-bin/logs.cgi/log.dat > @@ -412,11 +412,12 @@ foreach $_ (@log) > $sec = 'kernel'; > $data = $2.': '.$data; > } > - my $d = substr ($data,0,80); > - while (length($data)>80){ #very basic breaking of lines... > - $data = substr ($data,80); #permit correct display in table cell > - $d .= ' ' . substr ($data,0,80); > - } Removing these lines seems fine to me. The code looks to be adding a space instead of doing an actual line break. The text is also auto word wrapped in the text box in the browser anyway. > + #my $d = substr ($data,0,80); > + #while (length($data)>80){ #very basic breaking of lines... > + # $data = substr ($data,80); #permit correct display in table cell > + # $d .= ' ' . substr ($data,0,80); > + #} My only question is why you left all the removed lines in place as comments, rather than just removing them completely? > + my $d = $data; #don't break lines for display I think you could also save a line by not having this line but changing the earlier line of $data = $2.': '.$data; to my $d = $2.': '.$data; Regards, Adolf > my $col=""; > > if ($lines % 2) { -- Sent from my laptop --===============0315694558696363966==--