aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-01-12 07:57:52 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-01-12 07:57:52 +0000
commit319fe129a15278193625eeb05752511d576c5588 (patch)
tree4587f23bff0fa8e5604a411f038dec5b7436b9a5
parentf0dc2c1d5c01cffd2e60c964df95a3bdecffe141 (diff)
downloadbusybox-w32-319fe129a15278193625eeb05752511d576c5588.tar.gz
busybox-w32-319fe129a15278193625eeb05752511d576c5588.tar.bz2
busybox-w32-319fe129a15278193625eeb05752511d576c5588.zip
mdev: fix breakage caused by unified parser usage
-rwxr-xr-xtestsuite/mdev.tests16
-rw-r--r--util-linux/mdev.c5
2 files changed, 19 insertions, 2 deletions
diff --git a/testsuite/mdev.tests b/testsuite/mdev.tests
index 22855791a..90379e668 100755
--- a/testsuite/mdev.tests
+++ b/testsuite/mdev.tests
@@ -111,6 +111,22 @@ brw-r--r-- 1 0 0 8,0 sda
111 111
112# continuing to use directory structure from prev test 112# continuing to use directory structure from prev test
113rm -rf mdev.testdir/dev/* 113rm -rf mdev.testdir/dev/*
114echo "sda 0:0 644 =block/ @echo @echo TEST" >mdev.testdir/etc/mdev.conf
115testing "mdev move and command" \
116 "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
117 ls -lnR mdev.testdir/dev | $FILTER_LS2" \
118"\
119@echo TEST
120mdev.testdir/dev:
121drwxr-xr-x 2 0 0 block
122
123mdev.testdir/dev/block:
124brw-r--r-- 1 0 0 sda
125" \
126 "" ""
127
128# continuing to use directory structure from prev test
129rm -rf mdev.testdir/dev/*
114echo "@8,0 :1 644" >mdev.testdir/etc/mdev.conf 130echo "@8,0 :1 644" >mdev.testdir/etc/mdev.conf
115testing "mdev #maj,min and no explicit uid" \ 131testing "mdev #maj,min and no explicit uid" \
116 "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; 132 "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index 9ad1a6ff2..0460aa777 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -179,8 +179,9 @@ static void make_device(char *path, int delete)
179 unsigned i, n; 179 unsigned i, n;
180#endif 180#endif
181 char *a = val; 181 char *a = val;
182 s = strchr(val, ' '); 182 s = strchrnul(val, ' ');
183 val = (s && s[1]) ? s+1 : NULL; 183 val = (s[0] && s[1]) ? s+1 : NULL;
184 s[0] = '\0';
184#if ENABLE_FEATURE_MDEV_RENAME_REGEXP 185#if ENABLE_FEATURE_MDEV_RENAME_REGEXP
185 /* substitute %1..9 with off[1..9], if any */ 186 /* substitute %1..9 with off[1..9], if any */
186 n = 0; 187 n = 0;