Skip to content

Commit 8774fb3

Browse files
committed
Shell (OpenBSD): trim - for login shells
1 parent 3565012 commit 8774fb3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/common/processing_linux.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,12 @@ void ffProcessGetInfoLinux(pid_t pid, FFstrbuf* processName, FFstrbuf* exe, cons
301301
if (proc)
302302
{
303303
char** argv = kvm_getargv(kd, proc, 0);
304-
if (argv) ffStrbufSetS(exe, argv[0]);
304+
if (argv)
305+
{
306+
const char* arg0 = argv[0];
307+
if (arg0[0] == '-') arg0++;
308+
ffStrbufSetS(exe, arg0);
309+
}
305310
}
306311
kvm_close(kd);
307312

0 commit comments

Comments
 (0)