Bug#1031413: Slow backward search in long lines

2023-02-16 Thread Robert Alm Nilsson
Package: w3m
Version: 0.5.3+git20230121-2
Severity: minor

When I search backward in w3m by using the '?' command, the program
freezes with high CPU usage for a bit of time if the found text is near
the end of a very long line.

How to reproduce the issue:

printf 'first line\nsecond line is %*s a long line\nthird line\n' 1 '' 
> test.txt
w3m test.txt

Run those commands and then go to the third line and search backward for
the word "line".  Now the program will freeze for a second.  If you
increase the number 1, the freezing time will increase with the
square of that number.

The reason that this happens when searching backward but not forward is
that in the function `backwardSearch` in search.c there is this loop:

while (regexMatch(...) == 1)

but in `forwardSearch` it's just an if statement:

if (regexMatch(...) == 1)

That means that when searching backward, we do one regexMatch for each
character on the line and since the regexMatch itself already searches
through the characters, that's pretty wasteful and that's what gives us
the squared times.

It should be possible to change this so that an if statement is used in
`backwardSearch` just like in `forwardSearch`.  Maybe there could be two
versions of `regexMatch` where one of them searches backwards or just
returns the last match instead of the first one so that we don't have to
call it in a loop.



Bug#1020215: w3m interprets when not in but in

2023-01-06 Thread Robert Alm Nilsson
After using my version of w3m every day since I posted this, the only
problem I have noticed on a few pages is that it doesn't handle titles
directly under html tags, so this doesn't work:

Hello

I don't know if we want to care about that case and I don't think it's
valid HTML but I wanted to let you know.



Bug#1020215: (no subject)

2022-09-18 Thread Robert Alm Nilsson
Typo in my patch, it should be "if (obuf->flag & RB_HEAD)", not "if
(obuf->flag | RB_HEAD)"



Bug#1020215: w3m interprets when not in but in

2022-09-18 Thread Robert Alm Nilsson
Package: w3m
Version: 0.5.3+git20220429-1+b1

When opening a page in w3m that contains an  element that contains
a  tag, w3m will use that svg title as the page title.

An example of a page to demonstrate this problem is github.com.  The
real title of github.com is "GitHub: Where the world builds software ยท
GitHub" but w3m displays the title "Go" (or the name of any other
language) because the front page contains svg images for different
programming languages with title tags.

Here is a patch I made.  I don't know if this is the most optimal way to
solve this but it seems to work in practice and I will use it locally
until there in an upstream fix.

commit f41db326e73fde685c1d0b79e46beec56336995e
Author: Robert Alm Nilsson 
Date:   Sun Sep 18 09:51:29 2022 +0200

Only read title when in head

Before this change, it was possible that w3m would interpret a title tag
under e.g. an svg tag as the page title.

diff --git a/file.c b/file.c
index 9704cea..8e8b280 100644
--- a/file.c
+++ b/file.c
@@ -4816,19 +4816,23 @@ HTMLtagproc1(struct parsed_tag *tag, struct 
html_feed_environ *h_env)
/* obuf->flag |= RB_IGNORE_P; */
return 1;
 case HTML_TITLE:
-   close_anchor(h_env, obuf);
-   process_title(tag);
-   obuf->flag |= RB_TITLE;
-   obuf->end_tag = HTML_N_TITLE;
+   if (obuf->flag & RB_HEAD) {
+   close_anchor(h_env, obuf);
+   process_title(tag);
+   obuf->flag |= RB_TITLE;
+   obuf->end_tag = HTML_N_TITLE;
+   }
return 1;
 case HTML_N_TITLE:
-   if (!(obuf->flag & RB_TITLE))
-   return 1;
-   obuf->flag &= ~RB_TITLE;
-   obuf->end_tag = 0;
-   tmp = process_n_title(tag);
-   if (tmp)
-   HTMLlineproc1(tmp->ptr, h_env);
+   if (obuf->flag | RB_HEAD) {
+   if (!(obuf->flag & RB_TITLE))
+   return 1;
+   obuf->flag &= ~RB_TITLE;
+   obuf->end_tag = 0;
+   tmp = process_n_title(tag);
+   if (tmp)
+   HTMLlineproc1(tmp->ptr, h_env);
+   }
return 1;
 case HTML_TITLE_ALT:
if (parsedtag_get_value(tag, ATTR_TITLE, &p))
@@ -5523,9 +5527,13 @@ HTMLtagproc1(struct parsed_tag *tag, struct 
html_feed_environ *h_env)
}
}
 case HTML_N_HEAD:
+   obuf->flag &= ~RB_HEAD;
if (obuf->flag & RB_TITLE)
HTMLlineproc1("", h_env);
+   return 1;
 case HTML_HEAD:
+   obuf->flag |= RB_HEAD;
+   return 1;
 case HTML_N_BODY:
return 1;
 default:
diff --git a/fm.h b/fm.h
index 25857f8..9e12b42 100644
--- a/fm.h
+++ b/fm.h
@@ -675,6 +675,7 @@ struct readbuffer {
 #define RB_DEL 0x10
 #define RB_S   0x20
 #define RB_HTML5   0x40
+#define RB_HEAD0x80
 
 #define RB_GET_ALIGN(obuf) ((obuf)->flag&RB_ALIGN)
 #define RB_SET_ALIGN(obuf,align) do{(obuf)->flag &= ~RB_ALIGN; (obuf)->flag |= 
(align); }while(0)



Bug#795795: bash: Alias expansion in filename

2015-08-16 Thread Robert Alm Nilsson
Package: bash
Version: 4.3-13
Severity: normal
Tags: upstream

Dear Maintainer,

If you have two redirections before the command or if you don't have a
command, bash will do alias expansion on the second filename and treat
the first word as a filename and the second word as a command.  This
example shows it:

/tmp/a$ ls -a
..  ..
/tmp/a$ alias foo="abc def"
/tmp/a$ foo
bash: abc: command not found
/tmp/a$ foo
bash: def: command not found
/tmp/a$ ls -a
..  ..  abc
/tmp/a$ file abc
abc: empty




-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (900, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.0.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=sv_SE.UTF-8, LC_CTYPE=sv_SE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages bash depends on:
ii  base-files   9.2
ii  dash 0.5.7-4+b1
ii  debianutils  4.5.1
ii  libc62.19-19
ii  libncurses5  5.9+20150516-2
ii  libtinfo55.9+20150516-2

Versions of packages bash recommends:
ii  bash-completion  1:2.1-4.1

Versions of packages bash suggests:
pn  bash-doc  

-- no debconf information



Bug#779058: pdfsam: Null pointer exception when starting pdfsam

2015-02-23 Thread Robert Alm Nilsson
Package: pdfsam
Version: 1.1.4-2
Severity: important

Dear Maintainer, when I start pdfsam I get this output in the console
while there is a graphical window containing the same information and
a button to exit the program.  I just installed it and then tried to
start it by typing "pdfsam".

This is the output:

=

 pdfsam

  JAVA: /usr/lib/jvm/java-7-openjdk-amd64/bin/java

  JAVA_OPTS: -Xmx256m

  CLASSPATH: 
/usr/share/pdfsam/pdfsam-1.1.4.jar:/usr/share/pdfsam/lib/dom4j.jar:/usr/share/pdfsam/lib/emp4j-1.0.1.jar:/usr/share/pdfsam/lib/itext.jar:/usr/share/pdfsam/lib/jaxen.jar:/usr/share/pdfsam/lib/log4j-1.2.jar:/usr/share/pdfsam/lib/looks.jar:/usr/share/pdfsam/lib/pdfsam-console-2.0.6e.jar:/usr/share/pdfsam/lib/pdfsam-jcmdline-1.0.3.jar:/usr/share/pdfsam/lib/pdfsam-langpack.jar

=

22:38:07,690 INFO  JMainFrame  Starting PDF Split and Merge basic Ver. 1.1.4
22:38:07,802 INFO  Configuration  Loading configuration..
22:38:07,809 WARN  Configuration  Unable to find configuration file into 
/usr/share/pdfsam
22:38:07,810 INFO  Configuration  Looking for configuration file into 
/home/robert
22:38:07,813 FATAL Configuration  
org.pdfsam.guiclient.exceptions.ConfigurationException: Unable to find 
configuration file.
22:38:07,823 FATAL GuiClient  Error:
java.lang.NullPointerException
at org.pdfsam.i18n.GettextResource.gettext(Unknown Source)
at 
org.pdfsam.guiclient.gui.frames.JMainFrame.initialize(JMainFrame.java:202)
at org.pdfsam.guiclient.gui.frames.JMainFrame.(JMainFrame.java:92)
at org.pdfsam.guiclient.GuiClient.main(GuiClient.java:61)





-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=sv_SE.UTF-8, LC_CTYPE=sv_SE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages pdfsam depends on:
ii  java-wrappers  0.1.28
ii  libcommons-httpclient-java 3.1-10.2
ii  libdom4j-java  1.6.1+dfsg.3-2
ii  libhttpclient-java 4.3.5-2
ii  libitext-java  2.1.7-9
ii  libjaxen-java  1.1.6-1
ii  libjgoodies-looks-java 2.5.2-3
ii  liblog4j1.2-java   1.2.17-5
ii  openjdk-7-jre [java2-runtime]  7u75-2.5.4-2

pdfsam recommends no packages.

pdfsam suggests no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#767006: wswedish: "gemensammma" and "internnummmer" misspellings

2014-10-27 Thread Robert Alm Nilsson
Package: wswedish
Version: 1.4.5-2.1
Severity: minor
Tags: upstream

In /usr/share/dict/swedish
I think it should be "gemensamma" and "internnummer". (two 'm' instead of three)

-- System Information:
Debian Release: jessie/sid
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=sv_SE.UTF-8, LC_CTYPE=sv_SE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages wswedish depends on:
ii  debconf [debconf-2.0]  1.5.53
ii  dictionaries-common1.23.14

wswedish recommends no packages.

wswedish suggests no packages.

-- debconf information:
  wswedish/languages: svenska (Swedish)
  shared/packages-wordlist:


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org