Introduction
Introduction Statistics Contact Development Disclaimer Help
Explicitly check for REG_NOMATCH - smdev - suckless mdev
git clone git://git.suckless.org/smdev
Log
Files
Refs
README
LICENSE
---
commit 306560e3dbc8602dfbd44bc5c4abdd650fc4fdaa
parent 9ad57d03f120e0d6f9751bb8105cbd2da19c5bd0
Author: sin <[email protected]>
Date: Thu, 22 Aug 2013 18:56:36 +0100
Explicitly check for REG_NOMATCH
Diffstat:
M smdev.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/smdev.c b/smdev.c
@@ -132,10 +132,9 @@ matchrule(int ruleidx, char *devname)
pregcache[ruleidx].cached = 1;
}
match = &pregcache[ruleidx].preg;
-
ret = regexec(match, devname, 1, &off, 0);
-
- if (ret || off.rm_so || off.rm_eo != strlen(devname))
+ if (ret == REG_NOMATCH || off.rm_so ||
+ off.rm_eo != strlen(devname))
return -1;
return 0;
}
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.