Reducing the number of indentation steps elsewhere too.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5555 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
96b9249f91
commit
ecf3cd7244
|
@ -1,3 +1,6 @@
|
||||||
|
2016-01-13 Benno Schulenberg <bensberg@justemail.net>
|
||||||
|
* src/files.c (save_poshistory): Reduce the indentation.
|
||||||
|
|
||||||
2016-01-12 Benno Schulenberg <bensberg@justemail.net>
|
2016-01-12 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* NEWS: Fix some typos and whitespace, and normalize the dates.
|
* NEWS: Fix some typos and whitespace, and normalize the dates.
|
||||||
* src/files.c (load_poshistory): Rename a variable.
|
* src/files.c (load_poshistory): Rename a variable.
|
||||||
|
|
39
src/files.c
39
src/files.c
|
@ -3107,36 +3107,33 @@ void save_history(void)
|
||||||
/* Save the recorded last file positions to ~/.nano/filepos_history. */
|
/* Save the recorded last file positions to ~/.nano/filepos_history. */
|
||||||
void save_poshistory(void)
|
void save_poshistory(void)
|
||||||
{
|
{
|
||||||
char *poshist;
|
char *poshist = poshistfilename();
|
||||||
char *statusstr = NULL;
|
char *statusstr = NULL;
|
||||||
poshiststruct *posptr;
|
poshiststruct *posptr;
|
||||||
|
FILE *hist;
|
||||||
|
|
||||||
poshist = poshistfilename();
|
if (poshist == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (poshist != NULL) {
|
hist = fopen(poshist, "wb");
|
||||||
FILE *hist = fopen(poshist, "wb");
|
|
||||||
|
|
||||||
if (hist == NULL)
|
if (hist == NULL)
|
||||||
fprintf(stderr, _("Error writing %s: %s\n"), poshist,
|
fprintf(stderr, _("Error writing %s: %s\n"), poshist, strerror(errno));
|
||||||
strerror(errno));
|
else {
|
||||||
else {
|
/* Don't allow others to read or write the history file. */
|
||||||
/* Make sure no one else can read from or write to the
|
chmod(poshist, S_IRUSR | S_IWUSR);
|
||||||
* history file. */
|
|
||||||
chmod(poshist, S_IRUSR | S_IWUSR);
|
|
||||||
|
|
||||||
for (posptr = position_history; posptr != NULL; posptr = posptr->next) {
|
for (posptr = position_history; posptr != NULL; posptr = posptr->next) {
|
||||||
statusstr = charalloc(strlen(posptr->filename) + 2 * sizeof(ssize_t) + 4);
|
statusstr = charalloc(strlen(posptr->filename) + 2 * sizeof(ssize_t) + 4);
|
||||||
sprintf(statusstr, "%s %ld %ld\n", posptr->filename, (long)posptr->lineno,
|
sprintf(statusstr, "%s %ld %ld\n", posptr->filename, (long)posptr->lineno,
|
||||||
(long)posptr->xno);
|
(long)posptr->xno);
|
||||||
if (fwrite(statusstr, sizeof(char), strlen(statusstr), hist) < strlen(statusstr))
|
if (fwrite(statusstr, sizeof(char), strlen(statusstr), hist) < strlen(statusstr))
|
||||||
fprintf(stderr, _("Error writing %s: %s\n"), poshist,
|
fprintf(stderr, _("Error writing %s: %s\n"), poshist, strerror(errno));
|
||||||
strerror(errno));
|
free(statusstr);
|
||||||
free(statusstr);
|
|
||||||
}
|
|
||||||
fclose(hist);
|
|
||||||
}
|
}
|
||||||
free(poshist);
|
fclose(hist);
|
||||||
}
|
}
|
||||||
|
free(poshist);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update the recorded last file positions, given a filename, a line
|
/* Update the recorded last file positions, given a filename, a line
|
||||||
|
|
Loading…
Reference in New Issue