projects
/
selector.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1466e42
)
OCD cosmetics.
author
Francois Fleuret
<francois@fleuret.org>
Fri, 13 Mar 2015 07:15:42 +0000
(08:15 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Fri, 13 Mar 2015 07:15:42 +0000
(08:15 +0100)
selector.c
patch
|
blob
|
history
diff --git
a/selector.c
b/selector.c
index
94cd99e
..
ac80d93
100644
(file)
--- a/
selector.c
+++ b/
selector.c
@@
-3,7
+3,7
@@
* selector is a simple command line utility for selection of strings
* with a dynamic pattern-matching.
*
* selector is a simple command line utility for selection of strings
* with a dynamic pattern-matching.
*
- * Copyright (c) 2009-201
3
Francois Fleuret
+ * Copyright (c) 2009-201
5
Francois Fleuret
* Written by Francois Fleuret <francois@fleuret.org>
*
* This file is part of selector.
* Written by Francois Fleuret <francois@fleuret.org>
*
* This file is part of selector.
@@
-111,21
+111,21
@@
void inject_into_tty_buffer(char *string, int add_control_qs) {
/*********************************************************************/
void str_to_positive_integers(char *string, int *values, int nb) {
/*********************************************************************/
void str_to_positive_integers(char *string, int *values, int nb) {
- int current_value, gotone;
+ int current_value, got
_
one;
char *s;
int n;
n = 0;
current_value = 0;
char *s;
int n;
n = 0;
current_value = 0;
- gotone = 0;
+ got
_
one = 0;
s = string;
while(1) {
if(*s >= '0' && *s <= '9') {
current_value = current_value * 10 + (int) (*s - '0');
s = string;
while(1) {
if(*s >= '0' && *s <= '9') {
current_value = current_value * 10 + (int) (*s - '0');
- gotone = 1;
+ got
_
one = 1;
} else if(*s == ',' || *s == '\0') {
} else if(*s == ',' || *s == '\0') {
- if(gotone) {
+ if(got
_
one) {
if(n < nb) {
values[n++] = current_value;
if(*s == '\0') {
if(n < nb) {
values[n++] = current_value;
if(*s == '\0') {
@@
-138,7
+138,7
@@
void str_to_positive_integers(char *string, int *values, int nb) {
}
}
current_value = 0;
}
}
current_value = 0;
- gotone = 0;
+ got
_
one = 0;
} else {
fprintf(stderr,
"selector: Too many values in `%s'.\n", string);
} else {
fprintf(stderr,
"selector: Too many values in `%s'.\n", string);
@@
-960,8
+960,7
@@
void read_file(struct hash_table_t *hash_table,
/* For long options that have no equivalent short option, use a
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
/* For long options that have no equivalent short option, use a
non-character as a pseudo short option, starting with CHAR_MAX + 1. */
-enum
-{
+enum {
OPT_BASH_MODE = CHAR_MAX + 1
};
OPT_BASH_MODE = CHAR_MAX + 1
};
@@
-1010,14
+1009,14
@@
int main(int argc, char **argv) {
struct hash_table_t *hash_table;
char *bash_histsize;
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);
}
if(!isatty(STDIN_FILENO)) {
fprintf(stderr, "selector: The standard input is not a tty.\n");
exit(EXIT_FAILURE);
}
+ /* Group and others have no access to created files */
+ umask(S_IRWXG | S_IRWXO);
+
pattern[0] = '\0';
color_fg_modeline = COLOR_WHITE;
pattern[0] = '\0';
color_fg_modeline = COLOR_WHITE;