aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--URPM.xs9
1 files changed, 3 insertions, 6 deletions
diff --git a/URPM.xs b/URPM.xs
index 4adf115..cc07e14 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -329,13 +329,10 @@ print_list_entry(char *buff, int sz, const char *name, rpmsenseFlags flags, cons
len = strlen(evr);
if (len > 0) {
if (p - buff + 6 + len >= sz) return -1;
+ static const char *Fstr[] = { "?0","<",">","?3","==","<=",">=","?7" };
+ uint32_t Fx = ((flags >> 1) & 0x7);
*p++ = '[';
- if (flags & RPMSENSE_LESS) *p++ = '<';
- if (flags & RPMSENSE_GREATER) *p++ = '>';
- if (flags & RPMSENSE_EQUAL) *p++ = '=';
- if ((flags & (RPMSENSE_LESS|RPMSENSE_EQUAL|RPMSENSE_GREATER)) == RPMSENSE_EQUAL) *p++ = '=';
- *p++ = ' ';
- memcpy(p, evr, len); p+= len;
+ p = stpcpy( stpcpy( stpcpy(p, Fstr[Fx]), " "), evr);
*p++ = ']';
}
}