[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[5719] unrecognized commands in infokey; trap SIGTERM
From: |
Gavin D. Smith |
Subject: |
[5719] unrecognized commands in infokey; trap SIGTERM |
Date: |
Fri, 25 Jul 2014 17:14:24 +0000 |
Revision: 5719
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5719
Author: gavin
Date: 2014-07-25 17:14:21 +0000 (Fri, 25 Jul 2014)
Log Message:
-----------
unrecognized commands in infokey; trap SIGTERM
Modified Paths:
--------------
trunk/ChangeLog
trunk/info/infokey.c
trunk/info/signals.c
trunk/info/t/Infokey-config
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2014-07-24 13:20:27 UTC (rev 5718)
+++ trunk/ChangeLog 2014-07-25 17:14:21 UTC (rev 5719)
@@ -1,3 +1,13 @@
+2014-07-25 Gavin Smith <address@hidden>
+
+ * info/infokey.c (compile): Keep going for unrecognized or invalid
+ actions.
+ * info/t/Infokey-config: Add lines with invalid actions.
+
+ * info/signals.c (old_TERM): New variable.
+ (mask_termsig, initialize_info_signal_handler, info_signal_proc): Trap
+ SIGTERM as was done for SIGINT to allow cleanup of terminal state.
+
2014-07-24 Gavin Smith <address@hidden>
* info/infokey.c (compile): Don't allow binding to menu-digit.
Modified: trunk/info/infokey.c
===================================================================
--- trunk/info/infokey.c 2014-07-24 13:20:27 UTC (rev 5718)
+++ trunk/info/infokey.c 2014-07-25 17:14:21 UTC (rev 5719)
@@ -161,8 +161,9 @@
int
compile (FILE *fp, const char *filename, int *suppress_info, int *suppress_ea)
{
- int error = 0;
- char rescan = 0;
+ int error = 0; /* Set if there was a fatal error in reading init file. */
+ char rescan = 0; /* Whether to reuse the same character when moving onto the
+ next state. */
unsigned int lnum = 0;
int c = 0;
@@ -447,10 +448,18 @@
other than '0' .. '9'. */
syntax_error (filename, lnum,
_("cannot bind key sequence to menu-digit"));
- error = 1;
}
- else if (a != -1)
+ else if (a == -1)
{
+ /* Print an error message, but keep going (don't set
+ error = 1) for compatibility with infokey files aimed
+ at future versions which may have different
+ actions. */
+ syntax_error (filename, lnum, _("unknown action `%s'"),
+ act);
+ }
+ else
+ {
int keymap_bind_keyseq (Keymap, int *, KEYMAP_ENTRY *);
KEYMAP_ENTRY ke;
@@ -464,12 +473,6 @@
else /* section == ea */
keymap_bind_keyseq (echo_area_keymap, seq, &ke);
}
- else
- {
- syntax_error (filename, lnum, _("unknown action `%s'"),
- act);
- error = 1;
- }
}
}
else if (alen < sizeof act - 1)
Modified: trunk/info/signals.c
===================================================================
--- trunk/info/signals.c 2014-07-24 13:20:27 UTC (rev 5718)
+++ trunk/info/signals.c 2014-07-25 17:14:21 UTC (rev 5719)
@@ -80,6 +80,9 @@
#if defined (SIGINT)
sigaddset (set, SIGINT);
#endif
+#if defined (SIGTERM)
+ sigaddset (set, SIGTERM);
+#endif
# if defined (SIGUSR1)
sigaddset (set, SIGUSR1);
# endif
@@ -111,7 +114,7 @@
#endif /* !HAVE_SIGACTION */
static signal_info old_TSTP, old_TTOU, old_TTIN;
-static signal_info old_WINCH, old_INT, old_USR1;
+static signal_info old_WINCH, old_INT, old_TERM, old_USR1;
static signal_info old_QUIT;
void
@@ -145,6 +148,10 @@
set_termsig (SIGINT, &old_INT);
#endif
+#if defined (SIGTERM)
+ set_termsig (SIGTERM, &old_TERM);
+#endif
+
#if defined (SIGUSR1)
/* Used by DJGPP to simulate SIGTSTP on Ctrl-Z. */
set_termsig (SIGUSR1, &old_USR1);
@@ -232,6 +239,9 @@
#if defined (SIGINT)
case SIGINT:
#endif
+#if defined (SIGTERM)
+ case SIGTERM:
+#endif
{
#if defined (SIGTSTP)
if (sig == SIGTSTP)
@@ -249,6 +259,10 @@
if (sig == SIGINT)
old_signal_handler = &old_INT;
#endif /* SIGINT */
+#if defined (SIGTERM)
+ if (sig == SIGTERM)
+ old_signal_handler = &old_TERM;
+#endif /* SIGTERM */
/* For stop signals, restore the terminal IO, leave the cursor
at the bottom of the window, and stop us. */
Modified: trunk/info/t/Infokey-config
===================================================================
--- trunk/info/t/Infokey-config 2014-07-24 13:20:27 UTC (rev 5718)
+++ trunk/info/t/Infokey-config 2014-07-25 17:14:21 UTC (rev 5719)
@@ -1,5 +1,7 @@
#info
-D print-node # Dump node to file
+? xxx-not-recognized # Check that unknown actions don't break.
+! menu-digit # menu-digit can't be rebound
+D print-node # Dump node to file
#echo-area
#var
infopath-no-defaults=On
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [5719] unrecognized commands in infokey; trap SIGTERM,
Gavin D. Smith <=