--- src/usr.bin/make/cond.c 2005/09/24 07:37:38 1.50 +++ src/usr.bin/make/cond.c 2005/09/24 07:38:03 1.51 @@ -249,28 +249,33 @@ CondGetArg(char **linePtr, char **argPtr } } + while (*cp == ' ' || *cp == '\t') { + cp++; + } + Buf_AddByte(buf, '\0'); *argPtr = Buf_Data(buf); argLen = Buf_Size(buf); Buf_Destroy(buf, false); - while (*cp == ' ' || *cp == '\t') { - cp++; - } - if (parens && *cp != CLOSE_PAREN) { - Parse_Error(PARSE_WARNING, - "Missing closing parenthesis for %s()", func); - return (0); - /* XXX memory leak of argPtr? */ - } else if (parens) { - /* - * Advance pointer past close parenthesis. - */ - cp++; + if (parens) { + if (*cp == CLOSE_PAREN) { + /* + * Advance pointer past close parenthesis. + */ + cp++; + *linePtr = cp; + return (argLen); + } else { + Parse_Error(PARSE_WARNING, + "Missing closing parenthesis for %s()", func); + return (0); + /* XXX memory leak of argPtr? */ + } + } else { + *linePtr = cp; + return (argLen); } - - *linePtr = cp; - return (argLen); } /**