diff options
author | ru <ru@FreeBSD.org> | 2004-10-20 05:43:45 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2004-10-20 05:43:45 +0000 |
commit | 7d75b385f41cca6e8f5982a618895ee1a13c5b74 (patch) | |
tree | d38ebf4e0618c14182d37eb7496785ca4c257067 /sbin/fdisk | |
parent | d6fa16e5b96331747743f50dbc90759b1825a657 (diff) | |
download | FreeBSD-src-7d75b385f41cca6e8f5982a618895ee1a13c5b74.zip FreeBSD-src-7d75b385f41cca6e8f5982a618895ee1a13c5b74.tar.gz |
Don't prepend "/dev" if an argument given is an absolute pathname.
Reviewed by: jhb
Diffstat (limited to 'sbin/fdisk')
-rw-r--r-- | sbin/fdisk/fdisk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c index 4cb9dc0..1a1ceb7 100644 --- a/sbin/fdisk/fdisk.c +++ b/sbin/fdisk/fdisk.c @@ -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) |