tweaks: fix a typo, remove a blank line, and improve some comments

master
Benno Schulenberg 2018-04-23 12:19:25 +02:00
parent 5b40bad629
commit 1e5064ef84
3 changed files with 6 additions and 12 deletions

View File

@ -227,7 +227,7 @@ char *get_history_completion(filestruct **h, char *s, size_t len)
* match, or len is 0. Return s. */ * match, or len is 0. Return s. */
return (char *)s; return (char *)s;
} }
#endif /* ENSABLE_TABCOMP */ #endif /* ENABLE_TABCOMP */
void history_error(const char *msg, ...) void history_error(const char *msg, ...)
{ {

View File

@ -1487,7 +1487,6 @@ void terminal_init(void)
if (!newterm_set) { if (!newterm_set) {
#endif #endif
raw(); raw();
nonl(); nonl();
noecho(); noecho();

View File

@ -1122,13 +1122,11 @@ bool execute_command(const char *command)
return FALSE; return FALSE;
} }
/* Before we start reading the forked command's output, we set /* Re-enable interpretation of the special control keys so that we get
* things up so that Ctrl-C will cancel the new process. */
/* Enable interpretation of the special control keys so that we get
* SIGINT when Ctrl-C is pressed. */ * SIGINT when Ctrl-C is pressed. */
enable_signals(); enable_signals();
/* Set things up so that Ctrl-C will terminate the forked process. */
if (sigaction(SIGINT, NULL, &newaction) == -1) { if (sigaction(SIGINT, NULL, &newaction) == -1) {
sig_failed = TRUE; sig_failed = TRUE;
nperror("sigaction"); nperror("sigaction");
@ -1140,9 +1138,6 @@ bool execute_command(const char *command)
} }
} }
/* Note that now oldaction is the previous SIGINT signal handler,
* to be restored later. */
f = fdopen(fd[0], "rb"); f = fdopen(fd[0], "rb");
if (f == NULL) if (f == NULL)
nperror("fdopen"); nperror("fdopen");
@ -1152,12 +1147,12 @@ bool execute_command(const char *command)
if (wait(NULL) == -1) if (wait(NULL) == -1)
nperror("wait"); nperror("wait");
/* If it was changed, restore the handler for SIGINT. */
if (!sig_failed && sigaction(SIGINT, &oldaction, NULL) == -1) if (!sig_failed && sigaction(SIGINT, &oldaction, NULL) == -1)
nperror("sigaction"); nperror("sigaction");
/* Restore the terminal to its previous state. In the process, /* Restore the terminal to its desired state, and disable
* disable interpretation of the special control keys so that we can * interpretation of the special control keys again. */
* use Ctrl-C for other things. */
terminal_init(); terminal_init();
return TRUE; return TRUE;