tabsize value is handled.
- Remove several unnecessary reset_cursor() calls. (David
Benbennick)
+ - Include <sys/types.h> in proto.h. (David Benbennick) DLR:
+ Remove some redundant inclusions of <sys/types.h> elsewhere.
- files.c:
close_open_file()
- Tweak to no longer rely on the return values of
#include <string.h>
#include <stdio.h>
#include <errno.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "proto.h"
#include <string.h>
#include <stdio.h>
#include <unistd.h>
-#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <utime.h>
matchline = charalloc(strlen(userdata->pw_name) + 2);
sprintf(matchline, "~%s", userdata->pw_name);
matches[*num_matches] = matchline;
- ++*num_matches;
+ ++(*num_matches);
/* If there's no more room, bail out */
if (*num_matches == BUFSIZ)
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/param.h>
-#include <sys/types.h>
#include <sys/wait.h>
#include <errno.h>
#include <ctype.h>
#ifndef NANO_SMALL
const char *indentation = NULL;
/* Indentation to prepend to the new line. */
- size_t indent_len = 0; /* strlen(indentation) */
+ size_t indent_len = 0; /* strlen(indentation) */
#endif
const char *after_break; /* Text after the wrap point. */
size_t after_break_len; /* strlen(after_break) */
int wrapping = FALSE; /* Do we prepend to the next line? */
const char *wrap_line = NULL;
- /* The next line, minus indentation */
+ /* The next line, minus indentation. */
size_t wrap_line_len = 0; /* strlen(wrap_line) */
char *newline = NULL; /* The line we create. */
size_t new_line_len = 0; /* Eventual length of newline. */
/* There are three steps. First, we decide where to wrap. Then, we
* create the new wrap line. Finally, we clean up. */
-/* Step 1, finding where to wrap. We are going to add a new-line
+/* Step 1, finding where to wrap. We are going to add a new line
* after a whitespace character. In this step, we set wrap_loc as the
* location of this replacement.
*
/* Step 3, clean up. Here we reposition the cursor and mark, and do
* some other sundry things. */
- /* later wraps of this line will be prepended to the next line. */
+ /* Later wraps of this line will be prepended to the next line. */
same_line_wrap = TRUE;
/* Each line knows its line number. We recalculate these if we
}
#ifndef NANO_SMALL
- /* If the mark was on this line after the wrap point, we move it down.
- * If it was on the next line and we wrapped, we must move it
+ /* If the mark was on this line after the wrap point, we move it
+ * down. If it was on the next line and we wrapped, we move it
* right. */
if (mark_beginbuf == inptr && mark_beginx > wrap_loc) {
mark_beginbuf = inptr->next;
size_t qdepth = 0;
size_t qlen = strlen(quotestr);
- /* Compute quote depth level */
+ /* Compute quote depth level. */
while (!strcmp(line + qdepth, quotestr))
qdepth += qlen;
return qdepth;
/* Externs. */
#include <sys/stat.h>
+#include <sys/types.h>
#ifdef HAVE_REGEX_H
#include <regex.h>
#endif
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <pwd.h>
* that we find one only once per line. We should only end up
* back at the same position if the string isn't found again, in
* which case it's the only occurrence. */
- if (ISSET(USE_REGEXP) && regexp_bol_or_eol(&search_regexp, last_search)) {
- didfind = findnextstr(TRUE, FALSE, current, current_x, answer, TRUE);
+ if (ISSET(USE_REGEXP) && regexp_bol_or_eol(&search_regexp,
+ last_search)) {
+ didfind = findnextstr(TRUE, FALSE, current, current_x,
+ answer, TRUE);
if (fileptr == current && fileptr_x == current_x && !didfind)
statusbar(_("This is the only occurrence"));
} else {
#endif
search_last_line = FALSE;
- didfind = findnextstr(TRUE, FALSE, current, current_x, last_search, FALSE);
+ didfind = findnextstr(TRUE, FALSE, current, current_x,
+ last_search, FALSE);
/* Check to see if there's only one occurrence of the string and
* we're on it now. */
* "^$"), so that we find one only once per line. We should
* only end up back at the same position if the string isn't
* found again, in which case it's the only occurrence. */
- if (ISSET(USE_REGEXP) && regexp_bol_or_eol(&search_regexp, last_search)) {
- didfind = findnextstr(TRUE, FALSE, current, current_x, answer, TRUE);
+ if (ISSET(USE_REGEXP) && regexp_bol_or_eol(&search_regexp,
+ last_search)) {
+ didfind = findnextstr(TRUE, FALSE, current, current_x,
+ answer, TRUE);
if (fileptr == current && fileptr_x == current_x && !didfind)
statusbar(_("This is the only occurrence"));
} else {
/* Apparent near redundancy with regexp_pat[] here is needed.
* "[][]" works, "[[]]" doesn't. */
- if (pos < brackets + (strlen(brackets) / 2)) { /* On a left bracket. */
+ if (pos < brackets + (strlen(brackets) / 2)) {
+ /* On a left bracket. */
regexp_pat[1] = wanted_ch;
regexp_pat[2] = ch_under_cursor;
UNSET(REVERSE_SEARCH);
- } else { /* On a right bracket. */
+ } else {
+ /* On a right bracket. */
regexp_pat[1] = ch_under_cursor;
regexp_pat[2] = wanted_ch;
SET(REVERSE_SEARCH);
search_last_line = FALSE;
while (TRUE) {
- if (findnextstr(FALSE, FALSE, current, current_x, regexp_pat, FALSE) != 0) {
+ if (findnextstr(FALSE, FALSE, current, current_x, regexp_pat,
+ FALSE) != 0) {
/* Found identical bracket. */
if (current->data[current_x] == ch_under_cursor)
count++;
current_y = current->lineno - edittop->lineno;
if (current_y < editwinrows) {
size_t x = xplustabs();
-
wmove(edit, current_y, x - get_page_start(x));
}
}
const filestruct *fileptr = filebot;
while (fileptr != NULL) {
- fprintf(stderr, "(%d) %s\n", fileptr->lineno, fileptr->data);
+ fprintf(stderr, "(%lu) %s\n", (unsigned long)fileptr->lineno, fileptr->data);
fileptr = fileptr->prev;
}
}