aboutsummaryrefslogtreecommitdiff
path: root/str.c
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2025-07-19 17:08:57 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2025-07-19 17:08:57 +0000
commit3d772e596c1acf76f555c1f51fd8d834e56b0c35 (patch)
treedec8bea55fcfd356463e0d9b3b45fb75f1c60204 /str.c
parent4f8f2bc2946615330eaa2cc1f6b37d97865fa58a (diff)
Import bmake-20250707vendor/NetBSD/bmake/20250707
Intersting/relevant changes since bmake-20250618 ChangeLog since bmake-20250618 2025-07-07 Simon J Gerraty <sjg@beast.crufty.net> * VERSION (_MAKE_VERSION): 20250707 Merge with NetBSD make, pick up o cond.c: improve debug log message for 'exists' function. complain about unfinished escape sequences or string literals. 2025-07-04 Simon J Gerraty <sjg@beast.crufty.net> * VERSION (_MAKE_VERSION): 20250704 Merge with NetBSD make, pick up o make.1: add a DIAGNOSTICS section for make to reference. o main.c: simplify the warning for invalid -J by refering to manual page. 2025-06-30 Simon J Gerraty <sjg@beast.crufty.net> * VERSION (_MAKE_VERSION): 20250630 Merge with NetBSD make, pick up o consistently use double quotes in error messages o cond.c: if a condition is erroneous, skip the whole .if/.endif o make_malloc.c: in cleanup mode, initialize freshly allocated memory o str.c: error out on an ":M" modifier whose pattern ends with backslash o var.c: fix parsing of modifier parts for :gmtime and :localtime add POSIX $^ support mk/ChangeLog since bmake-20250618 2025-07-04 Simon J Gerraty <sjg@beast.crufty.net> * prog.mk: .MADE is a special source not a target!
Diffstat (limited to 'str.c')
-rw-r--r--str.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/str.c b/str.c
index f705b0deb874..e66cdbc8682e 100644
--- a/str.c
+++ b/str.c
@@ -1,4 +1,4 @@
-/* $NetBSD: str.c,v 1.105 2024/07/07 07:50:57 rillig Exp $ */
+/* $NetBSD: str.c,v 1.106 2025/06/28 21:09:43 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.105 2024/07/07 07:50:57 rillig Exp $");
+MAKE_RCSID("$NetBSD: str.c,v 1.106 2025/06/28 21:09:43 rillig Exp $");
static HashTable interned_strings;
@@ -363,8 +363,11 @@ match_fixed_length:
continue;
}
- if (*pat == '\\') /* match the next character exactly */
+ if (*pat == '\\') { /* match the next character exactly */
pat++;
+ if (*pat == '\0')
+ res.error = "Unfinished backslash at the end";
+ }
if (*pat != *str) {
if (asterisk && str == fixed_str) {
while (*str != '\0' && *str != *pat)