Module Name: src Committed By: rillig Date: Sun Sep 27 11:37:19 UTC 2020
Modified Files: src/usr.bin/make: compat.c nonints.h Log Message: make(1): make parameter of Compat_RunCommand const To generate a diff of this commit: cvs rdiff -u -r1.152 -r1.153 src/usr.bin/make/compat.c cvs rdiff -u -r1.131 -r1.132 src/usr.bin/make/nonints.h 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/compat.c diff -u src/usr.bin/make/compat.c:1.152 src/usr.bin/make/compat.c:1.153 --- src/usr.bin/make/compat.c:1.152 Sat Sep 26 16:41:42 2020 +++ src/usr.bin/make/compat.c Sun Sep 27 11:37:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.152 2020/09/26 16:41:42 rillig Exp $ */ +/* $NetBSD: compat.c,v 1.153 2020/09/27 11:37:19 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -99,7 +99,7 @@ #include "pathnames.h" /* "@(#)compat.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: compat.c,v 1.152 2020/09/26 16:41:42 rillig Exp $"); +MAKE_RCSID("$NetBSD: compat.c,v 1.153 2020/09/27 11:37:19 rillig Exp $"); static GNode *curTarg = NULL; static void CompatInterrupt(int); @@ -185,10 +185,10 @@ CompatInterrupt(int signo) *----------------------------------------------------------------------- */ int -Compat_RunCommand(char *cmdp, struct GNode *gn) +Compat_RunCommand(const char *cmdp, struct GNode *gn) { char *cmdStart; /* Start of expanded command */ - char *cp, *bp; + char *bp; Boolean silent, /* Don't print command */ doIt; /* Execute even if -n */ volatile Boolean errCheck; /* Check errors */ @@ -201,7 +201,7 @@ Compat_RunCommand(char *cmdp, struct GNo char ** volatile mav;/* Copy of the argument vector for freeing */ Boolean useShell; /* TRUE if command should be executed * using a shell */ - char * volatile cmd = (char *)cmdp; + const char * volatile cmd = cmdp; silent = (gn->type & OP_SILENT) != 0; errCheck = !(gn->type & OP_IGNORE); @@ -403,6 +403,7 @@ Compat_RunCommand(char *cmdp, struct GNo #endif if (status != 0) { if (DEBUG(ERROR)) { + const char *cp; fprintf(debug_file, "\n*** Failed target: %s\n*** Failed command: ", gn->name); for (cp = cmd; *cp; ) { Index: src/usr.bin/make/nonints.h diff -u src/usr.bin/make/nonints.h:1.131 src/usr.bin/make/nonints.h:1.132 --- src/usr.bin/make/nonints.h:1.131 Sat Sep 26 16:41:42 2020 +++ src/usr.bin/make/nonints.h Sun Sep 27 11:37:19 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: nonints.h,v 1.131 2020/09/26 16:41:42 rillig Exp $ */ +/* $NetBSD: nonints.h,v 1.132 2020/09/27 11:37:19 rillig Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -85,7 +85,7 @@ void Arch_End(void); Boolean Arch_IsLib(GNode *); /* compat.c */ -int Compat_RunCommand(char *, GNode *); +int Compat_RunCommand(const char *, GNode *); void Compat_Run(GNodeList *); void Compat_Make(GNode *, GNode *);