summaryrefslogtreecommitdiffstats
path: root/sbin/newfs_msdos
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-04-11 14:56:29 +0000
committered <ed@FreeBSD.org>2009-04-11 14:56:29 +0000
commit9f29dae19863c273e4fd7e940dde3fc93339cdb5 (patch)
tree8fe837bd9b60c9f51ec52f619a16730ee1f318e6 /sbin/newfs_msdos
parentac65054d3a51a5c569eb674940555b51f7da64e0 (diff)
downloadFreeBSD-src-9f29dae19863c273e4fd7e940dde3fc93339cdb5.zip
FreeBSD-src-9f29dae19863c273e4fd7e940dde3fc93339cdb5.tar.gz
Do not prepend /dev/ when -C is used.
Submitted by: Christoph Mallon <christoph mallon gmx de>
Diffstat (limited to 'sbin/newfs_msdos')
-rw-r--r--sbin/newfs_msdos/newfs_msdos.810
-rw-r--r--sbin/newfs_msdos/newfs_msdos.c2
2 files changed, 7 insertions, 5 deletions
diff --git a/sbin/newfs_msdos/newfs_msdos.8 b/sbin/newfs_msdos/newfs_msdos.8
index 213b09d..a48cf70 100644
--- a/sbin/newfs_msdos/newfs_msdos.8
+++ b/sbin/newfs_msdos/newfs_msdos.8
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 8, 2007
+.Dd April 11, 2009
.Dt NEWFS_MSDOS 8
.Os
.Sh NAME
@@ -72,9 +72,11 @@ to determine geometry, if required.
If
.Ar special
does not contain a
-.Ar / ,
-it is assumed to be a device name and
-.Ar /dev
+.Ar /
+and
+.Fl C
+is not used, it is assumed to be a device name and
+.Ar /dev/
is prepended to the name to construct the actual device name.
To work a file in the current directory use
.Ar ./filename
diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c
index 091cf4c..f09578a 100644
--- a/sbin/newfs_msdos/newfs_msdos.c
+++ b/sbin/newfs_msdos/newfs_msdos.c
@@ -349,7 +349,7 @@ main(int argc, char *argv[])
if (argc < 1 || argc > 2)
usage();
fname = *argv++;
- if (!strchr(fname, '/')) {
+ if (!opt_create && !strchr(fname, '/')) {
snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname);
if (!(fname = strdup(buf)))
err(1, NULL);
OpenPOWER on IntegriCloud