From nobody Mon May 06 17:14:17 2024 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 4VY7LK6XKtz5Kc7p; Mon, 06 May 2024 17:14:17 +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 4VY7LK5gGMz4hjm; Mon, 6 May 2024 17:14:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715015657; 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=fcXrGjW4mqG06dtQqqCuFxx7bjG/Bc10RKuVUts3QHM=; b=VnOe9v4jsIcpO8mdPLQUeja4oTQTM6/j3agIDlaWhW0hsvl18099mrLNaocCScdpMLggA6 vgN50aqm9E1OoPLY4Ox+LWGlR6fN9Q6Ag8yM0qblR9dcgzg1fXiwkaw8Gs2U+envEN9Xss 7lyDhA1OojlUwBEt1r+G+zlw5FgG3CwaK6MFwh2j0RNUEHAqX3IuY5jff6qDVhb4tKFLwR 61GVc0IG8nYT0G0aCl8+U6axeAma8ac7Qr9bXgmibsYDlsUDztmDmAygBuFJxJQ+RT39GS xYCHQxWBU/Mm6XoBD1F9e8fBTUvHIAo1a6kSV76Gm1QMySyhFBVrligTfSlw0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715015657; a=rsa-sha256; cv=none; b=hMv20MyboLcWYGDdQnDB7JKEHxXqtstWPLKnltMMs4XSzlpkLswO7BKsswOurG2MOOHkPQ CSzzLF4vNFpGusHZrtCuo4tsFZK7lvrXgZ2MI90pOadgvgu0kgoHadXtNAyzIRjfy5j6Gi 3SWB2QVDgcC0rEzQRksWnoa+IvBRHo6VoZiH+Tu0Wa2XhvBmFMDdbN8tH+VrDsO/r/C8Ki 0g/3E7QqRlWxPKmkr17DuepW5+IsKhaXF/2QHzRElL/2TtusVbWzC/phleMePqdn7QOkmd 4/SXLIGA+fJPfki8xRs7r8jLeWOGS4VyJTtVmjVM2TEki9CEtnkb/empAb+wRA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715015657; 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=fcXrGjW4mqG06dtQqqCuFxx7bjG/Bc10RKuVUts3QHM=; b=Ef0RY7BiOP5f1vTnooJUew2k5KWIvTaOPoAW++asV8sT9oWuQYuvwGk5eSnyh2BDg2rLG3 o5FWBFxrAx3jlEgFx/pbiDD2ExxztuL6pko9GC67uLDsGg9LH90I+nigl1B1/LU+DyW3uX TrWCRJ4anHgCUO1fGLWwvJt99nEJN5LFhhNvluEDD1KURGcJlQDq6ljg16bvKLWgzcDBzg /fKRTF1WdWoxSV1o7yW67WgY/PFBUTTtA4Hav+eMP6LpURdq1zGkfwCEPKIl//ePAsl3Vk GmJOTqRfktl1DvNL33dRvQEGLMDxndTM0fzwVFp4UwyqDEkT0BBPEDQxZCW5+w== 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 4VY7LK5GjJz15v7; Mon, 6 May 2024 17:14:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 446HEHtO024101; Mon, 6 May 2024 17:14:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 446HEHnL024098; Mon, 6 May 2024 17:14:17 GMT (envelope-from git) Date: Mon, 6 May 2024 17:14:17 GMT Message-Id: <202405061714.446HEHnL024098@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 3f0b80bc1537 - main - ps: handle incorrect -D values 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3f0b80bc1537c257f3bd68592832ec8cb65e1c58 Auto-Submitted: auto-generated The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=3f0b80bc1537c257f3bd68592832ec8cb65e1c58 commit 3f0b80bc1537c257f3bd68592832ec8cb65e1c58 Author: Jamie Landeg-Jones AuthorDate: 2024-04-23 16:44:36 +0000 Commit: Piotr Paweł Stefaniak CommitDate: 2024-05-06 17:13:35 +0000 ps: handle incorrect -D values I just noticed a slight issue with the '-D' option. Basically, I accidentally typed something along the lines of: ps -Dboth-p303 I.E. missing out the "space". Instead of giving an error, it behaved as if I'd just typed "ps". Looking at bin/ps/ps.c, where the -D option is parsed, it doesn't error-out if there is no valid match. This commit fixes the bug. --- bin/ps/ps.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/ps/ps.c b/bin/ps/ps.c index cbee10c20d53..53ace6247b33 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -263,6 +263,8 @@ main(int argc, char *argv[]) else if (len <= 4 && strncasecmp(optarg, "both", len) == 0) directions |= BOTH; + else + usage(); break; } case 'd':