From nobody Sun May 29 09:36:07 2022 X-Original-To: standards@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 0F0901B3A1B1 for ; Sun, 29 May 2022 09:36:08 +0000 (UTC) (envelope-from bugzilla-noreply@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 4L9thR6K3Yz52RL for ; Sun, 29 May 2022 09:36:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 B8C83206E4 for ; Sun, 29 May 2022 09:36:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 24T9a7OV033585 for ; Sun, 29 May 2022 09:36:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 24T9a7cQ033584 for standards@FreeBSD.org; Sun, 29 May 2022 09:36:07 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: standards@FreeBSD.org Subject: [Bug 46441] sh(1): Does not support PS1, PS2, PS4 parameter expansion Date: Sun, 29 May 2022 09:36:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: feature, needs-patch, needs-qa, standards X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: pstef@freebsd.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? maintainer-feedback? mfc-stable13? mfc-stable12? X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Standards compliance List-Archive: https://lists.freebsd.org/archives/freebsd-standards List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-standards@freebsd.org X-BeenThere: freebsd-standards@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653816967; 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: in-reply-to:in-reply-to:references:references; bh=PNHjULF6lUvC4UVi4hKn63YRxURmmbBZcBDXIhyoonk=; b=VmO92PuRjvq2avxz4NAvfu53BtMBZsS6vTGLdzcaohTlMNUZCmxjE2PXw8MihCFLQ27WZn pUz9H0iAY1puKrgQVUG3TZLBXevq1RfPH9oKBkW72si0TTPMKwCMpUAmUDD12jdVIA8Zvt QA7lASmYQhIC6LjpQ2Jm/A0BuOKjOYBIe9NEaj+3YhwsP27qxflBIVEa3dCnF42Xz3h1sF d8BEzz0VjjP7zAKW4iLJ3x/dgXAAU46VJ9j9/W/Xg1mVba73opqq+sSfAHF6midcuc/3MR rknPg4P9wAsajiMNPYNT7gJ6DatT0rZKLBLV5dyYTH4he2AQC/WCcE97EOR16w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653816967; a=rsa-sha256; cv=none; b=wdxVN4SOGfmh1btKDEZ2KwM0oIaW9t9vr77fmFVUWJjfEKcp9eJcLhVMB+IlkVdBuV4FhS vEDl5e8MxMwvyYDZMh5adxRNni5RP6LdjhkFg1VHlh5scvtlFV9j1pn7f/7rGBKfJDftJm UdK4TJ035U9dv9cp8v2CRaNpVz+puQybKBXEKcw8lOABu+S+p3zEbTiqFAgWOj+sJA34Hc OLYp0MRJlhJWHepuK+RYnPBGq5pxV59Jn30RBeIdyPa6v3RFTbDaDEM25ea9HQKz8aaIxG E791vEr2YpolJtf6YoW9g8pmeNSKj49oWrxTbH7XX2EEelGhsfMLz02R1i1R5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D46441 Piotr Pawel Stefaniak changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pstef@freebsd.org --- Comment #13 from Piotr Pawel Stefaniak --- (In reply to Nathaniel Barragan from comment #11) I tried the naive approach to make the parser re-entrant by doing something like this static struct state { struct heredoc *heredoclist; /* list of here documents to read */ int doprompt; /* if set, prompt the user */ int needprompt; /* true if interactive and at start of line= */ int lasttoken; /* last token read */ int tokpushback; /* last token pushed back */ char *wordtext; /* text of last word returned by readtoken = */ int checkkwd; struct nodelist *backquotelist; union node *redirnode; struct heredoc *heredoc; int quoteflag; /* set if (part of) last token was quoted */ int startlinno; /* line # where last token started */ int funclinno; /* line # where the current function starte= d */ struct parser_temp *parser_temp; } states[2]; static size_t current; then referring to the fields in states[current] in place of the formerly fi= le scope identifiers, and also incrementing/decrementing current at the right times.=20 But I'm not exactly sure when those are. Also, there's the problem of expde= st invalidation on multiple calls to expandarg. --=20 You are receiving this mail because: You are on the CC list for the bug.=