The following commit has been merged in the master branch:
commit f4555325638412c9e5fc9b0925bc3fdc6e2b1d05
Author: Guillem Jover <[EMAIL PROTECTED]>
Date: Sun Jun 1 21:04:17 2008 +0300
dpkg-query: Use strpbrk instead of strcspn and strlen
diff --git a/ChangeLog b/ChangeLog
index 46b3549..43a6ec9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2008-06-01 Guillem Jover <[EMAIL PROTECTED]>
+ * src/query.c (searchfiles): Use strpbrk instead of strcspn and
+ strlen.
+
+2008-06-01 Guillem Jover <[EMAIL PROTECTED]>
+
* src/query.c: Include <dpkg-priv.h>.
(searchfiles): Trim trailing '/' and '/.' from file searches only
on path names, but not patterns.
diff --git a/src/query.c b/src/query.c
index 237945d..094f48e 100644
--- a/src/query.c
+++ b/src/query.c
@@ -280,7 +280,7 @@ void searchfiles(const char *const *argv) {
varbufaddc(&vb,0);
thisarg= vb.buf;
}
- if (strcspn(thisarg,"*[?\\") == strlen(thisarg)) {
+ if (!strpbrk(thisarg, "*[?\\")) {
namenode= findnamenode(thisarg, 0);
found += searchoutput(namenode);
} else {
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]