Skip to content

Commit 92fe441

Browse files
committed
Shell (SunOS): ignore leading -
1 parent 8ebc980 commit 92fe441

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/common/processing_linux.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,10 @@ void ffProcessGetInfoLinux(pid_t pid, FFstrbuf* processName, FFstrbuf* exe, cons
279279
psinfo_t proc;
280280
if (ffReadFileData(filePath, sizeof(proc), &proc) == sizeof(proc))
281281
{
282-
ffStrbufSetS(exe, proc.pr_psargs);
283-
ffStrbufSubstrBeforeFirstC(exe, ' ');
282+
const char* args = proc.pr_psargs;
283+
if (args[0] == '-') ++args;
284+
const char* end = strchr(args, ' ');
285+
ffStrbufSetNS(exe, end ? (uint32_t) (end - args) : (uint32_t) strlen(args), args);
284286
}
285287

286288
if (exePath)

0 commit comments

Comments
 (0)