From: Andrew M. <fit...@us...> - 2006-04-25 20:24:13
|
Update of /cvsroot/radmind/radmind-assistant/rte In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9202 Modified Files: UMWildcard.m Log Message: Allow searching for patterns not matching the search string (!pattern) Index: UMWildcard.m =================================================================== RCS file: /cvsroot/radmind/radmind-assistant/rte/UMWildcard.m,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UMWildcard.m 24 Feb 2006 21:42:03 -0000 1.1 --- UMWildcard.m 25 Apr 2006 20:24:08 -0000 1.2 *************** *** 99,103 **** unsigned int len; int case_sensitive = 1; ! int match; if ( self == nil || wild == nil ) { --- 99,103 ---- unsigned int len; int case_sensitive = 1; ! int match, invcmp = 0; if ( self == nil || wild == nil ) { *************** *** 127,130 **** --- 127,135 ---- return( NO ); } + if ( [ wild characterAtIndex: 0 ] == '!' ) { /* find all not matching */ + invcmp = 1; + len--; + range.location++; + } memset( wildbuf, '\0', sizeof( wildbuf )); range.length = len; *************** *** 138,142 **** match = wildcard( wildbuf, buf, case_sensitive ); ! if ( match ) { matches = YES; } --- 143,149 ---- match = wildcard( wildbuf, buf, case_sensitive ); ! if ( match && !invcmp ) { ! matches = YES; ! } else if ( !match && invcmp ) { matches = YES; } |