[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: 2668:a41c27c7d8be
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 e041f7ee20fe -r a41c27c7d8be cmd/wmii.sh.sh
--- a/cmd/wmii.sh.sh Fri May 28 15:51:00 2010 -0400
+++ b/cmd/wmii.sh.sh Fri May 28 20:30:20 2010 -0400
@@ -196,8 +196,13 @@
         if [ "$1" = -i ]
         then cat
         else wmiir read /event
- fi | while read wi_event
- do
+ 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