{
int ret, rflags = 0, noprune;
char *r = 0, *rname = 0;
+ const char *relop;
/* try to split off an relation part */
if ((flags & SELECTION_REL) != 0)
{
- if ((r = strpbrk(name, "<=>")) != 0)
+ if ((relop = (char *)strpbrk(name, "<=>")) == 0)
+ {
+ r = 0;
+ }
+ else
{
rname = solv_strdup(name);
- r = rname + (r - name);
+ r = rname + (relop - name);
if ((r = splitrel(rname, r, &rflags)) == 0)
rname = solv_free(rname);
}
selection_canon(Pool *pool, Queue *selection, const char *name, int flags)
{
char *rname, *r, *r2;
+ const char *delimiter;
Id archid = 0;
int ret;
#endif
if (pool->disttype == DISTTYPE_DEB)
{
- if ((r = strchr(name, '_')) == 0)
+ if ((delimiter = strchr(name, '_')) == 0)
return 0;
rname = solv_strdup(name); /* so we can modify it */
- r = rname + (r - name);
+ r = rname + (delimiter - name);
*r++ = 0;
if ((ret = selection_name(pool, selection, rname, flags)) == 0)
{
if (pool->disttype == DISTTYPE_HAIKU)
{
- if ((r = strchr(name, '-')) == 0)
+ if ((delimiter = strchr(name, '-')) == 0)
return 0;
rname = solv_strdup(name); /* so we can modify it */
- r = rname + (r - name);
+ r = rname + (delimiter - name);
*r++ = 0;
if ((ret = selection_name(pool, selection, rname, flags)) == 0)
{
return selection->count ? ret | SELECTION_CANON : 0;
}
- if ((r = strrchr(name, '-')) == 0)
+ if ((delimiter = strrchr(name, '-')) == 0)
return 0;
rname = solv_strdup(name); /* so we can modify it */
- r = rname + (r - name);
+ r = rname + (delimiter - name);
*r = 0;
/* split off potential arch part from version */
Pool *pool = repo->pool;
Id id, idp, idl;
char buf[1024], *p, *bp;
- const char *dep;
+ const char *dep, *colon;
int i, l;
if (provides)
if (id)
supplements = repo_addid_dep(repo, supplements, id, 0);
}
- else if ((p = strchr(dep, ':')) != 0 && p != dep && p[1] == '/' && strlen(dep) < sizeof(buf))
+ else if ((colon = strchr(dep, ':')) != 0 && colon != dep && colon[1] == '/' && strlen(dep) < sizeof(buf))
{
strcpy(buf, dep);
- p = buf + (p - dep);
+ p = buf + (colon - dep);
*p++ = 0;
idp = pool_str2id(pool, buf, 1);
/* strip trailing slashes */