[hackers] [wmii] Work around a dash bug prematurely killing the event loop. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Sat, 29 May 2010 00:35:03 +0000 (UTC)

changeset: 2669:56a992b14bcf
branch: 3.9
tag: tip
parent: 2641:2150d866e9bc
user: Kris Maglione <kris_AT_suckless.org>
date: Fri May 28 20:30:20 2010 -0400
files: cmd/wmii.sh.sh
description:
Work around a dash bug prematurely killing the event loop.

diff -r 2150d866e9bc -r 56a992b14bcf cmd/wmii.sh.sh
--- a/cmd/wmii.sh.sh Tue May 25 13:57:47 2010 -0400
+++ b/cmd/wmii.sh.sh Fri May 28 20:30:20 2010 -0400
@@ -193,8 +193,16 @@
 wi_eventloop() {
         echo "$Keys" | wmiir write /keys
 
- wmiir read /event | while read wi_event
- do
+ if [ "$1" = -i ]
+ then cat
+ else wmiir read /event
+ fi | awk '/./ { print; fflush() } END { print "" }' |
+ while :; do
+ # Work around a dash bug.
+ # Only quit on successful read of a blank line.
+ read wi_event || continue
+ test -n "$wi_event" || break
+
                 IFS="$wi_newline"
                 wi_arg=$(echo "$wi_event" | sed 's/^[^ ]* //')
                 unset IFS
Received on Sat May 29 2010 - 00:35:03 UTC

This archive was generated by hypermail 2.2.0 : Sat May 29 2010 - 00:36:04 UTC