Compare commits
No commits in common. "a4f28850de1b6be51a8283187a259d05f0e9aa69" and "ad0a18e8a9a8857baab91e2b2b91946a7154a60f" have entirely different histories.
a4f28850de
...
ad0a18e8a9
2 changed files with 7 additions and 5 deletions
|
@ -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 || *needle) {
|
||||
while(*haystack) {
|
||||
if(*needle == '*' && *(needle + 1) == '*') {
|
||||
needle += 1;
|
||||
} else if(*needle == '*') {
|
||||
|
@ -7,8 +7,6 @@ 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;
|
||||
}
|
||||
|
@ -20,7 +18,11 @@ int match(const char *needle, const char *haystack) {
|
|||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
while(*needle == '*') {
|
||||
needle += 1;
|
||||
}
|
||||
|
||||
return *needle == '\0';
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
|
Loading…
Reference in a new issue