mirror of
https://github.com/sheumann/hush.git
synced 2024-12-24 12:29:47 +00:00
uncuddle if statements
This commit is contained in:
parent
f284c767e5
commit
00d10a94f3
@ -215,7 +215,7 @@ static void data_readlines(void)
|
|||||||
for (i = 0; (feof(fp)==0) && (i <= MAXLINES); i++) {
|
for (i = 0; (feof(fp)==0) && (i <= MAXLINES); i++) {
|
||||||
strcpy(current_line, "");
|
strcpy(current_line, "");
|
||||||
fgets(current_line, 256, fp);
|
fgets(current_line, 256, fp);
|
||||||
if(fp != stdin)
|
if (fp != stdin)
|
||||||
bb_xferror(fp, filename);
|
bb_xferror(fp, filename);
|
||||||
flines = xrealloc(flines, (i+1) * sizeof(char *));
|
flines = xrealloc(flines, (i+1) * sizeof(char *));
|
||||||
flines[i] = bb_xstrdup(current_line);
|
flines[i] = bb_xstrdup(current_line);
|
||||||
@ -229,7 +229,7 @@ static void data_readlines(void)
|
|||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
if(inp == NULL)
|
if (inp == NULL)
|
||||||
inp = (inp_stdin) ? bb_xfopen(CURRENT_TTY, "r") : stdin;
|
inp = (inp_stdin) ? bb_xfopen(CURRENT_TTY, "r") : stdin;
|
||||||
|
|
||||||
if (flags & FLAG_N)
|
if (flags & FLAG_N)
|
||||||
@ -358,7 +358,7 @@ static void buffer_init(void)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
/* malloc the number of lines needed for the buffer */
|
/* malloc the number of lines needed for the buffer */
|
||||||
buffer = xrealloc(buffer, height * sizeof(char *));
|
buffer = xrealloc(buffer, height * sizeof(char *));
|
||||||
} else {
|
} else {
|
||||||
@ -677,8 +677,8 @@ static void regex_process(void)
|
|||||||
uncomp_regex[0] = 0;
|
uncomp_regex[0] = 0;
|
||||||
fgets(uncomp_regex, sizeof(uncomp_regex), stdin);
|
fgets(uncomp_regex, sizeof(uncomp_regex), stdin);
|
||||||
i = strlen(uncomp_regex);
|
i = strlen(uncomp_regex);
|
||||||
if(i > 0) {
|
if (i > 0) {
|
||||||
if(uncomp_regex[i-1] == '\n')
|
if (uncomp_regex[i-1] == '\n')
|
||||||
uncomp_regex[i-1] = '\0';
|
uncomp_regex[i-1] = '\0';
|
||||||
else
|
else
|
||||||
while((i = getchar()) != '\n' && i != EOF);
|
while((i = getchar()) != '\n' && i != EOF);
|
||||||
|
Loading…
Reference in New Issue
Block a user