[PATCH 3/4] xprop: support > and < in conditional compares

Bert Wesarg bert.wesarg at googlemail.com
Thu Oct 20 07:23:27 PDT 2011


Signed-off-by: Bert Wesarg <bert.wesarg at googlemail.com>
---
 xprop.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/xprop.c b/xprop.c
index 9203f08..25d626f 100644
--- a/xprop.c
+++ b/xprop.c
@@ -1262,6 +1262,14 @@ Scan_Exp (const char *string, thunk *thunks, const char *format, long *value)
 	string = Scan_Exp(++string, thunks, format, &temp);
 	*value = *value == temp;
     }
+    else if (string[0] == '<') {
+	string = Scan_Exp(++string, thunks, format, &temp);
+	*value = *value < temp;
+    }
+    else if (string[0] == '>') {
+	string = Scan_Exp(++string, thunks, format, &temp);
+	*value = *value > temp;
+    }
 
     return string;
 }
-- 
1.7.7.759.gfc8c6



More information about the xorg-devel mailing list