projects
/
trust_router.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
96378f5
)
Clean up wildcard match code, add debugging printf
author
Margaret Wasserman
<margaret@moonshot-proxy>
Tue, 9 Jul 2013 22:26:34 +0000
(18:26 -0400)
committer
Margaret Wasserman
<margaret@moonshot-proxy>
Tue, 9 Jul 2013 22:26:34 +0000
(18:26 -0400)
common/tr_filter.c
patch
|
blob
|
history
diff --git
a/common/tr_filter.c
b/common/tr_filter.c
index
857ac5b
..
fd3171a
100644
(file)
--- a/
common/tr_filter.c
+++ b/
common/tr_filter.c
@@
-32,6
+32,7
@@
*
*/
*
*/
+#include <stdio.h>
#include <string.h>
#include <tr_filter.h>
#include <string.h>
#include <tr_filter.h>
@@
-45,16
+46,14
@@
int tr_prefix_wildcard_match (char *str, char *wc_str) {
if ((!str) || (!wc_str))
return 0;
if ((!str) || (!wc_str))
return 0;
+ fprintf(stderr, "tr_prefix_wildcard_match: str = %s, wc_str = %s\n", str, wc_str);
+
/* TBD -- skip leading white space? */
if ('*' == wc_str[0])
wc_post = &(wc_str[1]);
len = strlen(str);
/* TBD -- skip leading white space? */
if ('*' == wc_str[0])
wc_post = &(wc_str[1]);
len = strlen(str);
- /* Everything matches an empty string or "*" */
- if (0 == (wc_len = strlen(wc_post)))
- return 1;
- if (wc_len > len)
- return 0;
+ wc_len = strlen(wc_post);
if (!strcmp(&(str[len-wc_len]), wc_post)) {
return 1;
if (!strcmp(&(str[len-wc_len]), wc_post)) {
return 1;