HomeFreeBSD

ps: handle incorrect -D values

Description

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.

(cherry picked from commit 3f0b80bc1537c257f3bd68592832ec8cb65e1c58)

Details

Provenance
jamie_catflap.orgAuthored on Apr 23 2024, 4:44 PM
olceCommitted on May 1 2025, 7:35 PM
Parents
rG0a1d13469cd8: ps.1: update regarding -D option and -p x/d interaction
Branches
Unknown
Tags
Unknown