]> Dogcows Code - chaz/openbox/blobdiff - openbox/actions/execute.c
Merge branch 'backport' into work
[chaz/openbox] / openbox / actions / execute.c
index 121c0943e9fec92ce024341d32b3bbfb70601f41..4d29fc19bd682ff1fa7de68ad5da51b64dcb9933 100644 (file)
@@ -144,7 +144,7 @@ static gboolean run_func(ObActionsData *data, gpointer options)
     if (data->client) {
         gchar *c, *before, *expand;
 
-        /* replace occurances of $pid and $wid */
+        /* replace occurrences of $pid and $wid */
 
         expand = NULL;
         before = cmd;
@@ -168,11 +168,10 @@ static gboolean run_func(ObActionsData *data, gpointer options)
 
                 before = c + 4; /* 4 = strlen("$pid") */
             }
-
-            if ((c[1] == 'w' || c[1] == 'W') &&
-                (c[2] == 'i' || c[2] == 'I') &&
-                (c[3] == 'd' || c[3] == 'D') &&
-                !g_ascii_isalnum(c[4]))
+            else if ((c[1] == 'w' || c[1] == 'W') &&
+                     (c[2] == 'i' || c[2] == 'I') &&
+                     (c[3] == 'd' || c[3] == 'D') &&
+                     !g_ascii_isalnum(c[4]))
             {
                 /* found $wid */
                 gchar *tmp;
@@ -187,6 +186,8 @@ static gboolean run_func(ObActionsData *data, gpointer options)
 
                 before = c + 4; /* 4 = strlen("$wid") */
             }
+            else
+                before = c + 1; /* no infinite loops plz */
         }
 
         if (expand) {
This page took 0.022435 seconds and 4 git commands to generate.