summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--src/vte.c18
-rw-r--r--vte.spec5
3 files changed, 19 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index ade2604e..e97d75aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
2002-08-26 nalin
+ * src/vte.c: Don't deadlock when substitution fails, spotted by msw.
+
+2002-08-26 nalin
* src/vte.c: If GDK_USE_XFT is set, check the value of GDK_USE_XFT, not
VTE_USE_XFT. Spotted by hp.
diff --git a/src/vte.c b/src/vte.c
index 899ee786..f6fffd68 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -5906,6 +5906,10 @@ vte_terminal_process_incoming(gpointer data)
wcount = (obuf - obufptr) / sizeof(gunichar);
wbuf = (gunichar*) obufptr;
+ /* Initialize some state info we'll use to decide what to do next. */
+ start = 0;
+ modified = leftovers = again = FALSE;
+
/* Perform ISO-2022 and XTerm national charset substitutions. */
substitutions = vte_iso2022_copy(terminal->pvt->substitutions);
substitution_count = vte_iso2022_substitute(substitutions,
@@ -5913,8 +5917,8 @@ vte_terminal_process_incoming(gpointer data)
terminal->pvt->table);
if (substitution_count < 0) {
vte_iso2022_free(substitutions);
- g_free(obufptr);
- return terminal->pvt->processing;
+ leftovers = TRUE;
+ again = FALSE;
} else {
vte_iso2022_free(terminal->pvt->substitutions);
terminal->pvt->substitutions = substitutions;
@@ -5926,8 +5930,6 @@ vte_terminal_process_incoming(gpointer data)
cursor = screen->cursor_current;
/* Try initial substrings. */
- start = 0;
- modified = leftovers = again = FALSE;
while ((start < wcount) && !leftovers) {
/* Try to match any control sequences. */
vte_table_match(terminal->pvt->table,
@@ -6066,11 +6068,15 @@ vte_terminal_process_incoming(gpointer data)
} else {
/* No leftovers, clean out the data. */
terminal->pvt->n_incoming = 0;
- g_free(terminal->pvt->incoming);
+ if (terminal->pvt->incoming != NULL) {
+ g_free(terminal->pvt->incoming);
+ }
terminal->pvt->incoming = NULL;
again = FALSE;
}
- g_free(obufptr);
+ if (obufptr != NULL) {
+ g_free(obufptr);
+ }
if (modified) {
/* Keep the cursor on-screen if we scroll on output, or if
diff --git a/vte.spec b/vte.spec
index ba007377..7af94984 100644
--- a/vte.spec
+++ b/vte.spec
@@ -1,5 +1,5 @@
Name: vte
-Version: 0.8.6
+Version: 0.8.7
Release: 1
Summary: An experimental terminal emulator.
License: LGPL
@@ -61,6 +61,9 @@ rm $RPM_BUILD_ROOT/%{_libdir}/lib%{name}.la
%{_libdir}/pkgconfig/*
%changelog
+* Mon Aug 26 2002 Nalin Dahyabhai <nalin@redhat.com> 0.8.7-1
+- fix deadlock when substitutions fail
+
* Mon Aug 26 2002 Nalin Dahyabhai <nalin@redhat.com> 0.8.6-1
- one-liner segfault bug fix