Compare commits

..

No commits in common. "a4f28850de1b6be51a8283187a259d05f0e9aa69" and "ad0a18e8a9a8857baab91e2b2b91946a7154a60f" have entirely different histories.

2 changed files with 7 additions and 5 deletions

View file

@ -16,7 +16,7 @@ for owner in {0..7}; do
for group in {0..7}; do for group in {0..7}; do
for universe in {0..7}; do for universe in {0..7}; do
printf 'chmod_%s() {\n' "$(perms "$owner" "$group" "$universe")" 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'
printf '\n' printf '\n'
done done

View file

@ -1,5 +1,5 @@
int match(const char *needle, const char *haystack) { int match(const char *needle, const char *haystack) {
while(*haystack || *needle) { while(*haystack) {
if(*needle == '*' && *(needle + 1) == '*') { if(*needle == '*' && *(needle + 1) == '*') {
needle += 1; needle += 1;
} else if(*needle == '*') { } else if(*needle == '*') {
@ -7,8 +7,6 @@ int match(const char *needle, const char *haystack) {
return 1; return 1;
} else if(*(needle + 1) == *haystack) { } else if(*(needle + 1) == *haystack) {
needle += 1; needle += 1;
} else if(*haystack == '\0') {
needle += 1;
} else { } else {
haystack += 1; 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) { int main(int argc, char **argv) {