Don't prepend "/dev" if an argument given is an absolute pathname.
Reviewed by: jhb
This commit is contained in:
parent
54df531327
commit
26cd344960
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136720
@ -302,7 +302,7 @@ main(int argc, char *argv[])
|
|||||||
if (stat(argv[0], &sb) == 0) {
|
if (stat(argv[0], &sb) == 0) {
|
||||||
/* OK, full pathname given */
|
/* OK, full pathname given */
|
||||||
disk = argv[0];
|
disk = argv[0];
|
||||||
} else if (errno == ENOENT) {
|
} else if (errno == ENOENT && argv[0][0] != '/') {
|
||||||
/* Try prepending "/dev" */
|
/* Try prepending "/dev" */
|
||||||
asprintf(&disk, "%s%s", _PATH_DEV, argv[0]);
|
asprintf(&disk, "%s%s", _PATH_DEV, argv[0]);
|
||||||
if (disk == NULL)
|
if (disk == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user