mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-29 01:58:26 +00:00
Fix if_match comparison for string operands containing operator symbols (#1988)
This commit is contained in:
parent
6a1aa57340
commit
068e1f4358
@ -40,9 +40,15 @@
|
||||
* returns the index of the first op character or -1 on error
|
||||
*/
|
||||
int find_match_op(const char *expr) {
|
||||
unsigned int idx;
|
||||
unsigned int idx = 0;
|
||||
|
||||
for (idx = 0; idx < strlen(expr); idx++) {
|
||||
/* if first operand is a string, skip it */
|
||||
if (expr[idx] == '"') {
|
||||
for (idx=1; expr[idx] && expr[idx] != '"'; idx++);
|
||||
idx++;
|
||||
}
|
||||
|
||||
for (; idx < strlen(expr); idx++) {
|
||||
switch (expr[idx]) {
|
||||
case '=':
|
||||
case '!':
|
||||
|
Loading…
x
Reference in New Issue
Block a user