diff --speed-large-files --minimal -Nru vte-0.11.11.orig/src/Makefile.in vte-0.11.11/src/Makefile.in
--- vte-0.11.11.orig/src/Makefile.in	2004-05-02 08:44:02.000000000 +0200
+++ vte-0.11.11/src/Makefile.in	2004-06-09 15:10:45.144201000 +0200
@@ -96,7 +96,7 @@
 INTLLIBS = @INTLLIBS@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
+LIBS = @LIBS@ -lglib-2.0
 LIBTOOL = @LIBTOOL@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
diff --speed-large-files --minimal -Nru vte-0.11.11.orig/src/vte.c vte-0.11.11/src/vte.c
--- vte-0.11.11.orig/src/vte.c	2004-05-02 08:43:01.000000000 +0200
+++ vte-0.11.11/src/vte.c	2004-06-09 15:11:46.349030000 +0200
@@ -1526,6 +1526,91 @@
 	return new_regex.tag;
 }
 
+
+
+
+
+static gboolean find_url(const char *data, int cursor, int *start, int *end)
+{
+	const char *allowed = "-_$.+!*(),;:@&=/?~#%";
+	const char *trim = ".),";
+	const char *starts[] = { "news://", "telnet://", "nttp://", "file://",
+				 "http://", "ftp://", "https://",
+				 "www", "ftp" };
+	const int nstarts = sizeof(starts) / sizeof(*starts);
+	gboolean dot;
+	int i, j;
+
+	/* Back up to just after the most recent non-URL character. */
+	for (i = cursor; i > 0; i--) {
+		if (!isalnum(data[i - 1]) && !strchr(allowed, data[i - 1]))
+			break;
+	}
+
+	/* Find an appropriate beginning. */
+	for (; i <= cursor; i++) {
+		if (!strchr("fhntw", data[i]))
+			continue;
+		for (j = 0; j < nstarts; j++) {
+		  	if (strncmp(data + i, starts[j],
+				    strlen(starts[j])) == 0)
+				break;
+		}
+		if (j < nstarts)
+			break;
+	}
+	if (i > cursor)
+		return FALSE;
+	*start = i;
+	i += strlen(starts[j]);
+
+	/* Find end of domain part.  We must see at least one dot if
+	 * our beginning wasn't a real URL scheme. */
+	dot = FALSE;
+	for (; data[i]; i++) {
+		if (data[i] == '.')
+			dot = TRUE;
+		else if (!isalnum(data[i]) && data[i] != '-')
+			break;
+	}
+	if (!dot && !strchr(starts[j], ':'))
+		return FALSE;
+
+	if (data[i] == ':')
+	  {
+	    i++;
+	    while (isdigit(data[i]))
+	      i++;
+	  }
+
+	/* If we've passed the cursor, then we only want this part. */
+	if (i > cursor) {
+		*end = i;
+		return TRUE;
+	}
+
+	if (data[i++] != '/')
+		return FALSE;
+
+	/* Find the end of the URL. */
+	for (; data[i]; i++) {
+		if (!isalnum(data[i]) && !strchr(allowed, data[i]))
+			break;
+	}
+	if (i <= cursor)
+		return FALSE;
+
+	/* If the last character looks like ending punctuation, trim it. */
+	*end = (strchr(trim, data[i - 1]) != NULL) ? i - 1 : i;
+	return TRUE;
+}
+
+
+
+
+
+
+
 /**
  * vte_terminal_match_set_cursor:
  * @terminal: a #VteTerminal
@@ -1586,7 +1671,7 @@
 				  long column, glong row,
 				  int *tag, int *start, int *end)
 {
-	int i, j, ret, offset;
+	int i, j, ret, offset, st, en;
 	struct vte_match_regex *regex = NULL;
 	struct _VteCharAttributes *attr = NULL;
 	gssize coffset;
@@ -1651,98 +1736,17 @@
 		return NULL;
 	}
 
-	/* Now iterate over each regex we need to match against. */
-	for (i = 0; i < terminal->pvt->match_regexes->len; i++) {
-		regex = &g_array_index(terminal->pvt->match_regexes,
-				       struct vte_match_regex,
-				       i);
-		/* Skip holes. */
-		if (regex->tag < 0) {
-			continue;
-		}
-		/* We'll only match the first item in the buffer which
-		 * matches, so we'll have to skip each match until we
-		 * stop getting matches. */
-		coffset = 0;
-		ret = _vte_regex_exec(regex->reg,
-				      terminal->pvt->match_contents + coffset,
-				      G_N_ELEMENTS(matches),
-				      matches);
-		while (ret == 0) {
-			for (j = 0;
-			     (j < G_N_ELEMENTS(matches)) &&
-			     (matches[j].rm_so != -1);
-			     j++) {
-				/* The offsets should be "sane". */
-				g_assert(matches[j].rm_so + coffset <
-					 terminal->pvt->match_attributes->len);
-				g_assert(matches[j].rm_eo + coffset <=
-					 terminal->pvt->match_attributes->len);
-#ifdef VTE_DEBUG
-				if (_vte_debug_on(VTE_DEBUG_MISC)) {
-					char *match;
-					struct _VteCharAttributes *sattr, *eattr;
-					match = g_strndup(terminal->pvt->match_contents + matches[j].rm_so + coffset,
-							  matches[j].rm_eo - matches[j].rm_so);
-					sattr = &g_array_index(terminal->pvt->match_attributes,
-							       struct _VteCharAttributes,
-							       matches[j].rm_so + coffset);
-					eattr = &g_array_index(terminal->pvt->match_attributes,
-							       struct _VteCharAttributes,
-							       matches[j].rm_eo + coffset - 1);
-					fprintf(stderr, "Match %d `%s' from %d(%ld,%ld) to %d(%ld,%ld) (%d).\n",
-						j, match,
-						matches[j].rm_so + coffset,
-						sattr->column,
-						sattr->row,
-						matches[j].rm_eo + coffset - 1,
-						eattr->column,
-						eattr->row,
-						offset);
-					g_free(match);
+
+	if (find_url(terminal->pvt->match_contents, offset, &st, &en)) {
+		if (tag)
+			*tag = 0;
+		if (start)
+			*start = st;
+		if (end)
+			*end = en - 1;
+		return g_strndup(terminal->pvt->match_contents + st, en - st);
 
 				}
-#endif
-				/* Snip off any final newlines. */
-				while ((matches[j].rm_eo > matches[j].rm_so) &&
-				       (terminal->pvt->match_contents[coffset + matches[j].rm_eo - 1] == '\n')) {
-					matches[j].rm_eo--;
-				}
-				/* If the pointer is in this substring,
-				 * then we're done. */
-				if ((offset >= (matches[j].rm_so + coffset)) &&
-				    (offset < (matches[j].rm_eo + coffset))) {
-					if (tag != NULL) {
-						*tag = regex->tag;
-					}
-					if (start != NULL) {
-						*start = coffset +
-							 matches[j].rm_so;
-					}
-					if (end != NULL) {
-						*end = coffset +
-						       matches[j].rm_eo - 1;
-					}
-					if (GTK_WIDGET_REALIZED(GTK_WIDGET(terminal))) {
-						gdk_window_set_cursor((GTK_WIDGET(terminal))->window,
-								      regex->cursor);
-					}
-					terminal->pvt->match_previous = regex->tag;
-					return g_strndup(terminal->pvt->match_contents + coffset + matches[j].rm_so,
-							 matches[j].rm_eo - matches[j].rm_so);
-				}
-			}
-			/* Skip past the beginning of this match to
-			 * look for more. */
-			coffset += (matches[0].rm_so + 1);
-			ret = _vte_regex_exec(regex->reg,
-					      terminal->pvt->match_contents +
-					      coffset,
-					      G_N_ELEMENTS(matches),
-					      matches);
-		}
-	}
-	terminal->pvt->match_previous = -1;
 	return NULL;
 }
 
@@ -11889,6 +11893,7 @@
 						     terminal);
 		g_object_unref(G_OBJECT(terminal->pvt->pty_reaper));
 	}
+	terminal->pvt->pty_pid = -1;
 	terminal->pvt->pty_reaper = NULL;
 
 	/* Stop processing input. */
