aboutsummaryrefslogtreecommitdiff
path: root/miscutils/make.c
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils/make.c')
-rw-r--r--miscutils/make.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/miscutils/make.c b/miscutils/make.c
index 39c0081ab..a165274aa 100644
--- a/miscutils/make.c
+++ b/miscutils/make.c
@@ -2171,6 +2171,20 @@ pragmas_from_env(void)
2171#endif 2171#endif
2172 2172
2173/* 2173/*
2174 * Determine if a line is a target rule with an inline command.
2175 * Return a pointer to the semicolon separator if it is, else NULL.
2176 */
2177static char *
2178inline_command(char *line)
2179{
2180 char *p = find_char(line, ':');
2181
2182 if (p)
2183 p = strchr(p, ';');
2184 return p;
2185}
2186
2187/*
2174 * Parse input from the makefile and construct a tree structure of it. 2188 * Parse input from the makefile and construct a tree structure of it.
2175 */ 2189 */
2176static void 2190static void
@@ -2389,9 +2403,9 @@ input(FILE *fd, int ilevel)
2389 cp = NULL; 2403 cp = NULL;
2390 s = strchr(q, ';'); 2404 s = strchr(q, ';');
2391 if (s) { 2405 if (s) {
2392 // Retrieve command from expanded copy of line 2406 // Retrieve command from original or expanded copy of line
2393 char *copy3 = expand_macros(copy, FALSE); 2407 char *copy3 = expand_macros(copy, FALSE);
2394 if ((p = find_colon(copy3)) && (p = strchr(p, ';'))) 2408 if ((p = inline_command(copy)) || (p = inline_command(copy3)))
2395 newcmd(&cp, process_command(p + 1)); 2409 newcmd(&cp, process_command(p + 1));
2396 free(copy3); 2410 free(copy3);
2397 *s = '\0'; 2411 *s = '\0';