Reducing the number of indentation steps.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5554 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2016-01-12 20:26:59 +00:00
parent 774c8ba1bf
commit 96b9249f91
2 changed files with 44 additions and 42 deletions

View File

@ -6,6 +6,7 @@
load_poshistory): Differentiate variable name from function names.
* src/files.c (load_poshistory): Remove a senseless iteration.
* src/files.c (load_poshistory): Condense the reading of a line.
* src/files.c (load_poshistory): Reduce the indentation.
GNU nano 2.5.1 - 2016.01.11

View File

@ -3201,17 +3201,19 @@ int check_poshistory(const char *file, ssize_t *line, ssize_t *column)
void load_poshistory(void)
{
char *poshist = poshistfilename();
FILE *hist;
/* Assume do_rcfile() has reported a missing home directory. */
if (poshist != NULL) {
FILE *hist = fopen(poshist, "rb");
/* If the home directory is missing, do_rcfile() will have reported it. */
if (poshist == NULL)
return;
hist = fopen(poshist, "rb");
if (hist == NULL) {
if (errno != ENOENT) {
/* Don't save history when we quit. */
/* When reading failed, don't save history when we quit. */
UNSET(POS_HISTORY);
history_error(N_("Error reading %s: %s"), poshist,
strerror(errno));
history_error(N_("Error reading %s: %s"), poshist, strerror(errno));
}
} else {
char *line = NULL, *lineptr, *xptr;
@ -3248,5 +3250,4 @@ void load_poshistory(void)
}
free(poshist);
}
}
#endif /* !DISABLE_HISTORIES */