From c151d49b7a1a49805c94fc621a576f5c4ad32d1e Mon Sep 17 00:00:00 2001 From: purplerain Date: Mon, 12 Feb 2024 22:05:39 +0000 Subject: [PATCH] sync with OpenBSD -current --- gnu/llvm/lld/ELF/Driver.cpp | 6 +----- usr.bin/vi/common/options.c | 4 +++- usr.bin/vi/docs/USD.doc/vi.man/vi.1 | 8 ++++++-- usr.bin/vi/vi/vs_refresh.c | 4 ++-- usr.sbin/btrace/bt_parse.y | 4 ++-- usr.sbin/btrace/btrace.c | 8 ++++++-- 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/gnu/llvm/lld/ELF/Driver.cpp b/gnu/llvm/lld/ELF/Driver.cpp index 32b47d828..dcaea265a 100644 --- a/gnu/llvm/lld/ELF/Driver.cpp +++ b/gnu/llvm/lld/ELF/Driver.cpp @@ -1301,11 +1301,7 @@ static void readConfigs(opt::InputArgList &args) { config->zOrigin = hasZOption(args, "origin"); config->zPacPlt = hasZOption(args, "pac-plt"); config->zRelro = getZFlag(args, "relro", "norelro", true); -#ifndef __OpenBSD__ - config->zRetpolineplt = getZFlag(args, "retpolineplt", "noretpolineplt", false); -#else - config->zRetpolineplt = getZFlag(args, "retpolineplt", "noretpolineplt", true); -#endif + config->zRetpolineplt = hasZOption(args, "retpolineplt"); config->zRodynamic = hasZOption(args, "rodynamic"); config->zSeparate = getZSeparate(args); config->zShstk = hasZOption(args, "shstk"); diff --git a/usr.bin/vi/common/options.c b/usr.bin/vi/common/options.c index 6b08aea5f..f6f3930e5 100644 --- a/usr.bin/vi/common/options.c +++ b/usr.bin/vi/common/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.29 2021/04/13 15:39:21 millert Exp $ */ +/* $OpenBSD: options.c,v 1.30 2024/02/12 16:42:42 job Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -145,6 +145,8 @@ OPTLIST const optlist[] = { {"shellmeta", NULL, OPT_STR, 0}, /* O_SHIFTWIDTH 4BSD */ {"shiftwidth", NULL, OPT_NUM, OPT_NOZERO}, +/* O_SHOWFILENAME */ + {"showfilename",NULL, OPT_0BOOL, 0}, /* O_SHOWMATCH 4BSD */ {"showmatch", NULL, OPT_0BOOL, 0}, /* O_SHOWMODE 4.4BSD */ diff --git a/usr.bin/vi/docs/USD.doc/vi.man/vi.1 b/usr.bin/vi/docs/USD.doc/vi.man/vi.1 index ed9fddd9e..20abba2e8 100644 --- a/usr.bin/vi/docs/USD.doc/vi.man/vi.1 +++ b/usr.bin/vi/docs/USD.doc/vi.man/vi.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: vi.1,v 1.83 2023/01/29 09:28:57 otto Exp $ +.\" $OpenBSD: vi.1,v 1.84 2024/02/12 16:42:42 job Exp $ .\" .\" Copyright (c) 1994 .\" The Regents of the University of California. All rights reserved. @@ -14,7 +14,7 @@ .\" .\" @(#)vi.1 8.51 (Berkeley) 10/10/96 .\" -.Dd $Mdocdate: January 29 2023 $ +.Dd $Mdocdate: February 12 2024 $ .Dt VI 1 .Os .Sh NAME @@ -2488,6 +2488,10 @@ Set the meta characters checked to determine if file name expansion is necessary. .It Cm shiftwidth , sw Bq 8 Set the autoindent and shift command indentation width. +.It Cm showfilename Bq off +.Nm vi +only. +Display the file name on the colon command line. .It Cm showmatch , sm Bq off .Nm vi only. diff --git a/usr.bin/vi/vi/vs_refresh.c b/usr.bin/vi/vi/vs_refresh.c index a5f5496e0..38b01ddee 100644 --- a/usr.bin/vi/vi/vs_refresh.c +++ b/usr.bin/vi/vi/vs_refresh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs_refresh.c,v 1.22 2016/01/30 21:31:08 martijn Exp $ */ +/* $OpenBSD: vs_refresh.c,v 1.23 2024/02/12 16:42:43 job Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -810,7 +810,7 @@ vs_modeline(SCR *sp) /* If more than one screen in the display, show the file name. */ curlen = 0; - if (IS_SPLIT(sp)) { + if (IS_SPLIT(sp) || O_ISSET(sp, O_SHOWFILENAME)) { for (p = sp->frp->name; *p != '\0'; ++p); for (ellipsis = 0, cols = sp->cols / 2; --p > sp->frp->name;) { if (*p == '/') { diff --git a/usr.sbin/btrace/bt_parse.y b/usr.sbin/btrace/bt_parse.y index b9feb008b..075eaa5b7 100644 --- a/usr.sbin/btrace/bt_parse.y +++ b/usr.sbin/btrace/bt_parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: bt_parse.y,v 1.58 2024/02/07 19:07:42 mpi Exp $ */ +/* $OpenBSD: bt_parse.y,v 1.59 2024/02/12 15:11:06 mpi Exp $ */ /* * Copyright (c) 2019-2023 Martin Pieuchot @@ -611,7 +611,7 @@ bm_insert(const char *mname, struct bt_arg *mkey, struct bt_arg *mval) { struct bt_arg *ba; - if (mkey->ba_type == B_AT_TUPLE) + if (mkey->ba_type == B_AT_TUPLE) yyerror("tuple cannot be used as map key"); ba = ba_new(bg_get(mname), B_AT_MAP); diff --git a/usr.sbin/btrace/btrace.c b/usr.sbin/btrace/btrace.c index ac291a139..881c2acba 100644 --- a/usr.sbin/btrace/btrace.c +++ b/usr.sbin/btrace/btrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: btrace.c,v 1.84 2024/02/05 15:11:35 mpi Exp $ */ +/* $OpenBSD: btrace.c,v 1.85 2024/02/12 15:12:09 mpi Exp $ */ /* * Copyright (c) 2019 - 2023 Martin Pieuchot @@ -1868,6 +1868,7 @@ ba2dtflags(struct bt_arg *ba) long bacmp(struct bt_arg *a, struct bt_arg *b) { + char astr[STRLEN]; long val; if (a->ba_type != b->ba_type) @@ -1877,9 +1878,12 @@ bacmp(struct bt_arg *a, struct bt_arg *b) case B_AT_LONG: return ba2long(a, NULL) - ba2long(b, NULL); case B_AT_STR: - return strcmp(ba2str(a, NULL), ba2str(b, NULL)); + strlcpy(astr, ba2str(a, NULL), sizeof(astr)); + return strcmp(astr, ba2str(b, NULL)); case B_AT_TUPLE: /* Compare two lists of arguments one by one. */ + a = a->ba_value; + b = b->ba_value; do { val = bacmp(a, b); if (val != 0)