Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
5ebdd3fe
Commit
5ebdd3fe
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: reduce the scope of three variables, and rename them besides
parent
426e6d37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nano.c
+13
-13
src/nano.c
with
13 additions
and
13 deletions
+13
-13
src/nano.c
View file @
5ebdd3fe
...
...
@@ -1100,10 +1100,6 @@ void do_cancel(void)
;
}
static
struct
sigaction
pager_oldaction
,
pager_newaction
;
/* Original and temporary handlers for SIGINT. */
static
bool
pager_sig_failed
=
FALSE
;
/* Did sigaction() fail without changing the signal handlers? */
static
bool
pager_input_aborted
=
FALSE
;
/* Did someone invoke the pager and abort it via ^C? */
...
...
@@ -1116,13 +1112,17 @@ RETSIGTYPE cancel_stdin_pager(int signal)
/* Read whatever comes from standard input into a new buffer. */
bool
scoop_stdin
(
void
)
{
struct
sigaction
oldaction
,
newaction
;
/* Original and temporary handlers for SIGINT. */
bool
setup_failed
=
FALSE
;
/* Whether setting up the SIGINT handler failed. */
FILE
*
stream
;
int
thetty
;
/* Exit from curses mode and put the terminal into its original state. */
endwin
();
tcsetattr
(
0
,
TCSANOW
,
&
oldterm
);
if
(
!
pager_input_aborted
)
tcsetattr
(
0
,
TCSANOW
,
&
oldterm
);
fprintf
(
stderr
,
_
(
"Reading from stdin, ^C to abort
\n
"
));
#ifndef NANO_TINY
...
...
@@ -1131,14 +1131,14 @@ bool scoop_stdin(void)
enable_signals
();
#endif
/* Set things up so that SIGINT will cancel the
new process
. */
if
(
sigaction
(
SIGINT
,
NULL
,
&
pager_
newaction
)
==
-
1
)
{
pager_sig
_failed
=
TRUE
;
/* Set things up so that SIGINT will cancel the
reading
. */
if
(
sigaction
(
SIGINT
,
NULL
,
&
newaction
)
==
-
1
)
{
setup
_failed
=
TRUE
;
nperror
(
"sigaction"
);
}
else
{
pager_
newaction
.
sa_handler
=
cancel_stdin_pager
;
if
(
sigaction
(
SIGINT
,
&
pager_
newaction
,
&
pager_
oldaction
)
==
-
1
)
{
pager_sig
_failed
=
TRUE
;
newaction
.
sa_handler
=
cancel_stdin_pager
;
if
(
sigaction
(
SIGINT
,
&
newaction
,
&
oldaction
)
==
-
1
)
{
setup
_failed
=
TRUE
;
nperror
(
"sigaction"
);
}
}
...
...
@@ -1168,7 +1168,7 @@ bool scoop_stdin(void)
if
(
!
pager_input_aborted
)
tcgetattr
(
0
,
&
oldterm
);
if
(
!
pager_sig
_failed
&&
sigaction
(
SIGINT
,
&
pager_
oldaction
,
NULL
)
==
-
1
)
if
(
!
setup
_failed
&&
sigaction
(
SIGINT
,
&
oldaction
,
NULL
)
==
-
1
)
nperror
(
"sigaction"
);
terminal_init
();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help