Merged from src/sbin/fdisk/fdisk.c revision 1.75.

(Don't prepend "/dev" if an argument given is an absolute pathname.)
This commit is contained in:
Yoshihiro Takahashi 2004-10-24 12:05:10 +00:00
parent 1b0ee80834
commit a7d53c9cae
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136887

View File

@ -289,7 +289,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)