Module Name:    src
Committed By:   drochner
Date:           Mon Aug  1 10:33:26 UTC 2011

Modified Files:
        src/sys/kern: subr_userconf.c

Log Message:
modify parsing of device names so that it can deal with names which
have numbers is it, eg "i915drm*"


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/kern/subr_userconf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/subr_userconf.c
diff -u src/sys/kern/subr_userconf.c:1.24 src/sys/kern/subr_userconf.c:1.25
--- src/sys/kern/subr_userconf.c:1.24	Tue May 31 23:28:53 2011
+++ src/sys/kern/subr_userconf.c	Mon Aug  1 10:33:26 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_userconf.c,v 1.24 2011/05/31 23:28:53 dyoung Exp $	*/
+/*	$NetBSD: subr_userconf.c,v 1.25 2011/08/01 10:33:26 drochner Exp $	*/
 
 /*
  * Copyright (c) 1996 Mats O Jansson <m...@stacken.kth.se>
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_userconf.c,v 1.24 2011/05/31 23:28:53 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_userconf.c,v 1.25 2011/08/01 10:33:26 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -304,10 +304,16 @@
 	char *c;
 
 	c = cmd;
-	while (*c >= 'a' && *c <= 'z') {
-		l++;
+	while (!(!*c || *c == ' ' || *c == '\t' || *c == '\n'))
 		c++;
+	while (c > cmd) {
+		c--;
+		if (!((*c >= '0' && *c <= '9') || *c == '*')) {
+			c++;
+			break;
+		}
 	}
+	l = c - cmd;
 	if (*c == '*') {
 		s = FSTATE_STAR;
 		c++;

Reply via email to