Ignore leading '-' in command name for pidof(8)

This commit is contained in:
sin 2013-09-02 15:00:59 +01:00
parent c14983072b
commit 163a17a835
1 changed files with 2 additions and 0 deletions

View File

@ -82,6 +82,8 @@ main(int argc, char *argv[])
*p = '\0';
cmd = basename(cmdline);
}
if (cmd[0] == '-')
cmd++;
for (i = 0; i < argc; i++) {
if (strcmp(cmd, argv[i]) == 0) {
putword(entry->d_name);