File tree Expand file tree Collapse file tree 1 file changed +18
-18
lines changed Expand file tree Collapse file tree 1 file changed +18
-18
lines changed Original file line number Diff line number Diff line change 1
- #include "main.h"
1
+ #include "main.h"
2
2
3
3
/**
4
4
* wildcmp - Compares two strings considering the '*' wildcard.
9
9
*/
10
10
int wildcmp (char * s1 , char * s2 )
11
11
{
12
- if (* s2 == '*' )
13
- {
14
- if (* (s2 + 1 ) == '*' )
15
- return wildcmp (s1 , s2 + 1 );
16
- else if (* (s2 + 1 ) == '\0' )
17
- return 1 ;
18
- else if (* s1 == '\0' )
19
- return wildcmp (s1 , s2 + 1 );
20
- else
21
- return wildcmp (s1 , s2 + 1 ) || wildcmp (s1 + 1 , s2 );
22
- }
23
- else if (* s1 != * s2 )
24
- return 0 ;
25
- else if (* s1 == '\0' )
26
- return 1 ;
27
- else
28
- return wildcmp (s1 + 1 , s2 + 1 );
12
+ if (* s2 == '*' )
13
+ {
14
+ if (* (s2 + 1 ) == '*' )
15
+ return ( wildcmp (s1 , s2 + 1 ) );
16
+ else if (* (s2 + 1 ) == '\0' )
17
+ return ( 1 ) ;
18
+ else if (* s1 == '\0' )
19
+ return ( wildcmp (s1 , s2 + 1 ) );
20
+ else
21
+ return ( wildcmp (s1 , s2 + 1 ) || wildcmp (s1 + 1 , s2 ) );
22
+ }
23
+ else if (* s1 != * s2 )
24
+ return ( 0 ) ;
25
+ else if (* s1 == '\0' )
26
+ return ( 1 ) ;
27
+ else
28
+ return ( wildcmp (s1 + 1 , s2 + 1 ) );
29
29
}
You can’t perform that action at this time.
0 commit comments