Allowing --historylog and --poslog to function
also when --ignorercfiles is given. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4987 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
d840302f28
Коммит
fcb4c3fc6e
@ -2,6 +2,8 @@
|
|||||||
* src/nano.c (window_init): Rename 'no_more_space()' to 'more_space()'
|
* src/nano.c (window_init): Rename 'no_more_space()' to 'more_space()'
|
||||||
for consistency, and tweak the related comments.
|
for consistency, and tweak the related comments.
|
||||||
* src/files.c: Update some comments to match the current status.
|
* src/files.c: Update some comments to match the current status.
|
||||||
|
* src/nano (finish, main): Allow -H/--historylog and -P/--poslog to
|
||||||
|
function also when -I/--ignorercfiles is given.
|
||||||
|
|
||||||
2014-06-18 Benno Schulenberg <bensberg@justemail.net>
|
2014-06-18 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/text.c: Rename 'to_end' to 'to_eof', to lessen confusion
|
* src/text.c: Rename 'to_end' to 'to_eof', to lessen confusion
|
||||||
|
17
src/nano.c
17
src/nano.c
@ -613,9 +613,9 @@ void finish(void)
|
|||||||
tcsetattr(0, TCSANOW, &oldterm);
|
tcsetattr(0, TCSANOW, &oldterm);
|
||||||
|
|
||||||
#if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
|
#if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
|
||||||
if (!no_rcfiles && ISSET(HISTORYLOG))
|
if (ISSET(HISTORYLOG))
|
||||||
save_history();
|
save_history();
|
||||||
if (!no_rcfiles && ISSET(POS_HISTORY)) {
|
if (ISSET(POS_HISTORY)) {
|
||||||
update_poshistory(openfile->filename, openfile->current->lineno, xplustabs() + 1);
|
update_poshistory(openfile->filename, openfile->current->lineno, xplustabs() + 1);
|
||||||
save_poshistory();
|
save_poshistory();
|
||||||
}
|
}
|
||||||
@ -2410,14 +2410,16 @@ int main(int argc, char **argv)
|
|||||||
if (*(tail(argv[0])) == 'r')
|
if (*(tail(argv[0])) == 'r')
|
||||||
SET(RESTRICTED);
|
SET(RESTRICTED);
|
||||||
|
|
||||||
/* If we're using restricted mode, disable suspending, backups, and
|
/* If we're using restricted mode, disable suspending, backups,
|
||||||
* reading rcfiles, since they all would allow reading from or
|
* rcfiles, and history files, since they all would allow reading
|
||||||
* writing to files not specified on the command line. */
|
* from or writing to files not specified on the command line. */
|
||||||
if (ISSET(RESTRICTED)) {
|
if (ISSET(RESTRICTED)) {
|
||||||
UNSET(SUSPEND);
|
UNSET(SUSPEND);
|
||||||
UNSET(BACKUP_FILE);
|
UNSET(BACKUP_FILE);
|
||||||
#ifndef DISABLE_NANORC
|
#ifndef DISABLE_NANORC
|
||||||
no_rcfiles = TRUE;
|
no_rcfiles = TRUE;
|
||||||
|
UNSET(HISTORYLOG);
|
||||||
|
UNSET(POS_HISTORY);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2529,9 +2531,9 @@ int main(int argc, char **argv)
|
|||||||
/* Set up the search/replace history. */
|
/* Set up the search/replace history. */
|
||||||
history_init();
|
history_init();
|
||||||
#ifndef DISABLE_NANORC
|
#ifndef DISABLE_NANORC
|
||||||
if (!no_rcfiles) {
|
|
||||||
if (ISSET(HISTORYLOG) || ISSET(POS_HISTORY)) {
|
if (ISSET(HISTORYLOG) || ISSET(POS_HISTORY)) {
|
||||||
if (check_dotnano() == 0) {
|
get_homedir();
|
||||||
|
if (homedir == NULL || check_dotnano() == 0) {
|
||||||
UNSET(HISTORYLOG);
|
UNSET(HISTORYLOG);
|
||||||
UNSET(POS_HISTORY);
|
UNSET(POS_HISTORY);
|
||||||
}
|
}
|
||||||
@ -2540,7 +2542,6 @@ int main(int argc, char **argv)
|
|||||||
load_history();
|
load_history();
|
||||||
if (ISSET(POS_HISTORY))
|
if (ISSET(POS_HISTORY))
|
||||||
load_poshistory();
|
load_poshistory();
|
||||||
}
|
|
||||||
#endif /* !DISABLE_NANORC */
|
#endif /* !DISABLE_NANORC */
|
||||||
|
|
||||||
/* Set up the backup directory (unless we're using restricted mode,
|
/* Set up the backup directory (unless we're using restricted mode,
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user