svn commit: trunk/busybox: testsuite util-linux
vda at busybox.net
vda at busybox.net
Mon Jan 12 07:57:53 UTC 2009
Author: vda
Date: 2009-01-12 07:57:52 +0000 (Mon, 12 Jan 2009)
New Revision: 24785
Log:
mdev: fix breakage caused by unified parser usage
Modified:
trunk/busybox/testsuite/mdev.tests
trunk/busybox/util-linux/mdev.c
Changeset:
Modified: trunk/busybox/testsuite/mdev.tests
===================================================================
--- trunk/busybox/testsuite/mdev.tests 2009-01-12 07:45:02 UTC (rev 24784)
+++ trunk/busybox/testsuite/mdev.tests 2009-01-12 07:57:52 UTC (rev 24785)
@@ -111,6 +111,22 @@
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
+echo "sda 0:0 644 =block/ @echo @echo TEST" >mdev.testdir/etc/mdev.conf
+testing "mdev move and command" \
+ "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
+ ls -lnR mdev.testdir/dev | $FILTER_LS2" \
+"\
+ at echo TEST
+mdev.testdir/dev:
+drwxr-xr-x 2 0 0 block
+
+mdev.testdir/dev/block:
+brw-r--r-- 1 0 0 sda
+" \
+ "" ""
+
+# continuing to use directory structure from prev test
+rm -rf mdev.testdir/dev/*
echo "@8,0 :1 644" >mdev.testdir/etc/mdev.conf
testing "mdev #maj,min and no explicit uid" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
Modified: trunk/busybox/util-linux/mdev.c
===================================================================
--- trunk/busybox/util-linux/mdev.c 2009-01-12 07:45:02 UTC (rev 24784)
+++ trunk/busybox/util-linux/mdev.c 2009-01-12 07:57:52 UTC (rev 24785)
@@ -179,8 +179,9 @@
unsigned i, n;
#endif
char *a = val;
- s = strchr(val, ' ');
- val = (s && s[1]) ? s+1 : NULL;
+ s = strchrnul(val, ' ');
+ val = (s[0] && s[1]) ? s+1 : NULL;
+ s[0] = '\0';
#if ENABLE_FEATURE_MDEV_RENAME_REGEXP
/* substitute %1..9 with off[1..9], if any */
n = 0;
More information about the busybox-cvs
mailing list