Skip to content

Commit

Permalink
Don't warn when an escaped macro is in comment.
Browse files Browse the repository at this point in the history
- Related to 2a3f495
  • Loading branch information
lkardos committed Jul 30, 2015
1 parent 8ea5374 commit 655ca18
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions build/parseSpec.c
Expand Up @@ -189,12 +189,25 @@ static int expandMacrosInSpecBuf(rpmSpec spec, int strip)
goto exit;
}

if (strip & STRIP_COMMENTS &&
isComment && !rstreq(spec->lbuf, lbuf)) {
if (strip & STRIP_COMMENTS && isComment) {
char *bufA = lbuf;
char *bufB = spec->lbuf;

rpmlog(RPMLOG_WARNING,
_("Macro expanded in comment on line %d: %s\n"),
spec->lineNum, lbuf);
while (*bufA != '\0' && *bufB != '\0') {
if (*bufA == '%' && *(bufA + 1) == '%')
bufA++;

if (*bufA != *bufB)
break;

bufA++;
bufB++;
}

if (*bufA != '\0' || *bufB != '\0')
rpmlog(RPMLOG_WARNING,
_("Macro expanded in comment on line %d: %s\n"),
spec->lineNum, lbuf);
}

exit:
Expand Down

0 comments on commit 655ca18

Please sign in to comment.