terminal-util: use PATH_STARTSWITH_SET() instead of plain startswith() where appropriate
After all, we deal with paths here.
This commit is contained in:
parent
b48a0e0956
commit
3ebc048b6b
|
@ -1014,11 +1014,8 @@ int get_ctty(pid_t pid, dev_t *_devnr, char **r) {
|
|||
return -ENOMEM;
|
||||
}
|
||||
} else {
|
||||
if (startswith(s, "/dev/"))
|
||||
p = s + 5;
|
||||
else if (startswith(s, "../"))
|
||||
p = s + 3;
|
||||
else
|
||||
p = PATH_STARTSWITH_SET(s, "/dev/", "../");
|
||||
if (!p)
|
||||
p = s;
|
||||
|
||||
b = strdup(p);
|
||||
|
|
Loading…
Reference in New Issue