Move the 'not' operator to the proper location
This commit is contained in:
parent
a4000ec9b3
commit
201e9b0eae
|
@ -1,5 +1,3 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int match(const char *needle, const char *haystack) {
|
||||
while(*haystack) {
|
||||
if(*needle == '*' && *(needle + 1) == '*') {
|
||||
|
@ -20,7 +18,7 @@ int match(const char *needle, const char *haystack) {
|
|||
}
|
||||
}
|
||||
|
||||
return *needle != '\0';
|
||||
return *needle == '\0';
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
@ -28,5 +26,5 @@ int main(int argc, char **argv) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
return match(argv[1], argv[2]);
|
||||
return !match(argv[1], argv[2]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue