/* A new process to run sort in. */
if ((pid_sort = fork()) == 0) {
- /* Child continues (i.e. future spell process). Replace the
+ /* Child continues (i.e. future sort process). Replace the
* standard input with the standard output of the old pipe. */
if (dup2(spell_fd[0], STDIN_FILENO) != STDIN_FILENO)
goto close_pipes_and_exit;
close(sort_fd[1]);
- /* Start the sort program. Use -f to remove mixed case. If
- * this isn't portable, let me know. */
+ /* Start the sort program. Use -f to ignore case. */
execlp("sort", "sort", "-f", NULL);
/* This should not be reached if sort is found. */
search_replace_abort();
edit_refresh_needed = TRUE;
- /* Process the end of the spell process. */
+ /* Process the end of the three processes. */
waitpid(pid_spell, &spell_status, 0);
waitpid(pid_sort, &sort_status, 0);
waitpid(pid_uniq, &uniq_status, 0);
endwin();
- /* Set up an argument list to pass execvp(). */
+ /* Set up an argument list to pass to execvp(). */
if (spellargs == NULL) {
spellargs = (char **)nmalloc(arglen * sizeof(char *));
statusbar(_("Invoking linter, please wait"));
doupdate();
- /* Set up an argument list to pass execvp(). */
+ /* Set up an argument list to pass to execvp(). */
if (lintargs == NULL) {
lintargs = (char **)nmalloc(arglen * sizeof(char *));
}
lintargs[arglen - 2] = openfile->filename;
- /* A new process to run linter. */
+ /* A new process to run the linter in. */
if ((pid_lint = fork()) == 0) {
- /* Child continues (i.e. future spell process). */
+ /* Child continues (i.e. future linting process). */
close(lint_fd[0]);
- /* Send spell's standard output/err to the pipe. */
+ /* Send the linter's standard output + err to the pipe. */
if (dup2(lint_fd[1], STDOUT_FILENO) != STDOUT_FILENO)
exit(1);
if (dup2(lint_fd[1], STDERR_FILENO) != STDERR_FILENO)
return;
}
- /* Read in the returned spelling errors. */
+ /* Read in the returned syntax errors. */
read_buff_read = 0;
read_buff_size = pipe_buff_size + 1;
read_buff = read_buff_ptr = charalloc(read_buff_size);
fprintf(stderr, "text.c:do_lint:Raw output: %s\n", read_buff);
#endif
- /* Process output. */
+ /* Process the output. */
read_buff_word = read_buff_ptr = read_buff;
while (*read_buff_ptr != '\0') {
read_buff_ptr++;
}
- /* Process the end of the lint process. */
+ /* Process the end of the linting process.
+ * XXX: The return value should be checked.
+ * Will make an invocation-error routine. */
waitpid(pid_lint, &lint_status, 0);
free(read_buff);
}
#ifndef DISABLE_SPELLER
-/* Run a formatter for the given syntax.
- * Expects the formatter to be non-interactive and
- * operate on a file in-place, which we'll pass it
- * on the command line. Another mashup of the speller
- * and alt_speller routines.
- */
+/* Run a formatter for the current syntax. This expects the formatter
+ * to be non-interactive and operate on a file in-place, which we'll
+ * pass it on the command line. */
void do_formatter(void)
{
bool status;
endwin();
- /* Set up an argument list to pass execvp(). */
+ /* Set up an argument list to pass to execvp(). */
if (formatargs == NULL) {
formatargs = (char **)nmalloc(arglen * sizeof(char *));