From nobody Wed Jun 21 21:00:47 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QmbWN3LZkz4g9tT; Wed, 21 Jun 2023 21:00:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QmbWN1nyDz43ql; Wed, 21 Jun 2023 21:00:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687381248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jCl/AKFAXJPfJvZXzzlhz1a+h3WDZEgk7lsajD1q+Lg=; b=TdpAm7HjFEgJJn3YZbZlQU+2a6XQb/f/j2LcPOg55MNByUxuQa0TMX7pzAsl2F5jMYHh+W apVbrBWrPu6SkLxUj0WKKQdKN9A04+Rs5oYnc7gHOtu1dVVRagSCDr0C7lQgzneqC7JT8v WRtcC2gum13mebiqD3jt//2MqN9/YHLHSKrJLgMTIktVG6Mu9CgTOuVSsdcAzIONp1wchC durOh6VWUzlvVcBrmLoDS1wXlxCioM/qGybsQUZZUKWqf1wzvy8oUgBXVVbAO9wCW73Y48 JzzgaD6madA9OpFnp2re/3PlROu1ASgJUMgQg5aj8hCO6+PEzziaf5DeYetriw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687381248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jCl/AKFAXJPfJvZXzzlhz1a+h3WDZEgk7lsajD1q+Lg=; b=i7sOymfyroCpfBEamYS1wBUT30Pze9P2YgiU866Do2S/EcQk90MTCPqwgpL/nngK3QEZvT Uqot/0rQo9CJx2VwR3wl71IYPisBoW41CjgrsXsUAdAIEY5OuLBeEwqKM2bbofekGCsgKA bWWnQgpfL8wzh20Cl/MU/IY9TxTD5/p2yct9LYbcs8YvRpOB9Uuh7nRrMXZOR6/sJCbTl7 vrydKTU7XCyUFWGbHguYUi1o2doxBndd47U07N7+ufSfBcQOpnalDrFD1h8DEzk7qBSEu0 0NYMb+k85UVqTUHg8hBiytZDSw1ueOm4/oxrdGzpnJ0TgqfxtP0ZYuv2muf7ow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687381248; a=rsa-sha256; cv=none; b=Keo4xwB93RpsdrPPmck3JVzwij5b0aMOBABcJL/TaKlJdw2B27Z5JeGLhhkiLC2qPkCYq7 awb5tZi2U6iEcxAtXhuVf/j506+8q5SZOnWe9Rz2v+M82meebWtIRAkOH3vyTVR0E2kF70 m//1k5vNrX++NHlp4ArfVjIXy/eS1+RYR9Qu3ZFWUNgLe6au4nmIUCm0rdIvGENMujVnVX GT+L9HWyiHeQLoYWteYLDdetlD5rG8zFT6gmz0ONW/EyFeVO73z2aAQjl9n7V0kr4P0IWp /yUJt9SBicFBk09ji1+XcSPpryCB+GdL19sUiE8aJfLOKgKZiGsFiFihSk2Gqg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QmbWN0fvzzwxl; Wed, 21 Jun 2023 21:00:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35LL0mZT077160; Wed, 21 Jun 2023 21:00:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35LL0lJj077159; Wed, 21 Jun 2023 21:00:47 GMT (envelope-from git) Date: Wed, 21 Jun 2023 21:00:47 GMT Message-Id: <202306212100.35LL0lJj077159@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 6c9ed64c94f1 - main - m4: Add -G option which reverses -g. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6c9ed64c94f192eda8c8b5e9e2b92ff93da36de2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=6c9ed64c94f192eda8c8b5e9e2b92ff93da36de2 commit 6c9ed64c94f192eda8c8b5e9e2b92ff93da36de2 Author: Dag-Erling Smørgrav AuthorDate: 2023-06-21 20:58:45 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-06-21 20:59:03 +0000 m4: Add -G option which reverses -g. This matches GNU m4's -G / --traditional option, and although BSD m4 in non-GNU mode is not exactly identical to GNU mode in traditional mode, it's close enough. Sponsored by: Klara, Inc. Reviewed by: kevans, imp Differential Revision: https://reviews.freebsd.org/D40697 --- usr.bin/m4/m4.1 | 10 +++++++--- usr.bin/m4/main.c | 6 +++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/usr.bin/m4/m4.1 b/usr.bin/m4/m4.1 index 838348cb78af..e234cf201213 100644 --- a/usr.bin/m4/m4.1 +++ b/usr.bin/m4/m4.1 @@ -41,7 +41,7 @@ .Nd macro language processor .Sh SYNOPSIS .Nm -.Op Fl EgPs +.Op Fl EGgPs .Oo .Sm off .Fl D Ar name Op No = Ar value @@ -156,8 +156,12 @@ first warning and .Nm will exit with a non-zero exit status. This behaviour matches GNU-m4 1.4.9 and later. +.It Fl G , Fl -traditional +Disable GNU compatibility mode (see +.Fl g +below). .It Fl g , Fl -gnu -Activate GNU-m4 compatibility mode. +Enable GNU compatibility mode. In this mode, translit handles simple character ranges (e.g., a-z), regular expressions mimic emacs behavior, multiple m4wrap calls are handled as a stack, @@ -485,7 +489,7 @@ utility is compliant with the specification. .Pp The flags -.Op Fl dEgIPot +.Op Fl dEGgIPot and the macros .Ic builtin , .Ic esyscmd , diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c index b3cfb5b03304..f776ca8594e4 100644 --- a/usr.bin/m4/main.c +++ b/usr.bin/m4/main.c @@ -61,11 +61,12 @@ __FBSDID("$FreeBSD$"); #include "extern.h" #include "pathnames.h" -static const char *shortopts = "+D:d::EgI:o:Pst:U:"; +static const char *shortopts = "+D:d::EGgI:o:Pst:U:"; static const struct option longopts[] = { { "define", required_argument, NULL, 'D' }, { "debug", optional_argument, NULL, 'd' }, { "fatal-warnings", no_argument, NULL, 'E' }, + { "traditional", no_argument, NULL, 'G' }, { "gnu", no_argument, NULL, 'g' }, { "include", required_argument, NULL, 'I' }, { "error-output", required_argument, NULL, 'o' }, @@ -230,6 +231,9 @@ main(int argc, char *argv[]) case 'U': /* undefine... */ macro_popdef(optarg); break; + case 'G': + mimic_gnu = 0; + break; case 'g': mimic_gnu = 1; break;