From 304876f035aec43b1760b405c77a7f294b73ca0d Mon Sep 17 00:00:00 2001 From: imp Date: Mon, 21 Apr 2003 04:00:01 +0000 Subject: o Skip white space between variables better. This makes 'a="b" c="d" at loc=1 on busN' properly set 'c' and process the rest of the stirng. Before it would ignore everything after variable 'a'. o Parse nomatch and other events differently. They are more different than the code allowed for, so we weren't properly parsing nomatch events. It appears this fixes some of the demand loading issues that I was having with devd. Noticed by: Gary Palmer --- sbin/devd/devd.cc | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'sbin/devd') diff --git a/sbin/devd/devd.cc b/sbin/devd/devd.cc index 7ddd726..9a0ea0e 100644 --- a/sbin/devd/devd.cc +++ b/sbin/devd/devd.cc @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2002 M. Warner Losh. + * Copyright (c) 2002-2003 M. Warner Losh. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -572,6 +572,8 @@ config::chop_var(char *&buffer, char *&lhs, char *&rhs) *walker++ = '\0'; rhs[-1] = '\0'; } + while (isspace(*walker)) + walker++; buffer = walker; return (true); } @@ -645,12 +647,21 @@ process_event(char *buffer) return; /* Can't happen? */ *sp++ = '\0'; cfg.set_variable("device-name", buffer); + if (strncmp(sp, "at ", 3) == 0) + sp += 3; + sp = cfg.set_vars(sp); + if (strncmp(sp, "on ", 3) == 0) + cfg.set_variable("bus", sp + 3); + } else { + //?vars at location on bus + sp = cfg.set_vars(sp); + if (strncmp(sp, "at ", 3) == 0) + sp += 3; + sp = cfg.set_vars(sp); + if (strncmp(sp, "on ", 3) == 0) + cfg.set_variable("bus", sp + 3); } - if (strncmp(sp, "at ", 3) == 0) - sp += 3; - sp = cfg.set_vars(sp); - if (strncmp(sp, "on ", 3) == 0) - cfg.set_variable("bus", sp + 3); + cfg.find_and_execute(type); cfg.pop_var_table(); } -- cgit v1.1