Module Name:    src
Committed By:   rillig
Date:           Fri Jun 28 15:20:57 UTC 2024

Modified Files:
        src/usr.bin/make: job.c job.h

Log Message:
make: reduce usage of the UNCONST hack


To generate a diff of this commit:
cvs rdiff -u -r1.477 -r1.478 src/usr.bin/make/job.c
cvs rdiff -u -r1.78 -r1.79 src/usr.bin/make/job.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/job.c
diff -u src/usr.bin/make/job.c:1.477 src/usr.bin/make/job.c:1.478
--- src/usr.bin/make/job.c:1.477	Tue Jun 25 05:18:38 2024
+++ src/usr.bin/make/job.c	Fri Jun 28 15:20:57 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.477 2024/06/25 05:18:38 rillig Exp $	*/
+/*	$NetBSD: job.c,v 1.478 2024/06/28 15:20:57 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -141,7 +141,7 @@
 #include "trace.h"
 
 /*	"@(#)job.c	8.2 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: job.c,v 1.477 2024/06/25 05:18:38 rillig Exp $");
+MAKE_RCSID("$NetBSD: job.c,v 1.478 2024/06/28 15:20:57 rillig Exp $");
 
 /*
  * A shell defines how the commands are run.  All commands for a target are
@@ -399,7 +399,7 @@ static Shell shells[] = {
  * It is set by the Job_ParseShell function.
  */
 static Shell *shell = &shells[DEFSHELL_INDEX];
-const char *shellPath = NULL;	/* full pathname of executable image */
+char *shellPath;		/* full pathname of executable image */
 const char *shellName = NULL;	/* last component of shellPath */
 char *shellErrFlag = NULL;
 static char *shell_freeIt = NULL; /* Allocated memory for custom .SHELL */
@@ -2473,13 +2473,13 @@ Job_ParseShell(char *line)
 				 * Shell_Init has already been called!
 				 * Do it again.
 				 */
-				free(UNCONST(shellPath));
+				free(shellPath);
 				shellPath = NULL;
 				Shell_Init();
 			}
 		}
 	} else {
-		free(UNCONST(shellPath));
+		free(shellPath);
 		shellPath = bmake_strdup(path);
 		shellName = newShell.name != NULL ? newShell.name
 		    : str_basename(path);

Index: src/usr.bin/make/job.h
diff -u src/usr.bin/make/job.h:1.78 src/usr.bin/make/job.h:1.79
--- src/usr.bin/make/job.h:1.78	Tue Dec 19 19:33:39 2023
+++ src/usr.bin/make/job.h	Fri Jun 28 15:20:57 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.h,v 1.78 2023/12/19 19:33:39 rillig Exp $	*/
+/*	$NetBSD: job.h,v 1.79 2024/06/28 15:20:57 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -179,7 +179,7 @@ typedef struct Job {
 #endif
 } Job;
 
-extern const char *shellPath;
+extern char *shellPath;
 extern const char *shellName;
 extern char *shellErrFlag;
 

Reply via email to