From 8a67ed90c9dcf118cb14f9c5f786f678464c8905 Mon Sep 17 00:00:00 2001 From: rillig Date: Sat, 11 Jun 2022 16:47:24 +0000 Subject: [PATCH] make: extract HandleSingleDependencyTargetMundane No functional change. --- usr.bin/make/parse.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 25b8079cb99b..e8212831568b 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.676 2022/06/11 16:43:16 rillig Exp $ */ +/* $NetBSD: parse.c,v 1.677 2022/06/11 16:47:24 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -105,7 +105,7 @@ #include "pathnames.h" /* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: parse.c,v 1.676 2022/06/11 16:43:16 rillig Exp $"); +MAKE_RCSID("$NetBSD: parse.c,v 1.677 2022/06/11 16:47:24 rillig Exp $"); /* * A file being read. @@ -1020,6 +1020,18 @@ HandleDependencyTarget(const char *targetName, return true; } +static void +HandleSingleDependencyTargetMundane(const char *name) +{ + GNode *gn = Suff_IsTransform(name) + ? Suff_AddTransform(name) + : Targ_GetNode(name); + if (doing_depend) + RememberLocation(gn); + + Lst_Append(targets, gn); +} + static void HandleDependencyTargetMundane(char *targetName) { @@ -1034,13 +1046,7 @@ HandleDependencyTargetMundane(char *targetName) while (!Lst_IsEmpty(&targetNames)) { char *targName = Lst_Dequeue(&targetNames); - GNode *gn = Suff_IsTransform(targName) - ? Suff_AddTransform(targName) - : Targ_GetNode(targName); - if (doing_depend) - RememberLocation(gn); - - Lst_Append(targets, gn); + HandleSingleDependencyTargetMundane(targName); } }