Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern modify parsing of device names so that it can deal ...
details: https://anonhg.NetBSD.org/src/rev/ce7ad67489df
branches: trunk
changeset: 767840:ce7ad67489df
user: drochner <drochner%NetBSD.org@localhost>
date: Mon Aug 01 10:33:26 2011 +0000
description:
modify parsing of device names so that it can deal with names which
have numbers is it, eg "i915drm*"
diffstat:
sys/kern/subr_userconf.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diffs (37 lines):
diff -r 98b8275c21a7 -r ce7ad67489df sys/kern/subr_userconf.c
--- a/sys/kern/subr_userconf.c Mon Aug 01 10:21:32 2011 +0000
+++ b/sys/kern/subr_userconf.c Mon Aug 01 10:33:26 2011 +0000
@@ -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 <moj%stacken.kth.se@localhost>
@@ -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++;
Home |
Main Index |
Thread Index |
Old Index