Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
allow != in evalutation operator, this can avoid most of the | grep -v
Baptiste Daroussin committed 14 years ago
commit 2826f4bd350537f1c6a6520c55d8cd4bb00c7cf4
parent b98754d
1 file changed +13 -0
modified pkg/query.c
@@ -473,6 +473,19 @@ format_sql_condition(const char *str, struct sbuf *sqlcond)
					str++;
					sbuf_putc(sqlcond, str[0]);
				}
+
			} else if (str[0] == '!') {
+
				if (str[1] != '=') {
+
					fprintf(stderr, "expecting = after !");
+
					return (EPKG_FATAL);
+
				}
+
				if (state == OPERATOR_STRING) {
+
					state = NEXT_IS_STRING;
+
				} else {
+
					state = NEXT_IS_INT;
+
				}
+
				sbuf_putc(sqlcond, str[0]);
+
				str++;
+
				sbuf_putc(sqlcond, str[0]);
			}
		} else if (state == NEXT_IS_STRING || state == NEXT_IS_INT) {
			if (isspace(str[0])) {