Module Name:    src
Committed By:   rillig
Date:           Sat Nov  7 12:58:55 UTC 2020

Modified Files:
        src/usr.bin/make: arch.c

Log Message:
make(1): rename parameter of ArchSVR4Entry

It cannot be made a const string, so rather document it clearly that the
string is modified.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/usr.bin/make/arch.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/arch.c
diff -u src/usr.bin/make/arch.c:1.160 src/usr.bin/make/arch.c:1.161
--- src/usr.bin/make/arch.c:1.160	Sat Nov  7 12:54:44 2020
+++ src/usr.bin/make/arch.c	Sat Nov  7 12:58:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.160 2020/11/07 12:54:44 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.161 2020/11/07 12:58:55 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -125,7 +125,7 @@
 #include "config.h"
 
 /*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: arch.c,v 1.160 2020/11/07 12:54:44 rillig Exp $");
+MAKE_RCSID("$NetBSD: arch.c,v 1.161 2020/11/07 12:58:55 rillig Exp $");
 
 typedef struct List ArchList;
 typedef struct ListNode ArchListNode;
@@ -607,15 +607,15 @@ badarch:
  *-----------------------------------------------------------------------
  */
 static int
-ArchSVR4Entry(Arch *ar, char *name, size_t size, FILE *arch)
+ArchSVR4Entry(Arch *ar, char *inout_name, size_t size, FILE *arch)
 {
 #define ARLONGNAMES1 "//"
 #define ARLONGNAMES2 "/ARFILENAMES"
     size_t entry;
     char *ptr, *eptr;
 
-    if (strncmp(name, ARLONGNAMES1, sizeof ARLONGNAMES1 - 1) == 0 ||
-	strncmp(name, ARLONGNAMES2, sizeof ARLONGNAMES2 - 1) == 0) {
+    if (strncmp(inout_name, ARLONGNAMES1, sizeof ARLONGNAMES1 - 1) == 0 ||
+	strncmp(inout_name, ARLONGNAMES2, sizeof ARLONGNAMES2 - 1) == 0) {
 
 	if (ar->fnametab != NULL) {
 	    DEBUG0(ARCH, "Attempted to redefine an SVR4 name table\n");
@@ -644,23 +644,23 @@ ArchSVR4Entry(Arch *ar, char *name, size
 	return 0;
     }
 
-    if (name[1] == ' ' || name[1] == '\0')
+    if (inout_name[1] == ' ' || inout_name[1] == '\0')
 	return 2;
 
-    entry = (size_t)strtol(&name[1], &eptr, 0);
-    if ((*eptr != ' ' && *eptr != '\0') || eptr == &name[1]) {
-	DEBUG1(ARCH, "Could not parse SVR4 name %s\n", name);
+    entry = (size_t)strtol(&inout_name[1], &eptr, 0);
+    if ((*eptr != ' ' && *eptr != '\0') || eptr == &inout_name[1]) {
+	DEBUG1(ARCH, "Could not parse SVR4 name %s\n", inout_name);
 	return 2;
     }
     if (entry >= ar->fnamesize) {
 	DEBUG2(ARCH, "SVR4 entry offset %s is greater than %lu\n",
-	       name, (unsigned long)ar->fnamesize);
+	       inout_name, (unsigned long)ar->fnamesize);
 	return 2;
     }
 
-    DEBUG2(ARCH, "Replaced %s with %s\n", name, &ar->fnametab[entry]);
+    DEBUG2(ARCH, "Replaced %s with %s\n", inout_name, &ar->fnametab[entry]);
 
-    snprintf(name, MAXPATHLEN + 1, "%s", &ar->fnametab[entry]);
+    snprintf(inout_name, MAXPATHLEN + 1, "%s", &ar->fnametab[entry]);
     return 1;
 }
 #endif

Reply via email to