Module Name: src Committed By: rillig Date: Mon Jun 21 16:59:18 UTC 2021
Modified Files: src/usr.bin/make: str.c Log Message: make: eliminate local variable in Substring_Words No functional change. To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/usr.bin/make/str.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/str.c diff -u src/usr.bin/make/str.c:1.85 src/usr.bin/make/str.c:1.86 --- src/usr.bin/make/str.c:1.85 Sun May 30 21:16:54 2021 +++ src/usr.bin/make/str.c Mon Jun 21 16:59:18 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: str.c,v 1.85 2021/05/30 21:16:54 rillig Exp $ */ +/* $NetBSD: str.c,v 1.86 2021/06/21 16:59:18 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -71,7 +71,7 @@ #include "make.h" /* "@(#)str.c 5.8 (Berkeley) 6/1/90" */ -MAKE_RCSID("$NetBSD: str.c,v 1.85 2021/05/30 21:16:54 rillig Exp $"); +MAKE_RCSID("$NetBSD: str.c,v 1.86 2021/06/21 16:59:18 rillig Exp $"); /* Return the concatenation of s1 and s2, freshly allocated. */ char * @@ -188,10 +188,9 @@ Substring_Words(const char *str, bool ex *word_end++ = '\0'; if (words_len == words_cap) { - size_t new_size; words_cap *= 2; - new_size = (words_cap + 1) * sizeof(words[0]); - words = bmake_realloc(words, new_size); + words = bmake_realloc(words, + (words_cap + 1) * sizeof(words[0])); } words[words_len++] = Substring_Init(word_start, word_end - 1);