- Miscellaneous comment fixes. (DLR)
- files.c:
do_insertfile()
- - Properly handle executable commands that contain nulls. (DLR)
+ - Properly handle files and executable commands that contain
+ nulls. (DLR)
- nano.h:
- Rename NANO_ALT_REPLACE_KEY to NANO_REPLACE_ALTKEY, for
consistency. (DLR)
char *ans = mallocstrcpy(NULL, "");
/* The last answer the user typed on the statusbar. */
filestruct *edittop_save = openfile->edittop;
- size_t current_x_save = openfile->current_x;
+ size_t current_x_save = openfile->current_x, answer_len;
ssize_t current_y_save = openfile->current_y;
bool at_edittop = FALSE;
/* Whether we're at the top of the edit window. */
}
#endif
+ answer_len = strlen(answer);
+
+ /* Convert newlines to nulls, just before we execute a
+ * command. */
+ sunder(answer);
+
#ifndef NANO_TINY
if (execute) {
- size_t answer_len = strlen(answer);
-
#ifdef ENABLE_MULTIBUFFER
if (ISSET(MULTIBUFFER))
/* Open a blank buffer. */
open_buffer("");
#endif
- /* Convert newlines to nulls, just before we execute a
- * command. */
- sunder(answer);
-
/* Save the command's output in the current buffer. */
execute_command(answer);
- /* Convert nulls to newlines. answer_len is answer's
- * real length. */
- unsunder(answer, answer_len);
-
#ifdef ENABLE_MULTIBUFFER
if (ISSET(MULTIBUFFER)) {
/* Move back to the beginning of the first line of
}
#endif
+ /* Convert nulls to newlines. answer_len is answer's real
+ * length. */
+ unsunder(answer, answer_len);
+
#ifdef ENABLE_MULTIBUFFER
if (ISSET(MULTIBUFFER))
/* Update the screen to account for the current