[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Retrieving images with 'query' and 'fragment' uri parts [PATCH]



The attached patch, changing just a single character, fixes a problem I
see for retrieving images when the URL includes a 'query' or 'fragment'
component[1]. I noticed this when trying to display this old photo of me
trying to "blend in" and not be noticed[2].


[1] scheme:[//[user[:password]@]host[:port]][/path][?query][#fragment]

[2] https://i.ytimg.com/vi/sAAhIpppP8E/hqdefault.jpg?sqp=-oaymwEXCPYBEIoBSFryq4qpAwkIARUAAIhCGAE=&rs=AOn4CLBSC818yacO3UDuN8wIUmaUeYdg1g
-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0
--- /home/optimum/w3m.el	2018-02-14 09:41:07.793510153 -0500
+++ w3m.el	2018-02-14 09:41:11.309774070 -0500
@@ -7363,7 +7363,7 @@
 					  w3m-external-view-temp-directory)))
 		   suffix)
 		(setq suffix (file-name-nondirectory url))
-		(when (string-match "\\.[a-zA-Z0-9]+$" suffix)
+		(when (string-match "\\.[a-zA-Z0-9]+" suffix)
 		  (setq suffix (match-string 0 suffix))
 		  (when (< (length suffix) 5)
 		    (setq file (concat file suffix))))
--- ChangeLog	2018-02-14 09:45:15.936134672 -0500
+++ /home/optimum/ChangeLog	2018-02-14 09:45:02.471124046 -0500
@@ -1,3 +1,8 @@
+2018-02-14  Boruch Baum  <boruch_baum@xxxxxxx>
+
+	* w3m.el (w3m-external-view): Fix regex for url's that contain uri 'query'
+	and or 'fragment' components.
+
 2018-02-05  Katsumi Yamaoka  <yamaoka@xxxxxxx>
 
 	* w3m-util.el (w3m-string-match-url-components)