• R/O
  • SSH
  • HTTPS

yash: Commit


Commit MetaInfo

Revision3824 (tree)
Time2018-03-04 12:02:33
Authormagicant

Log Message

Disable err-return while completion

The err-return option breaks existing completion functions that were
written before the option was introduced. For compatibility, the option
has to be disabled while completion functions are executed.

Change Summary

Incremental Difference

--- yash/trunk/doc/ja/lineedit.txt (revision 3823)
+++ yash/trunk/doc/ja/lineedit.txt (revision 3824)
@@ -1533,7 +1533,7 @@
15331533
15341534 補完関数の実行中は、端末に対して入出力を行ってはなりません (端末の表示が乱れてしまいます)。スムーズな補完を行うために、補完の実行中に長い時間のかかる処理を行うのは避けてください。
15351535
1536-補完の実行中は、link:posix.html[POSIX 準拠モード]が強制的に解除されます。また link:_set.html#so-errexit[errexit オプション]は無効となり、link:_trap.html[トラップ]は実行されません。
1536+補完の実行中は、link:posix.html[POSIX 準拠モード]と link:_set.html#so-errreturn[err-return オプション]が強制的に解除されます。また link:_set.html#so-errexit[err-exit オプション]は無視され、link:_trap.html[トラップ]は実行されません。
15371537
15381538 [[prediction]]
15391539 == コマンドライン推定
--- yash/trunk/doc/lineedit.txt (revision 3823)
+++ yash/trunk/doc/lineedit.txt (revision 3824)
@@ -1791,8 +1791,9 @@
17911791
17921792 While a completion function is being executed:
17931793
1794-- the link:posix.html[POSIXly-correct mode] is temporarily disabled,
1795-- the link:_set.html#so-errexit[err-exit option] is temporarily disabled, and
1794+- the link:posix.html[POSIXly-correct mode] and the
1795+ link:_set.html#so-errreturn[err-return option] are temporarily disabled,
1796+- the link:_set.html#so-errexit[err-exit option] is temporarily ignored, and
17961797 - link:_trap.html[traps] are not executed.
17971798
17981799 [[prediction]]
--- yash/trunk/exec.c (revision 3823)
+++ yash/trunk/exec.c (revision 3824)
@@ -1639,9 +1639,9 @@
16391639
16401640 execstate_T *saveexecstate = save_execstate();
16411641 int savelaststatus = laststatus;
1642- bool saveposix = posixly_correct;
1642+ bool saveposix = posixly_correct, saveerrreturn = shopt_errreturn;
16431643 reset_execstate(true);
1644- posixly_correct = false;
1644+ posixly_correct = false, shopt_errreturn = false;
16451645
16461646 le_compdebug("executing completion function \"%ls\"", funcname);
16471647
@@ -1650,7 +1650,7 @@
16501650 le_compdebug("finished executing completion function \"%ls\"", funcname);
16511651 le_compdebug(" with the exit status of %d", laststatus);
16521652
1653- posixly_correct = saveposix;
1653+ posixly_correct = saveposix, shopt_errreturn = saveerrreturn;
16541654 laststatus = savelaststatus;
16551655 cancel_return();
16561656 restore_execstate(saveexecstate);
Show on old repository browser