Module Name: src Committed By: rillig Date: Sun Mar 14 15:24:37 UTC 2021
Modified Files: src/usr.bin/make: var.c Log Message: make: reduce indentation in ApplyModifier_SunShell No functional change. To generate a diff of this commit: cvs rdiff -u -r1.862 -r1.863 src/usr.bin/make/var.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/var.c diff -u src/usr.bin/make/var.c:1.862 src/usr.bin/make/var.c:1.863 --- src/usr.bin/make/var.c:1.862 Sun Mar 14 15:22:21 2021 +++ src/usr.bin/make/var.c Sun Mar 14 15:24:37 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.862 2021/03/14 15:22:21 rillig Exp $ */ +/* $NetBSD: var.c,v 1.863 2021/03/14 15:24:37 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -140,7 +140,7 @@ #include "metachar.h" /* "@(#)var.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: var.c,v 1.862 2021/03/14 15:22:21 rillig Exp $"); +MAKE_RCSID("$NetBSD: var.c,v 1.863 2021/03/14 15:24:37 rillig Exp $"); typedef enum VarFlags { VFL_NONE = 0, @@ -3515,27 +3515,27 @@ ApplyModifier_SunShell(const char **pp, { Expr *expr = st->expr; const char *p = *pp; - if (p[1] == 'h' && IsDelimiter(p[2], st)) { - if (expr->eflags & VARE_WANTRES) { - const char *errfmt; - char *output = Cmd_Exec(expr->value.str, &errfmt); - if (errfmt != NULL) - Error(errfmt, expr->value.str); - Expr_SetValueOwn(expr, output); - } else { - /* - * TODO: Check whether returning ":sh" would be - * more consistent with the other modifiers. - * - * TODO: Add a unit test demonstrating that the - * actual value of this expression has any effect. - */ - Expr_SetValueRefer(expr, ""); - } - *pp = p + 2; - return AMR_OK; - } else + if (!(p[1] == 'h' && IsDelimiter(p[2], st))) return AMR_UNKNOWN; + + if (expr->eflags & VARE_WANTRES) { + const char *errfmt; + char *output = Cmd_Exec(expr->value.str, &errfmt); + if (errfmt != NULL) + Error(errfmt, expr->value.str); + Expr_SetValueOwn(expr, output); + } else { + /* + * TODO: Check whether returning ":sh" would be + * more consistent with the other modifiers. + * + * TODO: Add a unit test demonstrating that the + * actual value of this expression has any effect. + */ + Expr_SetValueRefer(expr, ""); + } + *pp = p + 2; + return AMR_OK; } #endif