[Rpm-maint] [rpm-software-management/rpm] add support for %{shrink:} (#296)
Panu Matilainen
notifications at github.com
Wed Aug 2 10:25:29 UTC 2017
pmatilai commented on this pull request.
> @@ -864,6 +865,27 @@ doFoo(MacroBuf mb, int negate, const char * f, size_t fn,
if ((b = strrchr(buf, '/')) != NULL)
*b = '\0';
b = buf;
+ } else if (STREQ("shrink", f, fn)) {
+ /*
+ * shrink body by removing all leading and trailing whitespaces and
+ * reducing intermediate whitespaces to a single space character.
+ */
+ int i, j, k, was_space = 0;
+ for (i = 0, j = 0, k = (int)strlen(buf); i < k; ) {
+ if (isspace((int)(buf[i]))) {
Drop the redundant cast. Also you can use risspace() and drop the <ctype.h> include from the top after that.
--
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/296#pullrequestreview-53757404
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20170802/f10fb0c2/attachment.html>
More information about the Rpm-maint
mailing list