summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Elias Pipping <pipping@exherbo.org> 2014-02-23 14:25:31 +0100
committerAvatar Elias Pipping <pipping@exherbo.org> 2014-02-23 14:29:57 +0100
commit2adebe3f55e285db5aa960de64d540a2e4b6f6a9 (patch)
treee435d9359337572e90faa8e6a327a5afd7fc5896
parenteb799105eef87e6c86c1e6b9a648bf8f142dbe8f (diff)
downloadlisp-2adebe3f55e285db5aa960de64d540a2e4b6f6a9.tar.gz
lisp-2adebe3f55e285db5aa960de64d540a2e4b6f6a9.tar.xz
stumpwm: Updated patch submitted upstream
-rw-r--r--packages/x11-wm/stumpwm/files/stumpwm-printing.patch54
1 files changed, 29 insertions, 25 deletions
diff --git a/packages/x11-wm/stumpwm/files/stumpwm-printing.patch b/packages/x11-wm/stumpwm/files/stumpwm-printing.patch
index bea70b1..5c0d6af 100644
--- a/packages/x11-wm/stumpwm/files/stumpwm-printing.patch
+++ b/packages/x11-wm/stumpwm/files/stumpwm-printing.patch
@@ -1,10 +1,10 @@
Source: Elias Pipping <pipping@exherbo.org>
-Upstream: no (pasted on irc)
+Upstream: https://github.com/sabetts/stumpwm/pull/67
Reason: A window whose title contains the string ^\ cannot have it printed
-From 56b478ae447ca8bf4b0d6d80e10fe00fb1c8d95b Mon Sep 17 00:00:00 2001
+From 17bb444d3a973ab4f64b42d46aa513f18898b212 Mon Sep 17 00:00:00 2001
From: Elias Pipping <pipping@exherbo.org>
-Date: Sat, 5 Jan 2013 22:03:53 +0100
+Date: Sun, 23 Feb 2014 13:45:50 +0100
Subject: [PATCH 1/2] Typo
---
@@ -12,10 +12,10 @@ Subject: [PATCH 1/2] Typo
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/primitives.lisp b/primitives.lisp
-index 50d062e..3d42012 100644
+index 569a789..1079341 100644
--- a/primitives.lisp
+++ b/primitives.lisp
-@@ -753,7 +753,7 @@ do:
+@@ -784,7 +784,7 @@ do:
(format t "%~a~@[~a~]" len from-left-p)
(let* ((fmt (cadr (assoc (car cur) fmt-alist :test 'char=)))
(str (cond (fmt
@@ -25,53 +25,57 @@ index 50d062e..3d42012 100644
((char= (car cur) #\%)
(string #\%))
--
-1.8.0.3
+1.8.5.4
-From db588e4393567b3016c2be57511d35d3c01e4e46 Mon Sep 17 00:00:00 2001
+From ac062001b0a15ce9d708ebbe787a6493f53a9298 Mon Sep 17 00:00:00 2001
From: Elias Pipping <pipping@exherbo.org>
-Date: Sat, 5 Jan 2013 22:08:11 +0100
-Subject: [PATCH 2/2] Escape window information before printing
+Date: Sun, 23 Feb 2014 14:02:51 +0100
+Subject: [PATCH 2/2] Escape window titles before `format-expand`ing them
-Otherwise, a window with a title like ^\ will wreak havoc when
-echo-string-list fails to parse it.
+To reproduce the bug addressed by this commit:
+
+ (1) run `xterm -T '^\'` on the command line
+ (2) call the stumpwm command `echo-windows`
+
+Prior to this patch, an error would occur
---
- primitives.lisp | 16 ++++++++++++++--
- 1 file changed, 14 insertions(+), 2 deletions(-)
+ primitives.lisp | 16 +++++++++++++---
+ 1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/primitives.lisp b/primitives.lisp
-index 3d42012..88b45d4 100644
+index 1079341..6e388cf 100644
--- a/primitives.lisp
+++ b/primitives.lisp
-@@ -732,6 +732,15 @@ do:
+@@ -763,6 +763,16 @@ do:
;;;
;;; formatting routines
-+(defun escape-string (str)
++(defun escape-caret (str)
++ "Escape carets by doubling them"
+ (let (buf)
+ (map nil #'(lambda (ch)
+ (push ch buf)
+ (when (char= ch #\^)
-+ (push ch buf)))
++ (push #\^ buf)))
+ str)
+ (coerce (reverse buf) 'string)))
+
(defun format-expand (fmt-alist fmt &rest args)
(let* ((chars (coerce fmt 'list))
(output "")
-@@ -753,8 +762,11 @@ do:
+@@ -783,9 +793,9 @@ do:
+ (if (null cur)
(format t "%~a~@[~a~]" len from-left-p)
(let* ((fmt (cadr (assoc (car cur) fmt-alist :test 'char=)))
- (str (cond (fmt
+- (str (cond (fmt
- ;; it can return any type, not just a string.
- (format nil "~a" (apply fmt args)))
-+ ;; Any sequence that could be interpreted as
-+ ;; a colorisation directive is escaped here
-+ (escape-string
-+ ;; it can return any type, not just a string.
-+ (format nil "~a" (apply fmt args))))
++ (str (cond (fmt (escape-caret
++ ;; it can return any type, not just a string.
++ (format nil "~a" (apply fmt args))))
((char= (car cur) #\%)
(string #\%))
(t
--
-1.8.0.3
+1.8.5.4