Compare commits
2 Commits
ad0a18e8a9
...
a4f28850de
Author | SHA1 | Date |
---|---|---|
Nick Chambers | a4f28850de | |
Nick Chambers | 652e40da30 |
|
@ -16,7 +16,7 @@ for owner in {0..7}; do
|
|||
for group in {0..7}; do
|
||||
for universe in {0..7}; do
|
||||
printf 'chmod_%s() {\n' "$(perms "$owner" "$group" "$universe")"
|
||||
printf ' chmod %d%d%d "$@"\n' "$owner" "$group" "$universe"
|
||||
printf ' chmod %d%d%d "$@"\n' "$owner" "$group" "$universe"
|
||||
printf '}\n'
|
||||
printf '\n'
|
||||
done
|
||||
|
|
10
c/cosmic.c
10
c/cosmic.c
|
@ -1,5 +1,5 @@
|
|||
int match(const char *needle, const char *haystack) {
|
||||
while(*haystack) {
|
||||
while(*haystack || *needle) {
|
||||
if(*needle == '*' && *(needle + 1) == '*') {
|
||||
needle += 1;
|
||||
} else if(*needle == '*') {
|
||||
|
@ -7,6 +7,8 @@ int match(const char *needle, const char *haystack) {
|
|||
return 1;
|
||||
} else if(*(needle + 1) == *haystack) {
|
||||
needle += 1;
|
||||
} else if(*haystack == '\0') {
|
||||
needle += 1;
|
||||
} else {
|
||||
haystack += 1;
|
||||
}
|
||||
|
@ -18,11 +20,7 @@ int match(const char *needle, const char *haystack) {
|
|||
}
|
||||
}
|
||||
|
||||
while(*needle == '*') {
|
||||
needle += 1;
|
||||
}
|
||||
|
||||
return *needle == '\0';
|
||||
return 1;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
|
Loading…
Reference in New Issue