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
426e6d37
Commit
426e6d37
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
startup: don't try placing the cursor when reading standard input failed
And rename the function while there anyway.
parent
4dd9aadf
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nano.c
+8
-6
src/nano.c
with
8 additions
and
6 deletions
+8
-6
src/nano.c
View file @
426e6d37
...
...
@@ -1113,8 +1113,8 @@ RETSIGTYPE cancel_stdin_pager(int signal)
pager_input_aborted
=
TRUE
;
}
/*
Let nano read stdin for the first file at least
. */
void
stdin_pager
(
void
)
/*
Read whatever comes from standard input into a new buffer
. */
bool
scoop_stdin
(
void
)
{
FILE
*
stream
;
int
thetty
;
...
...
@@ -1151,7 +1151,7 @@ void stdin_pager(void)
terminal_init
();
doupdate
();
statusline
(
ALERT
,
_
(
"Failed to open stdin: %s"
),
strerror
(
errnumber
));
return
;
return
FALSE
;
}
/* Read the input into a new buffer. */
...
...
@@ -1174,6 +1174,7 @@ void stdin_pager(void)
terminal_init
();
doupdate
();
set_modified
();
return
TRUE
;
}
/* Register half a dozen signal handlers. */
...
...
@@ -2534,10 +2535,11 @@ int main(int argc, char **argv)
statusline
(
ALERT
,
_
(
"Invalid line or column number"
));
}
/* If the filename is a dash, read from standard input
. O
therwise,
* open the file
, but
skip positioning the cursor if it failed. */
/* If the filename is a dash, read from standard input
; o
therwise,
* open the file
;
skip positioning the cursor if
e
it
her
failed. */
if
(
strcmp
(
argv
[
optind
],
"-"
)
==
0
)
{
stdin_pager
();
if
(
!
scoop_stdin
())
continue
;
optind
++
;
}
else
if
(
!
open_buffer
(
argv
[
optind
++
],
FALSE
))
continue
;
...
...
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