Module Name: src Committed By: rillig Date: Mon Apr 1 12:33:28 UTC 2024
Modified Files: src/usr.bin/make: for.c Log Message: make: remove unreachable code in handling .for loops To generate a diff of this commit: cvs rdiff -u -r1.178 -r1.179 src/usr.bin/make/for.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/for.c diff -u src/usr.bin/make/for.c:1.178 src/usr.bin/make/for.c:1.179 --- src/usr.bin/make/for.c:1.178 Sun Jan 21 15:02:17 2024 +++ src/usr.bin/make/for.c Mon Apr 1 12:33:27 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: for.c,v 1.178 2024/01/21 15:02:17 rillig Exp $ */ +/* $NetBSD: for.c,v 1.179 2024/04/01 12:33:27 rillig Exp $ */ /* * Copyright (c) 1992, The Regents of the University of California. @@ -58,7 +58,7 @@ #include "make.h" /* "@(#)for.c 8.1 (Berkeley) 6/6/93" */ -MAKE_RCSID("$NetBSD: for.c,v 1.178 2024/01/21 15:02:17 rillig Exp $"); +MAKE_RCSID("$NetBSD: for.c,v 1.179 2024/04/01 12:33:27 rillig Exp $"); typedef struct ForLoop { @@ -196,11 +196,7 @@ ForLoop_ParseItems(ForLoop *f, const cha cpp_skip_whitespace(&p); items = Var_Subst(p, SCOPE_GLOBAL, VARE_WANTRES); - if (items == var_Error) { - /* TODO: Make this part of the code reachable. */ - Parse_Error(PARSE_FATAL, "Error in .for loop items"); - return false; - } + /* TODO: handle errors */ f->items = Substring_Words(items, false); free(items); @@ -490,12 +486,11 @@ ForLoop_SubstBody(ForLoop *f, unsigned i p += 2; ForLoop_SubstVarLong(f, firstItem, body, &p, endc, &mark); - } else if (p[1] != '\0') { + } else { ForLoop_SubstVarShort(f, firstItem, body, p + 1, &mark); p += 2; - } else - break; + } } Buf_AddRange(body, mark, end);