X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=selector.c;h=0efdd1cc800dbf8de7004d500af41bb19c48275e;hb=089bd5db84375cdc0223df056aea8a4f63bbbf79;hp=afd5ce7bf8e26286a02d2bbf788916cd5de72b07;hpb=a23a5c1fb2dad7e1f08877e775d7c2589b1b556c;p=selector.git diff --git a/selector.c b/selector.c index afd5ce7..0efdd1c 100644 --- a/selector.c +++ b/selector.c @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -339,7 +340,7 @@ int add_interval(int n, int *switches, int start, int end) { while(g < n && switches[g] <= end) { g++; } if(f == n) { - /* switches[n-1] start end */ + /* switches[f-1] start end */ /* XXXXXXXXXXXX| */ switches[f] = start; switches[f+1] = end; @@ -1009,6 +1010,9 @@ int main(int argc, char **argv) { struct hash_table_t *hash_table; char *bash_histsize; + /* Group and others have no access to created files */ + umask(S_IRWXG | S_IRWXO); + if(!isatty(STDIN_FILENO)) { fprintf(stderr, "selector: The standard input is not a tty.\n"); exit(EXIT_FAILURE);