Don't prepend "/dev" if an argument given is an absolute pathname.

Reviewed by:	jhb
This commit is contained in:
Ruslan Ermilov 2004-10-20 05:43:45 +00:00
parent 54df531327
commit 26cd344960

View File

@ -302,7 +302,7 @@ main(int argc, char *argv[])
if (stat(argv[0], &sb) == 0) {
/* OK, full pathname given */
disk = argv[0];
} else if (errno == ENOENT) {
} else if (errno == ENOENT && argv[0][0] != '/') {
/* Try prepending "/dev" */
asprintf(&disk, "%s%s", _PATH_DEV, argv[0]);
if (disk == NULL)