[Rpm-maint] [rpm-software-management/rpm] Support triple operator for conditional shortcut (#115) (#746)

Panu Matilainen notifications at github.com
Thu Jun 20 10:04:05 UTC 2019


pmatilai commented on this pull request.



> +	SKIPBLANK(parts->g,c);
+	parts->ge = parts->g;
+	while ((parts->ge[0] != 0) && (parts->ge[0] != ':')) {
+	    parts->ge++;
+	    if (parts->ge[0] == '{') {
+		if ((parts->ge = matchchar(parts->ge++, '{', '}')) == NULL)
+		    return NULL;
+	    }
+	}
+    } else {
+	return NULL;
+    }
+
+    /* be the trhird part starting by ':' is optional */
+    parts->h = parts->ge;
+    parts->ge = findParameterEnd(parts->h[0] == ':' ? parts->ge : --parts->ge);

Never use --/++ side-effects like that. You're even assigning to the same variable so it should be just
```? parts->ge : parts->ge -1```


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/746#pullrequestreview-252199254
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20190620/5a53374d/attachment.html>


More information about the Rpm-maint mailing list